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

Allow specifying rust versions #307

Merged
merged 1 commit into from
Apr 20, 2020
Merged

Conversation

kragniz
Copy link
Contributor

@kragniz kragniz commented Apr 19, 2020

No description provided.

@mfarrugi
Copy link
Collaborator

Before I merge this, can you share what your use-case for this was? It looks like you want to be able to use an older version of rustc, is that right?

The support for beta and nightly is also somewhat disingenuous, since it would only work for the handful of shas listed in util/fetch_shas_*.txt

@kragniz
Copy link
Contributor Author

kragniz commented Apr 19, 2020

@mfarrugi I wanted to easily build with a newer rust version (1.42.0) than the default. I didn't actually need the nightly or beta versions but it looked like it would be easy to add support for that as well.

Copy link
Collaborator

@damienmg damienmg left a comment

Choose a reason for hiding this comment

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

I thinks this change looks good but I will let Marco opine on if something needs to change.

@mfarrugi
Copy link
Collaborator

From what I understand, this only lets you choose between versions that we have sha's for because of Bazel's sha requirement, no?

I have no problem with this PR, but it doesn't look like it solves your problem.

@kragniz
Copy link
Contributor Author

kragniz commented Apr 20, 2020

@mfarrugi if the shas aren't in the list it just doesn't enforce them:

sha256 = FILE_KEY_TO_SHA.get(tool_suburl) or sha256,

Maybe the docs should say that changing the value to one that's not included in the shipped list will make your build non-hermetic.

@mfarrugi
Copy link
Collaborator

So you've tested this works? The docs imply it might error on empty string rather than None.

Feel free to update the doc, although I'm not too paranoid about the rust tool distros.

@kragniz
Copy link
Contributor Author

kragniz commented Apr 20, 2020

The default is an empty string, right?

It is optional to make development easier but should be set before shipping.

But yeah, I'm running my local builds with this patch and setting the version to 1.42.0.

@mfarrugi
Copy link
Collaborator

I don't think the default argument ever makes it through before this change, but didnt look into it.

Thanks!

@mfarrugi mfarrugi merged commit 3189246 into bazelbuild:master Apr 20, 2020
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