Skip to content

flatpak-cargo-generator doesn't support the new cargo lock format #99

@emmanueltouzery

Description

@emmanueltouzery

I tried to use the flatpak-cargo-generator script for a new rust project and realized it doesn't support the new rust 1.41 cargo.lock format:

https://blog.rust-lang.org/2020/01/30/Rust-1.41.0.html#whats-in-1.41.0-stable

a more git-friendly Cargo.lock

https://blog.rust-lang.org/2020/01/30/Rust-1.41.0.html#less-conflict-prone-cargolock-format

This new format will be used for all new lockfiles, while existing lockfiles will still rely on the previous format. You can learn about the choices leading to the new format in the PR adding it.

The error I got using the new script with a new Cargo.lock file was:

$ python3 flatpak-cargo-generator.py Cargo.lock -o cargo-sources.json                                                                                                   
Traceback (most recent call last):
  File "flatpak-cargo-generator.py", line 216, in <module>
    main()
  File "flatpak-cargo-generator.py", line 210, in main
    generated_sources = generate_sources(load_cargo_lock(args.cargo_lock))
  File "flatpak-cargo-generator.py", line 68, in generate_sources
    metadata = cargo_lock['metadata']
KeyError: 'metadata'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions