-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
check if it's rust-lang/rust CI job in llvm::is_ci_llvm_modified
#130383
check if it's rust-lang/rust CI job in llvm::is_ci_llvm_modified
#130383
Conversation
Signed-off-by: onur-ozkan <work@onurozkan.dev>
rustbot has assigned @Mark-Simulacrum. Use |
This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp. This PR modifies If appropriate, please update |
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.
thank you! I hope this fixes my workflow but we'll see~
CiEnv::is_ci() && config.rust_info.is_managed_git_subrepository() && { | ||
CiEnv::is_ci() && config.in_tree_llvm_info.is_managed_git_subrepository() && { |
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.
An alternative solution for the backtrace CI issue would be to forcing CI to fetch the LLVM submodule at the beginning of this function.
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 feels wrong to me - the checking here runs against the rust-lang/rust checkout, right, not the submodule? So whether or not it's available we should be able to determine if things are checked out...
At the very least it seems like this is worth a comment.
(I guess it's also not clear that is_managed_git_subrepository is ever going to be false in CI -- that seems like a strange condition).
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 guess it's also not clear that is_managed_git_subrepository is ever going to be false in CI -- that seems like a strange condition).
If you mean config.rust_info.is_managed_git_subrepository()
, it can be false for tarball sources. But for config.in_tree_llvm_info.is_managed_git_subrepository()
, it can be false when submodules aren't fetched and llvm.download-ci-llvm
is true.
For us, nothing changes because we always fetch submodules in our CI. This was more to help external CIs (like backtrace one — you can check their problem here) since they might not fetch all submodules and use download-ci-llvm=true
.
I tried to make this clear with some comments. Let me know if it needs more updates.
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.
Hm, I wonder if we should modify CiEnv::is_ci to only treat rust-lang/rust as a true CI env -- or at least provide a way to opt-out. I'm not sure that the various tweaks we do for our CI make sense to be done elsewhere, and none of them should be needed to get a build working (e.g., in backtrace's case, it sounds like they probably just want to be a regular consumer as-if they're a human on a laptop?)
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 would prefer to add an additional function to check if it's a rust-lang/rust-managed CI instead of modifying Ci::is_ci
to keep is_ci
logic the same for other downstream CI pipelines.
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'm a little confused -- it seems like this should be a no-op outside of CI (and so presumably fairly uninteresting)? Maybe we need to change some non-CI function too?
CiEnv::is_ci() && config.rust_info.is_managed_git_subrepository() && { | ||
CiEnv::is_ci() && config.in_tree_llvm_info.is_managed_git_subrepository() && { |
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 feels wrong to me - the checking here runs against the rust-lang/rust checkout, right, not the submodule? So whether or not it's available we should be able to determine if things are checked out...
At the very least it seems like this is worth a comment.
(I guess it's also not clear that is_managed_git_subrepository is ever going to be false in CI -- that seems like a strange condition).
f076532
to
08d1450
Compare
Signed-off-by: onur-ozkan <work@onurozkan.dev>
08d1450
to
6658c8e
Compare
@rustbot ready |
// If both are present, we can assume it's an upstream CI job | ||
// as they are always set unconditionally. | ||
&& std::env::var_os("CI_JOB_NAME").is_some() | ||
&& std::env::var_os("TOOLSTATE_REPO").is_some() |
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 could use git config --get remote.origin.url
instead of this if someone can confirm whether we run CI on any repository other than rust-lang/rust
.
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.
r=me, ideally with PR title/description adjusted
99b95b5
to
f4d3209
Compare
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
f4d3209
to
5840d87
Compare
llvm::is_ci_llvm_modified
@bors r=Mark-Simulacrum |
…llaumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#130383 (check if it's rust-lang/rust CI job in `llvm::is_ci_llvm_modified`) - rust-lang#130416 (resolve rust-lang#130122: reword 'sort-by' edge-conditions documentation) - rust-lang#130537 (rustdoc: add doc comment to DocVisitor) - rust-lang#130743 (Clarifications for set_nonblocking methods) - rust-lang#131010 (extend comment in global_llvm_features regarding target-cpu=native) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#130383 - onur-ozkan:ignore-llvm-changes-on-ci-llvm-true, r=Mark-Simulacrum check if it's rust-lang/rust CI job in `llvm::is_ci_llvm_modified` Changes `llvm::is_ci_llvm_modified` to only work on rust-lang/rust managed CI.
Changes
llvm::is_ci_llvm_modified
to only work on rust-lang/rust managed CI.