Skip to content

Conversation

@jasonheath
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings December 12, 2025 17:43
@netlify
Copy link

netlify bot commented Dec 12, 2025

👷 Deploy Preview for chef-habitat processing.

Name Link
🔨 Latest commit 1889073
🔍 Latest deploy log https://app.netlify.com/projects/chef-habitat/deploys/6941c2e841057c0008afeacc

Copy link
Contributor

Copilot AI left a 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

@sonarqube-for-infrastructure-prod

@jasonheath jasonheath force-pushed the jah/CHEF-28642-rust-1.91.1 branch from fe070d2 to 1741c92 Compare December 15, 2025 20:24
Copilot AI review requested due to automatic review settings December 15, 2025 20:24
Copy link
Contributor

Copilot AI left a 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.

@jasonheath jasonheath force-pushed the jah/CHEF-28642-rust-1.91.1 branch from 1741c92 to 9669eec Compare December 15, 2025 20:50
Copilot AI review requested due to automatic review settings December 15, 2025 20:52
Copy link
Contributor

Copilot AI left a 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.

@jasonheath jasonheath force-pushed the jah/CHEF-28642-rust-1.91.1 branch from 280a32c to 496e2d3 Compare December 15, 2025 21:29
Signed-off-by: Jason Heath <jason.heath@progress.com>
Copilot AI review requested due to automatic review settings December 16, 2025 11:55
@jasonheath jasonheath force-pushed the jah/CHEF-28642-rust-1.91.1 branch from 496e2d3 to 9c97fb6 Compare December 16, 2025 11:55
Copy link
Contributor

Copilot AI left a 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.

@jasonheath jasonheath force-pushed the jah/CHEF-28642-rust-1.91.1 branch 2 times, most recently from e1384b1 to 4972516 Compare December 16, 2025 16:03
Copilot AI review requested due to automatic review settings December 16, 2025 16:03
Copy link
Contributor

Copilot AI left a 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.

@jasonheath jasonheath force-pushed the jah/CHEF-28642-rust-1.91.1 branch from 4972516 to f5d86a9 Compare December 16, 2025 19:22
Jason Heath added 3 commits December 16, 2025 15:34
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>
@jasonheath jasonheath force-pushed the jah/CHEF-28642-rust-1.91.1 branch from f5d86a9 to 1889073 Compare December 16, 2025 20:36
Copilot AI review requested due to automatic review settings December 16, 2025 20:36
Copy link
Contributor

Copilot AI left a 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());
Copy link

Copilot AI Dec 16, 2025

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.

Suggested change
.map_or_else(|| "<none>".to_string(), |s| s.to_string());
.map_or("<none>".to_string(), |s| s.to_string());

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +59
echo "EXECUTING: cargo clippy --workspace --all-targets --no-deps -- ${clippy_args[*]}"
cargo clippy --workspace --all-targets --no-deps -- "${clippy_args[@]}"
Copy link

Copilot AI Dec 16, 2025

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.

Suggested change
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[@]}"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants