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

Avoid overriding WORK_DIR for toolchain #5671

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonathan-conder
Copy link
Contributor

Description

Overriding WORK_DIR has undesirable side effects, e.g. the toolchain has to be unpacked again.

I guess it was added because the spk WORK_DIR wasn't being deduced correctly - this should be fixed by including the toolchain version in build-arch-%. As a bonus you can now say make arch-{ARCH} if DEFAULT_TC is set.

I also removed some cleanup code when building kernel modules. This doesn't seem necessary, and rebuilding after deleting the toolchain gives me warnings about rustup already being installed. I've only been building things for 1 architecture though, so if this change causes issues I'm happy to remove it from the PR.

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)

@hgy59 hgy59 requested a review from th0ma7 March 19, 2023 08:02
Comment on lines -597 to +595
$(MAKE) REQUIRE_KERNEL_MODULE= REQUIRE_KERNEL= WORK_DIR=$(PWD)/work-$* $(addprefix build-arch-, $*)
$(MAKE) REQUIRE_KERNEL_MODULE= REQUIRE_KERNEL= $(addprefix build-arch-, $(or $(filter $(addprefix %, $(DEFAULT_TC)), $(filter %$(word 2,$(subst -, ,$*)), $(filter $(firstword $(subst -, ,$*))%, $(AVAILABLE_TOOLCHAINS)))),$*))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides removing WORK_DIR what does the remaining portion do? Presuming alignment with other similar call previously?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that, for the target arch-XXXX-YYYY, it looks through AVAILABLE_TOOLCHAINS for one which starts with XXXX and ends with both YYYY and DEFAULT_TC, which should give XXXX-YYYY or nothing, in which case it falls back to XXXX-YYYY anyway.

For arch-XXXX, it looks through AVAILABLE_TOOLCHAINS for one which starts with XXXX and ends with DEFAULT_TC, so it should end up picking XXXX-DEFAULT_TC.

Previously the latter case wouldn't build at all, you had to specify the toolchain version in the make target.

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

Successfully merging this pull request may close these issues.

2 participants