-
Notifications
You must be signed in to change notification settings - Fork 318
Jah/chef 28642 rust 1.91.1 #10098
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
base: main
Are you sure you want to change the base?
Jah/chef 28642 rust 1.91.1 #10098
Conversation
👷 Deploy Preview for chef-habitat processing.
|
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.
Pull request overview
This PR upgrades the Rust toolchain from version 1.89.0 to 1.91.1 and includes necessary code updates to comply with the newer compiler version.
- Updates Rust toolchain to 1.91.1 across the project
- Refactors code to use newer Rust idioms (derive macros for Default, map_or_else)
- Enhances clippy script with auto-fix capability and improved configuration
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| rust-toolchain | Updates Rust channel from 1.89.0 to 1.91.1 |
| components/hab/src/license.rs | Modernizes Default implementation using derive macro with #[default] attribute |
| components/hab/src/cli_v4/svc/status.rs | Replaces map_or with map_or_else for lazy evaluation |
| Makefile | Adds conditional fix mode support for lint target |
| .github/workflows/rust-cargo-audit-check.yml | Updates GitHub Actions workflow to use Rust 1.91.1 |
| .expeditor/scripts/verify/run_clippy.sh | Refactors clippy script with simplified setup, argument parsing, and auto-fix mode |
c15cecc to
fe070d2
Compare
|
fe070d2 to
1741c92
Compare
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.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
1741c92 to
9669eec
Compare
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.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
280a32c to
496e2d3
Compare
Signed-off-by: Jason Heath <jason.heath@progress.com>
496e2d3 to
9c97fb6
Compare
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.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
e1384b1 to
4972516
Compare
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.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
4972516 to
f5d86a9
Compare
When upgrading to 1.91.1 there were issues running cargo clippy due to issues with our manipulation of the linker/dynamic interpreter. The issue was that when clippy executed and compiled build scripts the executables were being compiled with the system interpreter instead of the interpreter we wanted from the base-2025 channel. The issue presented itself as symbols missing from glibc as base-2025 uses glibc 2.41 while my system glibc happens to be 2.36. Here's what that turns into. We don't need to patchelf in this script anymore because we've pushed some of that down into our habitatized rust pkgs. There's also a better way to address it for other places. Nixed all that. Because we're many years down the road from when this script was created we also don't need to rustup in order to get clippy. Nixed all that. We can also play LD_LIBRARY_PATH games slightly better, maybe? Starting out LD_LIBRARY_PATH is managed to some extent down in our down rust habitat packaging now. However, even that doesn't resolve the core issue with the environment in which build scripts are compiled. To that extent our preferred gcc-base library is added here. In addition the RUSTFLAGS are configured in order to set the dynamic interpreter our preferred glibc more pervasively than the previous patchelf technique. Signed-off-by: Jason Heath <jason.heath@progress.com>
Signed-off-by: Jason Heath <jason.heath@progress.com>
- uses RUSTFLAGS to set the dynamic interpreter
- dupes RUSTFLAGS into RUSTDOCLAGS for tests in rustdoc
- leverages install_hab_pkg instead of 'sudo -E hab pkg install'
- export HAB_BLDR_CHANNEL="${HAB_BLDR_CHANNEL:="base-2025"}"
- reorders exports to be after setting of exported variable
Signed-off-by: Jason Heath <jason.heath@progress.com>
f5d86a9 to
1889073
Compare
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.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
| }; | ||
| let svc_desired_state = status.desired_state | ||
| .map_or("<none>".to_string(), |s| s.to_string()); | ||
| .map_or_else(|| "<none>".to_string(), |s| s.to_string()); |
Copilot
AI
Dec 16, 2025
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.
The closure || "<none>".to_string() creates an unnecessary allocation on every call to map_or_else. Since "<none>" is a constant string, use map_or instead to avoid the allocation overhead. The original map_or was correct here because the default value doesn't depend on computation - it's a simple constant that should be evaluated eagerly.
| .map_or_else(|| "<none>".to_string(), |s| s.to_string()); | |
| .map_or("<none>".to_string(), |s| s.to_string()); |
| echo "EXECUTING: cargo clippy --workspace --all-targets --no-deps -- ${clippy_args[*]}" | ||
| cargo clippy --workspace --all-targets --no-deps -- "${clippy_args[@]}" |
Copilot
AI
Dec 16, 2025
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.
The --no-deps flag prevents clippy from checking dependencies, but this may hide issues in the full build. Consider whether this flag is intentional or if it should check dependencies as the previous version did implicitly.
| echo "EXECUTING: cargo clippy --workspace --all-targets --no-deps -- ${clippy_args[*]}" | |
| cargo clippy --workspace --all-targets --no-deps -- "${clippy_args[@]}" | |
| echo "EXECUTING: cargo clippy --workspace --all-targets -- ${clippy_args[*]}" | |
| cargo clippy --workspace --all-targets -- "${clippy_args[@]}" |
No description provided.