-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix(ci): prepare.sh
should install the toolchain
#22572
Conversation
e6715bb
to
4ecdcc5
Compare
4ecdcc5
to
4a2d3fb
Compare
CI seems happy now: https://github.com/vectordotdev/vector/actions/runs/13636321013/job/38115894786 |
Datadog ReportBranch report: ✅ 0 Failed, 7 Passed, 0 Skipped, 25.44s Total Time |
prepare.sh
should install the toolchain
1ca3720
to
a30b56f
Compare
.github/workflows/k8s_e2e.yml
Outdated
@@ -101,6 +101,7 @@ jobs: | |||
- run: sudo -E bash scripts/ci-free-disk-space.sh | |||
- run: sudo -E bash scripts/environment/bootstrap-ubuntu-24.04.sh | |||
- run: bash scripts/environment/prepare.sh | |||
- run: sudo -E ~/.cargo/bin/rustup target add x86_64-unknown-linux-gnu |
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 the latest failure is because you are using sudo
to add the target resulting in the local user not being able to use it.
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.
With Rustup 1.28 (https://blog.rust-lang.org/2025/03/02/Rustup-1.28.0.html), rustup
will no longer automatically install the active toolchain if it is not installed.
Also, rust-lang/rustup#4217 (related to the previous fix)
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.
Aaaah, I see. Should we add this to the bootstrap or prepare script instead?
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.
It is already part of the prepare script. Not for the bootstrap, because that script is executed with sudo -E
and we want an installation for non-root users too.
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 confused why you had to add it here, too, then since it is right after the prepare.sh script which also runs it?
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.
Are you referring to https://github.com/vectordotdev/vector/blob/master/.github/workflows/k8s_e2e.yml#L104?
I basically followed the errors and added it. The prepare.sh
script runs rustup show active-toolchain || rustup toolchain install
and that doesn't install the x86_64-unknown-linux-gnu
target.
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 I'm getting turned around but I'd suggest that we try to move the direct commands into one of the bootstrap or prepare scripts to DRY it up rather than having it specified in different workflows. In the k8s_e2e case it has:
- run: bash scripts/environment/prepare.sh
- run: ~/.cargo/bin/rustup target add x86_64-unknown-linux-gnu
So here it seems like you could move the target add
to the prepare.sh script.
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.
Discussed offline, we can leave as is for now because it is a special target that is not required by all jobs.
Also, per https://x.com/rustlang/status/1896954416101732709?s=46&t=x164rvMb1LGppUzviMH60w we might be able to just delete all these one-off target add
lines.
… can remove 'sudo -E'
Summary
This https://github.com/vectordotdev/vector/actions/runs/13635254034/job/38112313325 fails on master.
Change Type
Is this a breaking change?
How did you test this PR?
Does this PR include user facing changes?
Checklist
make check-all
is a good command to run locally. This check isdefined here. Some of these
checks might not be relevant to your PR. For Rust changes, at the very least you should run:
cargo fmt --all
cargo clippy --workspace --all-targets -- -D warnings
cargo nextest run --workspace
(alternatively, you can runcargo test --all
)Cargo.lock
), pleaserun
dd-rust-license-tool write
to regenerate the license inventory and commit the changes (if any). More details here.References
Ref: rust-lang/rustup#4217