Respect the --ci flag in more places in bootstrap#152734
Respect the --ci flag in more places in bootstrap#152734Shunpoco wants to merge 1 commit intorust-lang:mainfrom
--ci flag in more places in bootstrap#152734Conversation
This comment has been minimized.
This comment has been minimized.
9cbfad4 to
3d26693
Compare
This comment has been minimized.
This comment has been minimized.
|
Replacing uses of |
|
Thanks, now I understand that bootstrap's --ci flag should not integrated into CiEnv. But I still think it's worth to introduce What do you think about it? |
3d26693 to
960683b
Compare
Why? That's exactly what should happen, if we override the mode to |
|
Because CiEnv has But if you think all CI env should go to CiEnv::GithubActions, I think that's fine. your way is much simpler than what I thought (now I feel that I was thinking too much). So can I write such a code in bootstrap config's parse_inner()? let ci_env = match flags_ci {
Some(true) => CiEnv::GitHubActions,
Some(false) => CiEnv::None,
None => CiEnv::current(),
}; |
It's actually the other way around - we used to have more variants there (e.g. Azure pipelines), but those were removed as they stopped being used in our CI. We don't really explicitly support any downstream usage of our CI, so we only maintain what we use upstream, and that is currently just GitHub Actions. We could turn
Yeah, sounds reasonable, because we anyway have to pass |
|
r? kobzol |
|
Thanks for the clarification! Now I fully understand that. |
960683b to
0596a08
Compare
src/build_helper/src/ci.rs
Outdated
There was a problem hiding this comment.
Default is a bit of a footgun here, and it's unclear to me that not being on CI is a good default anyway. ::current() should be used instead.
Since default seems to be unused, I think that you can just revert this change?
There was a problem hiding this comment.
I added Default to CiEnv because bootstrap's Config has Default (now ci_env is a member of Config).
But I just find that no one use Config::default(), so I will drop Default from both Config and CiEnv.
Update: I dropped Defaults in 7e22e90
--ci flag in more places in bootstrap
|
Thank you, left one nit. After fixing it, you can r=me. @bors delegate |
--ci flag in bootstrap is not respected in some cases. This commit modifies such inconsistencies in the tool.
7e22e90 to
d5574c5
Compare
|
Thanks for the review! Now I squashed my commits into one. @bors r=Kobzol |
|
Thanks! The |
…obzol Respect the `--ci` flag in more places in bootstrap ### Motivation Currently, the way of checking CI environment in bootstrap is not unified. Sometimes `--ci` flag is respected, but in other cases only GITHUB_ACTIONS env var is checked. ### Change This PR modifies the way of treating the flag in bootstrap. If `--ci` (or `--ci=true`) is added, bootstrap's config set ci_env as `CiEnv::GithubActions`. This PR also modifies some lines in bootstrap to respect the config's CiEnv instance. ### Note I haven't touched anything in tidy, because I want to raise another PR for introducing --ci flag in tidy. In the PR, I will need to change how tidy treats CI information. So currently I leave it as it is.
…obzol Respect the `--ci` flag in more places in bootstrap ### Motivation Currently, the way of checking CI environment in bootstrap is not unified. Sometimes `--ci` flag is respected, but in other cases only GITHUB_ACTIONS env var is checked. ### Change This PR modifies the way of treating the flag in bootstrap. If `--ci` (or `--ci=true`) is added, bootstrap's config set ci_env as `CiEnv::GithubActions`. This PR also modifies some lines in bootstrap to respect the config's CiEnv instance. ### Note I haven't touched anything in tidy, because I want to raise another PR for introducing --ci flag in tidy. In the PR, I will need to change how tidy treats CI information. So currently I leave it as it is.
…obzol Respect the `--ci` flag in more places in bootstrap ### Motivation Currently, the way of checking CI environment in bootstrap is not unified. Sometimes `--ci` flag is respected, but in other cases only GITHUB_ACTIONS env var is checked. ### Change This PR modifies the way of treating the flag in bootstrap. If `--ci` (or `--ci=true`) is added, bootstrap's config set ci_env as `CiEnv::GithubActions`. This PR also modifies some lines in bootstrap to respect the config's CiEnv instance. ### Note I haven't touched anything in tidy, because I want to raise another PR for introducing --ci flag in tidy. In the PR, I will need to change how tidy treats CI information. So currently I leave it as it is.
…uwer Rollup of 18 pull requests Successful merges: - #152799 (Subtree sync for rustc_codegen_cranelift) - #152569 (Stop using rustc_layout_scalar_valid_range_* in rustc) - #151059 (x86: support passing `u128`/`i128` to inline assembly) - #152097 (Suggest local variables for captured format args) - #152734 (Respect the `--ci` flag in more places in bootstrap) - #151703 (Fix ICE in transmutability error reporting when type aliases are normalized) - #152173 (Reflection TypeKind::FnPtr) - #152564 (Remove unnecessary closure.) - #152628 (tests: rustc_public: Check const allocation for all variables (1 of 11 was missing)) - #152658 (compiletest: normalize stderr before SVG rendering) - #152766 (std::r#try! - avoid link to nightly docs) - #152780 (Remove some clones in deriving) - #152787 (Add a mir-opt test for alignment check generation [zero changes outside tests]) - #152790 (Fix incorrect target in aarch64-unknown-linux-gnu docs) - #152792 (Fix an ICE while checking param env shadowing on an erroneous trait impl) - #152793 (Do no add -no-pie on Windows) - #152803 (Avoid delayed-bug ICE for malformed diagnostic attrs) - #152806 (interpret: fix comment typo)
…obzol Respect the `--ci` flag in more places in bootstrap ### Motivation Currently, the way of checking CI environment in bootstrap is not unified. Sometimes `--ci` flag is respected, but in other cases only GITHUB_ACTIONS env var is checked. ### Change This PR modifies the way of treating the flag in bootstrap. If `--ci` (or `--ci=true`) is added, bootstrap's config set ci_env as `CiEnv::GithubActions`. This PR also modifies some lines in bootstrap to respect the config's CiEnv instance. ### Note I haven't touched anything in tidy, because I want to raise another PR for introducing --ci flag in tidy. In the PR, I will need to change how tidy treats CI information. So currently I leave it as it is.
…uwer Rollup of 18 pull requests Successful merges: - #152799 (Subtree sync for rustc_codegen_cranelift) - #152814 (stdarch subtree update) - #151059 (x86: support passing `u128`/`i128` to inline assembly) - #152097 (Suggest local variables for captured format args) - #152734 (Respect the `--ci` flag in more places in bootstrap) - #151703 (Fix ICE in transmutability error reporting when type aliases are normalized) - #152173 (Reflection TypeKind::FnPtr) - #152564 (Remove unnecessary closure.) - #152628 (tests: rustc_public: Check const allocation for all variables (1 of 11 was missing)) - #152658 (compiletest: normalize stderr before SVG rendering) - #152766 (std::r#try! - avoid link to nightly docs) - #152780 (Remove some clones in deriving) - #152787 (Add a mir-opt test for alignment check generation [zero changes outside tests]) - #152790 (Fix incorrect target in aarch64-unknown-linux-gnu docs) - #152792 (Fix an ICE while checking param env shadowing on an erroneous trait impl) - #152793 (Do no add -no-pie on Windows) - #152803 (Avoid delayed-bug ICE for malformed diagnostic attrs) - #152806 (interpret: fix comment typo)
…uwer Rollup of 18 pull requests Successful merges: - #152799 (Subtree sync for rustc_codegen_cranelift) - #152814 (stdarch subtree update) - #151059 (x86: support passing `u128`/`i128` to inline assembly) - #152097 (Suggest local variables for captured format args) - #152734 (Respect the `--ci` flag in more places in bootstrap) - #151703 (Fix ICE in transmutability error reporting when type aliases are normalized) - #152173 (Reflection TypeKind::FnPtr) - #152564 (Remove unnecessary closure.) - #152628 (tests: rustc_public: Check const allocation for all variables (1 of 11 was missing)) - #152658 (compiletest: normalize stderr before SVG rendering) - #152766 (std::r#try! - avoid link to nightly docs) - #152780 (Remove some clones in deriving) - #152787 (Add a mir-opt test for alignment check generation [zero changes outside tests]) - #152790 (Fix incorrect target in aarch64-unknown-linux-gnu docs) - #152792 (Fix an ICE while checking param env shadowing on an erroneous trait impl) - #152793 (Do no add -no-pie on Windows) - #152803 (Avoid delayed-bug ICE for malformed diagnostic attrs) - #152806 (interpret: fix comment typo)
Motivation
Currently, the way of checking CI environment in bootstrap is not unified. Sometimes
--ciflag is respected, but in other cases only GITHUB_ACTIONS env var is checked.Change
This PR modifies the way of treating the flag in bootstrap. If
--ci(or--ci=true) is added, bootstrap's config set ci_env asCiEnv::GithubActions. This PR also modifies some lines in bootstrap to respect the config's CiEnv instance.Note
I haven't touched anything in tidy, because I want to raise another PR for introducing --ci flag in tidy. In the PR, I will need to change how tidy treats CI information. So currently I leave it as it is.