Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framework: Prevent noarch builds without DSM 5.2 #6249

Closed

Conversation

mreid-tt
Copy link
Contributor

@mreid-tt mreid-tt commented Oct 3, 2024

Description

This update ensures noarch builds only occur when DSM 5.2 is selected. Previously, noarch builds were triggered even when DSM 5.2 wasn't chosen. Now, noarch, noarch-6.1 and noarch-7.0 are properly tied to DSM 5.2, DSM 6.2 and DSM 7.x, respectively, improving build accuracy.

Follow-up on #6247 and #6229 (comment).

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Bug fix
  • New Package
  • Package update
  • Includes small framework changes
  • This change requires a documentation update (e.g. Wiki)

@mreid-tt mreid-tt self-assigned this Oct 3, 2024
@mreid-tt
Copy link
Contributor Author

mreid-tt commented Oct 3, 2024

@hgy59, after publishing several noarch packages with REQUIRED_MIN_DSM = 6.0 or higher, I noticed that builds for firmware 3.1-1594 were still being included, requiring manual removal from the repo. Since we no longer support this firmware, I'm proposing this PR to exclude it from the build process entirely.

@hgy59
Copy link
Contributor

hgy59 commented Oct 3, 2024

we need another solution, noarch is still needed for DSM 5.2

@mreid-tt
Copy link
Contributor Author

mreid-tt commented Oct 3, 2024

we need another solution, noarch is still needed for DSM 5.2

Is it possible to rename noarch to noarch-3.1 (or noarch-5.2) within the framework? I suspect the lack of a version number might be causing issues with the REQUIRED_MIN_DSM rules.

Do you have any other thoughts on what might be causing the issue?

EDIT: My suspicion is that this block isn't triggering:

# Check minimum DSM requirements of package
ifneq ($(REQUIRED_MIN_DSM),)
ifeq (,$(findstring $(ARCH),$(SRM_ARCHS)))
ifneq ($(REQUIRED_MIN_DSM),$(firstword $(sort $(TCVERSION) $(REQUIRED_MIN_DSM))))
ifneq (,$(BUILD_UNSUPPORTED_FILE))
$(shell echo $(date --date=now +"%Y.%m.%d %H:%M:%S") - $(SPK_FOLDER): DSM Toolchain $(TCVERSION) is lower than $(REQUIRED_MIN_DSM) >> $(BUILD_UNSUPPORTED_FILE))
endif
@$(error DSM Toolchain $(TCVERSION) is lower than $(REQUIRED_MIN_DSM))
endif
endif
endif

@mreid-tt mreid-tt changed the title Framework: Remove build architecture noarch (3.1) Framework: Set TCVERSION to 3.1 for noarch when undefined Oct 3, 2024
@mreid-tt
Copy link
Contributor Author

mreid-tt commented Oct 3, 2024

@hgy59, I've reconsidered my approach assuming that the reason the block fails is that the TCVERSION isn't set. I'm going to test the theory in my local fork to confirm if this is the case.

EDIT: So that didn't work. I'm open to other ideas on this.

@hgy59
Copy link
Contributor

hgy59 commented Oct 3, 2024

EDIT: So that didn't work. I'm open to other ideas on this.

I guess that we need to make TCVERSION mandanory for noach builds.
The related code is in spksrc.spk.mk.

currently to rebuild all noarch packages use (in the spk/{package} folder):

make clean
make
make TCVERSION=7.0
make TCVERSION=6.1
make TCVERSION=1.1

this should be changed to

make clean
make TCVERSION=3.1
make TCVERSION=7.0
make TCVERSION=6.1
make TCVERSION=1.1

@mreid-tt
Copy link
Contributor Author

mreid-tt commented Oct 3, 2024

I guess that we need to make TCVERSION mandanory for noach builds.
The related code is in spksrc.spk.mk.

Unfortunately, I've tried these two variations but neither work:

Original

spksrc/mk/spksrc.spk.mk

Lines 71 to 76 in 711444b

else
SPK_TCVERS = all
TC_OS_MIN_VER = 3.1-1594
endif
ARCH_SUFFIX = -$(SPK_TCVERS)
endif

Option 1

else
# Set default TCVERSION to 3.1 for noarch if not provided
TCVERSION = 3.1
SPK_TCVERS = all
TC_OS_MIN_VER = 3.1-1594
endif
ARCH_SUFFIX = -$(SPK_TCVERS)
endif

Option 2

else
# Set default TCVERSION to 3.1 for noarch if not provided
export TCVERSION=3.1
SPK_TCVERS = all
TC_OS_MIN_VER = 3.1-1594
endif
ARCH_SUFFIX = -$(SPK_TCVERS)
endif

@hgy59
Copy link
Contributor

hgy59 commented Oct 3, 2024

One problem is the ARCH= assignment to force "noarch" builds.
There are some targets that do not need a definition of ARCH, like make clean, make digests, ...

It would be easier to use something like ARCH = noarch instead, but then noarch must be handled to not expect a toolchain.

@mreid-tt
Copy link
Contributor Author

mreid-tt commented Oct 3, 2024

I'm not entirely sure how to address that suggestion, as it's getting a bit beyond my current understanding.

However, an alternative approach could be to segment the noarch versions by DSM as follows:

  • Include noarch in the DSM 5.2 architectures
  • noarch-6.1 in the DSM 6.2 architectures
  • noarch-7.0 in both DSM 7.x architectures

This way, the builds will align with the appropriate DSM version, and we can avoid the need for additional handling for noarch. What do you think?

@mreid-tt mreid-tt changed the title Framework: Set TCVERSION to 3.1 for noarch when undefined Framework: Prevent noarch builds without DSM 5.2 Oct 3, 2024
@mreid-tt
Copy link
Contributor Author

mreid-tt commented Oct 3, 2024

@hgy59, I've tested the simplified approach in my fork, and the build works as expected. Do you think this solution is ready for merging?

@hgy59
Copy link
Contributor

hgy59 commented Oct 3, 2024

@hgy59, I've tested the simplified approach in my fork, and the build works as expected. Do you think this solution is ready for merging?

sorry, I have worked on an other solution, using override ARCH=noarch for noarch packages.
will create a dedictated PR...

@mreid-tt
Copy link
Contributor Author

mreid-tt commented Oct 3, 2024

sorry, I have worked on an other solution, using override ARCH=noarch for noarch packages.
will create a dedictated PR...

No problem, once the issue with noarch is resolved I'm happy either way. Will close this one.

@mreid-tt mreid-tt closed this Oct 3, 2024
@mreid-tt mreid-tt deleted the framework-build-noarch branch October 3, 2024 20:57
@hgy59 hgy59 mentioned this pull request Oct 3, 2024
7 tasks
@mreid-tt
Copy link
Contributor Author

mreid-tt commented Oct 5, 2024

Superseded by #6250.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants