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

rustPlatform.fetchCargoVendor doesn't support v1 lockfile format #392872

Open
TomaSajt opened this issue Mar 24, 2025 · 0 comments
Open

rustPlatform.fetchCargoVendor doesn't support v1 lockfile format #392872

TomaSajt opened this issue Mar 24, 2025 · 0 comments
Labels
0.kind: bug Something is broken 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: rust

Comments

@TomaSajt
Copy link
Contributor

TomaSajt commented Mar 24, 2025

fetchCargoVendor doesn't support lockfile format v1 yet
Note: importCargoLock supports lockfile format v1

  • lockfile v1 doesn't have the checksums inside of the main package array.
  • but instead under the metadata."checksum {name} {version} ({source})"
  • packages that still have an old lockfile:
    • lipl
    • kubernix
    • system-syzygy

Here's how a v1 lockfile's metadata field looks like

[metadata]
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90"

Here are the logs if we try to use fetchCargoVendor on a v1 lockfile:

"""
Traceback (most recent call last):
  File "/nix/store/f2krmq3iv5nibcvn4rw7nrnrciqprdkh-python3-3.12.9/lib/python3.12/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/f2krmq3iv5nibcvn4rw7nrnrciqprdkh-python3-3.12.9/lib/python3.12/multiprocessing/pool.py", line 51, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/h536wymibaydldashx6s1ccpw9cbyb75-fetch-cargo-vendor-util/bin/fetch-cargo-vendor-util", line 80, in download_tarball
    expected_checksum = pkg["checksum"]
                        ~~~^^^^^^^^^^^^
KeyError: 'checksum'
"""
@FliegendeWurst FliegendeWurst added 0.kind: bug Something is broken 6.topic: rust 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) labels Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: rust
Projects
None yet
Development

No branches or pull requests

2 participants