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

Cargo.lock parsing fails for cargo <1.83 #173

Open
eureka-cpu opened this issue Dec 20, 2024 · 2 comments
Open

Cargo.lock parsing fails for cargo <1.83 #173

eureka-cpu opened this issue Dec 20, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@eureka-cpu
Copy link
Member

Describe the bug

Ref #172
Using nixpkgs where cargo is <1.83 causes Cargo.lock parsing to fail.

@eureka-cpu eureka-cpu added the bug Something isn't working label Dec 20, 2024
@eureka-cpu eureka-cpu self-assigned this Dec 20, 2024
@eureka-cpu
Copy link
Member Author

Here's the error output btw:

$ nix build --override-input nixpkgs https://github.com/NixOS/nixpkgs/archive/nixos-24.05.tar.gz
warning: Git tree '/home/eureka/Code/numtide/system-manager' is dirty
warning: not writing modified lock file of flake 'git+file:///home/eureka/Code/numtide/system-manager':
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/3566ab7246670a43abd2ffa913cc62dad9cdf7d5?narHash=sha256-AKU6qqskl0yf2%2BJdRdD0cfxX4b9x3KKV5RqA6wijmPM%3D' (2024-12-13)
  → 'https://github.com/NixOS/nixpkgs/archive/nixos-24.05.tar.gz?narHash=sha256-ze3IJksru9dN0keqUxY0WNf8xrwfs8Ty/z9v/keyBbg%3D' (2024-12-18)
error: builder for '/nix/store/6jzi9ha0l7rq0b514cca2qsg16lbfs7d-system-manager-0.1.0.drv' failed with exit code 101;
       last 18 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/ykp7akkrv4x7yx25kpns612wh0drscng-source
       > source root is source
       > Executing cargoSetupPostUnpackHook
       > Finished cargoSetupPostUnpackHook
       > Running phase: patchPhase
       > Executing cargoSetupPostPatchHook
       > Validating consistency between /build/source/Cargo.lock and /build/cargo-vendor-dir/Cargo.lock
       > Finished cargoSetupPostPatchHook
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Running phase: buildPhase
       > Executing cargoBuildHook
       > ++ env CC_X86_64_UNKNOWN_LINUX_GNU=/nix/store/i53w7x986ifmgzvb8da6zkfms4xzmdrk-gcc-wrapper-13.2.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/i53w7x986ifmgzvb8da6zkfms4xzmdrk-gcc-wrapper-13.2.0/bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/i53w7x986ifmgzvb8da6zkfms4xzmdrk-gcc-wrapper-13.2.0/bin/cc CC_X86_64_UNKNOWN_LINUX_GNU=/nix/store/i53w7x986ifmgzvb8da6zkfms4xzmdrk-gcc-wrapper-13.2.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/i53w7x986ifmgzvb8da6zkfms4xzmdrk-gcc-wrapper-13.2.0/bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/i53w7x986ifmgzvb8da6zkfms4xzmdrk-gcc-wrapper-13.2.0/bin/cc CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu HOST_CC=/nix/store/i53w7x986ifmgzvb8da6zkfms4xzmdrk-gcc-wrapper-13.2.0/bin/cc HOST_CXX=/nix/store/i53w7x986ifmgzvb8da6zkfms4xzmdrk-gcc-wrapper-13.2.0/bin/c++ cargo build -j 20 --target x86_64-unknown-linux-gnu --frozen --profile release
       > error: failed to parse lock file at: /build/source/Cargo.lock
       >
       > Caused by:
       >   lock file version 4 requires `-Znext-lockfile-bump`

@eureka-cpu
Copy link
Member Author

eureka-cpu commented Dec 20, 2024

Agh.. -Znext-lockfile-bump requires the nightly rust toolchain otherwise maybe this would have worked:

# Cargo.lock parsing standard was updated from 3 to 4 in version 1.83: https://github.com/rust-lang/cargo/blob/652623b779c88fe44afede28bf7f1c9c07812511/CHANGELOG.md#changed-2
cargoBuildFlags = if (builtins.compareVersions rustPlatform.rust.cargo.version "1.83") == -1 then ["-Znext-lockfile-bump"] else [];

Maybe it would be better to just cut releases and make the requirements more clear as to what version of cargo/nixpkgs is required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant