Skip to content

Conversation

@xeniape
Copy link
Member

@xeniape xeniape commented Apr 1, 2025

Description

This PR adds the --locked flag to the cargo install commands to use the same dependencies and versions as defined in the Cargo.lock file to prevent older builds to resolve to newer versions and consequently breaking the build. This needs to be cherry-picked into older release branches.

Example error when building nifi on release-24.11 branch:

40.44 error: failed to compile `cargo-cyclonedx v0.5.5`, intermediate artifacts can be found at `/tmp/cargo-installrlShDo`.
40.44 To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
40.44 
40.44 Caused by:
40.44   rustc 1.80.1 is not supported by the following packages:
40.44     [email protected] requires rustc 1.81
40.44     [email protected] requires rustc 1.81
40.44   Try re-running `cargo install` with `--locked`
40.44 error: some crates failed to install

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes
- [ ] Changes are OpenShift compatible
- [ ] All added packages (via microdnf or otherwise) have a comment on why they are added
- [ ] Things not downloaded from Red Hat repositories should be mirrored in the Stackable repository and downloaded from there
- [ ] All packages should have (if available) signatures/hashes verified
- [ ] Add an entry to the CHANGELOG.md file
- [ ] Integration tests ran successfully
TIP: Running integration tests with a new product image

The image can be built and uploaded to the kind cluster with the following commands:

bake --product <product> --image-version <stackable-image-version>
kind load docker-image <image-tagged-with-the-major-version> --name=<name-of-your-test-cluster>

See the output of bake to retrieve the image tag for <image-tagged-with-the-major-version>.

@xeniape xeniape self-assigned this Apr 1, 2025
@xeniape xeniape marked this pull request as ready for review April 1, 2025 13:08
@xeniape xeniape moved this to Development: Waiting for Review in Stackable Engineering Apr 1, 2025
@NickLarsenNZ NickLarsenNZ moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Apr 2, 2025
@NickLarsenNZ NickLarsenNZ self-requested a review April 2, 2025 07:17
Copy link
Member

@NickLarsenNZ NickLarsenNZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good spotting!

@xeniape xeniape added this pull request to the merge queue Apr 2, 2025
Merged via the queue into main with commit c654ba8 Apr 2, 2025
3 checks passed
@xeniape xeniape deleted the fix/add-locked-flag-for-reproducibility branch April 2, 2025 07:24
xeniape added a commit that referenced this pull request Apr 2, 2025
* fix: Add  flag to cargo install commands

* add changelog entry
xeniape added a commit that referenced this pull request Apr 2, 2025
* fix: Add  flag to cargo install commands

* add changelog entry
xeniape added a commit that referenced this pull request Apr 2, 2025
* fix: Add  flag to cargo install commands

* add changelog entry
xeniape added a commit that referenced this pull request Apr 2, 2025
* fix: Add  flag to cargo install commands

* add changelog entry
@xeniape xeniape moved this from Development: In Review to Development: Done in Stackable Engineering Apr 2, 2025
@lfrancke lfrancke moved this from Development: Done to Done in Stackable Engineering Apr 4, 2025
xeniape added a commit that referenced this pull request Apr 4, 2025
fix: Add `--locked` flag to cargo install commands (#1044)

* fix: Add  flag to cargo install commands

* add changelog entry
xeniape added a commit that referenced this pull request Apr 4, 2025
fix: Add `--locked` flag to cargo install commands (#1044)

* fix: Add  flag to cargo install commands

* add changelog entry
xeniape added a commit that referenced this pull request Apr 4, 2025
fix: Add `--locked` flag to cargo install commands (#1044)

* fix: Add  flag to cargo install commands

* add changelog entry
xeniape added a commit that referenced this pull request Apr 4, 2025
fix: Add `--locked` flag to cargo install commands (#1044)

* fix: Add  flag to cargo install commands

* add changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants