-
Notifications
You must be signed in to change notification settings - Fork 382
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
panic when image does not exist, warnings/errors have been emitted and running on CI or with CROSS_NO_WARNINGS=1
#661
Conversation
1d3a8c8
to
d837e8e
Compare
bors try |
tryBuild failed: |
CHANGELOG.md
Outdated
@@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). | |||
|
|||
## [Unreleased] | |||
|
|||
- #661 - Panic when image does not exist and running on CI or with `CROSS_FORCE_IMAGE=1` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is relatively pedantic, but bool::from_str
doesn't work with 1
, so it should be CROSS_FORCE_IMAGE=true
, or else force_image
is false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, should only check for the existance of the variable, but not care about the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it accept a certain range of values (since setting it to false
or 0
should be falsey, which true
or 1
should be truthy) rather than merely check the existence of the variable? This looks like it could also be relevant to CROSS_DOCKER_IN_DOCKER
.
Allow values of 0, 1, so values other than `true` or `false` can be provided. `VAR=0`, `VAR=`, `VAR=-0`, or `VAR=false` will evaluate to false, while the rest will evaluate to true. Affects cross-rs#661 and cross-rs#721.
Allow values of 0, 1, so values other than `true` or `false` can be provided. `VAR=0`, `VAR=`, `VAR=-0`, or `VAR=false` will evaluate to false, while the rest will evaluate to true. Affects cross-rs#661 and cross-rs#721.
722: Evaluate boolean environment variables as truthy or falsey. r=Emilgardis a=Alexhuszagh Allow values of 0, 1, so values other than `true` or `false` can be provided. `VAR=0`, `VAR=`, `VAR=-0`, or `VAR=false` will evaluate to false, while the rest will evaluate to true. Affects #661 and #721. Co-authored-by: Alex Huszagh <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor changes but this looks good.
src/cli.rs
Outdated
@@ -65,6 +66,9 @@ pub fn parse(target_list: &TargetList) -> Args { | |||
let docker_in_docker = env::var("CROSS_DOCKER_IN_DOCKER") | |||
.map(|s| bool::from_str(&s).unwrap_or_default()) | |||
.unwrap_or_default(); | |||
let force_image = env::var("CROSS_FORCE_IMAGE") | |||
.map(|s| bool::from_str(&s).unwrap_or_default()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can now use bool_from_envvar
, which should fix the issue mentioned in the README.
Does this still need to be a draft? Should be good to go, and since this is opt-in, we don't have to worry about breaking changes or anything. |
it's not opt in on CI though, which is where this will be hit the most (for good reasons) |
I think this should be included in 0.3.0, however as it is breaking in a subtle way, I think emitting a true "cargo" style warning (so that githubs and other CI's problem matchers pick it up) for deprecation/wrongness is good, we can make the env var force the behaviour, and later toggle the behaviour to always work |
Now that we've merged breaking changes for v0.3.0, this is ready for merging once all the conflicts have been fixed. |
d837e8e
to
ff32799
Compare
CROSS_FORCE_IMAGE=1
CROSS_NO_WARNINGS=1
CROSS_NO_WARNINGS=1
CROSS_NO_WARNINGS=1
ff32799
to
7d196d5
Compare
This comment has been minimized.
This comment has been minimized.
1c370e7
to
4bb6497
Compare
/ci try -t aarch64-unknown-linux-gnu |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4bb6497
to
c9bb6ab
Compare
/ci try |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/ci try |
No description provided.