-
Notifications
You must be signed in to change notification settings - Fork 59
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
Expose 'trust_ci' as a feature flag under CI #73
base: master
Are you sure you want to change the base?
Conversation
This seems fine to me but:
|
234b3f4
to
bc0d74c
Compare
I think this is what you were asking for. I should note that I was expecting cross-rs/cross#91 to block this as then we can add a default whitelist for RUSTFLAGS to a template |
Yes, thanks. Now it's clear that this needs whitelisting the RUSTFLAGS variable. |
Interesting, it actually looks like |
Running cross on macOS doesn't use Docker at all (cross doesn't support macOS as a host) so the cross build environment on mac is the same as the Travis environment. |
Getting back to this now that cross-rs/cross#91 is merged, I'm actually uncertain how to set up Additionally, should this whitelist |
I think whitelisting RUSTFLAGS by default in Cross, itself, makes sense. As for avoiding copying around a Cross.toml in the general case we could use Cargo's convention of making the settings in there configurable via environment variables. For instance, in Cargo land |
I think I understand. So this would require another change to The only issue with this is then how does the user override this behavior easily? If they a) don't want to passthrough |
@Susurrus sorry, this PR fell off my radar.
Cargo uses spaces to split a strings into an array of strings. I think that should work here too since env variables can't have spaces in their names (or at least I think they can't).
Maybe put the CROSS_BUILD_ENV_PASSTHROUGH variable in the
They can comment out the CROSS_BUILD_ENV_PASSTHROUGH variable altogether.
They can manually edit the value of the variable to append other variable names. |
ci/script.sh
Outdated
@@ -4,6 +4,11 @@ set -ex | |||
|
|||
# TODO This is the "test phase", tweak it as you see fit | |||
main() { | |||
# Add a cfg spec to allow disabling specific tests under CI. | |||
if [ ! -z $CI ]; then | |||
export RUSTFLAGS=--cfg=trust_ci |
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.
I think it may be better to append this flag to RUSTFLAGS here in case the user may want to set RUSTFLAGS in the env.global field.
$CI was chosen instead of $TRAVIS and the ! -z check was done such that this can work on all CI platforms (at least GitLab CI, Travis CI, AppVeyor, and Circle CI).
bc0d74c
to
7dcf4a8
Compare
I fixed everything I think, but this relies on changes in Cross such that it will read from environment variables, IIUC. So this will block until I get that functionality added. |
Opened cross-rs/cross#147 to track the missing support for reading configuration from the environment. |
$CI was chosen instead of $TRAVIS and the ! -z check was done such that
this can work on all CI platforms (at least GitLab CI, Travis CI, AppVeyor,
and Circle CI).