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

Add sysroot support to build.rs scripts. #664

Merged
merged 5 commits into from
Apr 2, 2021

Conversation

sayrer
Copy link
Contributor

@sayrer sayrer commented Mar 30, 2021

If there's a sysroot, it needs to appear before any other flags. See: #659.

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Thanks!

@hlopko
Copy link
Member

hlopko commented Mar 31, 2021

Could you add a unit test? Hopefully #608 is a good starting example?

@sayrer
Copy link
Contributor Author

sayrer commented Mar 31, 2021

Could you add a unit test? Hopefully #608 is a good starting example?

I'm not really certain how I would add a unit test for this, at least in that style. This patch doesn't change the analysis. edit: Perhaps I'm meant to check https://docs.bazel.build/versions/master/skylark/lib/Action.html#env for all of this stuff? FWIW, I think it would be easy to add a test for this if anything else was tested in this way. I just don't know that much about how the skylib test library works, or whether cargo_build_script.bzl is suitably factored to be tested this way.

@hlopko
Copy link
Member

hlopko commented Apr 1, 2021

Yeah you're right, using a cc toolchain with a sysroot in a unittest is hard. Ignore my comment. @illicitonion can you merge this PR (since you approved and didn't merge I don't want to step in)?

@illicitonion
Copy link
Collaborator

I thought I pressed the merge button when I approved! ... Weird.

@illicitonion
Copy link
Collaborator

Oh, looks like I don't have permission to merge main - @sayrer could you rebase/merge main and I'll merge to main? Thanks!

@sayrer
Copy link
Contributor Author

sayrer commented Apr 1, 2021

Huh, now I'm getting Buildkite complaints about files that aren't in my patch. Will take a look later on today.

@UebelAndre
Copy link
Collaborator

Seems like buildifier was fixed 😄

@sayrer
Copy link
Contributor Author

sayrer commented Apr 1, 2021

Put up #675. It seems like I just got unlucky here.

@hlopko
Copy link
Member

hlopko commented Apr 2, 2021

And we'll need a merge again :/

@hlopko hlopko merged commit a667ff9 into bazelbuild:main Apr 2, 2021
@hlopko
Copy link
Member

hlopko commented Apr 2, 2021

Thank you!

@sayrer sayrer deleted the sysroots_in_build_rs branch April 2, 2021 17:08
yagehu pushed a commit to yagehu/rules_rust that referenced this pull request Apr 23, 2021
* Add sysroot support to build.rs scripts.

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

Successfully merging this pull request may close these issues.

None yet

4 participants