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

fix: condition on target instead of exec #3373

Merged
merged 2 commits into from
Mar 29, 2022
Merged

fix: condition on target instead of exec #3373

merged 2 commits into from
Mar 29, 2022

Conversation

thesayyn
Copy link
Collaborator

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #3357

What is the new behavior?

nodejs toolchain was conditioned on the exec which led to nodejs_images using toolchain for the host instead of image target. hence images built from macOS were broken due to the wrong toolchain being used in runfiles.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Related issues;

bazelbuild/rules_docker#2009

bazelbuild/rules_docker#1963

@thesayyn
Copy link
Collaborator Author

I will add container image structure tests to ensure that this type of error never goes unnoticed.

Copy link
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

Neat, we should do a follow-up to add some comments about how the ordering matters (linux target toolchain must be declared before non-linux host toolchain) but can be after shipping a release, which I want to do now :)

@@ -388,7 +388,10 @@ def nodejs_register_toolchains(name, register = True, **kwargs):
**kwargs
)
if register:
native.register_toolchains("@%s_toolchains//:%s_toolchain" % (name, platform))
native.register_toolchains(
"@%s_toolchains//:%s_toolchain_target" % (name, platform),
Copy link
Collaborator

Choose a reason for hiding this comment

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

comment that this one needs to be first so it's resolved

@alexeagle alexeagle merged commit 43159a5 into stable Mar 29, 2022
@alexeagle alexeagle deleted the nodejs_image_fix branch March 29, 2022 21:19
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