Skip to content
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

starship/1.21.1-r0: cve remediation #36235

Merged
merged 2 commits into from
Jan 5, 2025

Conversation

octo-sts[bot]
Copy link
Contributor

@octo-sts octo-sts bot commented Dec 10, 2024

Copy link
Contributor Author

octo-sts bot commented Dec 10, 2024

Gen AI suggestions to solve the build error:

• Detected Error:

error: failed to select a version for the requirement `idna = "^0.5.0"`
candidate versions found which didn't match: 1.0.0
location searched: crates.io index
required by package `url v2.5.2`

• Error Category: Dependency/Version

• Failure Point: rust/cargobump step during dependency resolution

• Root Cause Analysis:
There's a version conflict in the Rust dependency chain. The package url v2.5.2 requires idna ^0.5.0, but only version 1.0.0 is available. This is a breaking change in the idna crate.

• Suggested Fix:
Add a cargo override in the pipeline to pin the specific version:

pipeline:
  - uses: git-checkout
    with:
      repository: https://github.com/starship/starship
      tag: v${{package.version}}
      expected-commit: 47ccc3603dc20edf4bb59e56b26d19f78a41e770

  - runs: |
      cargo update -p idna --precise 0.5.0
      
  - uses: rust/cargobump

  - runs: |
      cargo auditable build --release
      install -Dm755 target/release/starship "${{targets.destdir}}"/usr/bin/starship

• Explanation:
The cargo update -p idna --precise 0.5.0 command will explicitly pin the idna crate to version 0.5.0 before the cargobump step runs, resolving the version conflict.

• Additional Notes:

  • This is a common issue when upstream dependencies have breaking changes
  • The fix ensures compatibility while maintaining the required version constraints
  • Alternative approach would be to update url and its dependencies, but that could introduce more compatibility issues

• References:

@Dentrax Dentrax self-assigned this Jan 5, 2025
Copy link
Contributor Author

octo-sts bot commented Jan 5, 2025

Gen AI suggestions to solve the build error:

Based on the build log provided, I can analyze the failure:

• Detected Error: No explicit error message is shown in the log, but the output stops after installing dependencies, suggesting the build fails during the Rust compilation phase.

• Error Category: Build Configuration

• Failure Point: After dependency installation, likely during cargo auditable build --release

• Root Cause Analysis:
The issue appears to be a mismatch between the installed Rust version (1.83.0) and the potential minimum required Rust version for Starship 1.21.1.

• Suggested Fix:
Modify the Melange YAML to specify the correct Rust version by adding:

environment:
  contents:
    packages:
      - build-base
      - busybox
      - ca-certificates-bundle
      - cargo-auditable
      - cmake
      - openssf-compiler-options
      - rust-1.70
      - rust # Change to latest compatible version

• Explanation:
Starship may require a specific minimum Rust version for compilation. The current build is using Rust 1.83.0 which could be incompatible. Looking at Starship's release history and rust-version requirements, ensuring we use a compatible Rust version should resolve the build failure.

• Additional Notes:

  • Starship has specific Rust version requirements in its Cargo.toml
  • The build environment is properly set up with all required dependencies
  • Consider adding rust-src component if needed for full compilation
  • Adding verbose flags to cargo build could provide more detailed error information

• References:

  • Starship Repo: https://github.com/starship/starship
  • Starship's minimum supported Rust version (MSRV) requirements are typically documented in their Cargo.toml
  • Wolfi's Rust package documentation and version availability

Would you like me to suggest any additional debugging steps or provide more specific version requirements?

@Dentrax Dentrax force-pushed the cve-starship-fcef6f443148b461b264a975e7c5aa78 branch from dbb90ee to 3271463 Compare January 5, 2025 14:17
Signed-off-by: Dentrax <[email protected]>
@Dentrax Dentrax force-pushed the cve-starship-fcef6f443148b461b264a975e7c5aa78 branch from 3271463 to 2496876 Compare January 5, 2025 14:19
@octo-sts octo-sts bot added the bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. label Jan 5, 2025
@cpanato cpanato merged commit ec4b076 into main Jan 5, 2025
14 checks passed
@cpanato cpanato deleted the cve-starship-fcef6f443148b461b264a975e7c5aa78 branch January 5, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated pr bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. GHSA-h97m-ww89-6jmq request-cve-remediation rust/cargobump starship/1.21.1-r0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants