Skip to content

Making deterministic .pc modules #455

@amyspark

Description

@amyspark

Hi,

Coming from https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/599#note_2838913 --

Currently, the .pc generation in cargo-c is as simple as capturing the linker line for a given crate, its Requires and Requires.private entries, and string interpolating the two together into the file. While this certainly works, it does not allow for reproducibility:

  • the order of libraries in the linker line is unpredictable (depends on the Cargo parallelization AFAIU)
  • the Libs and Cflags entries are never pruned for flags provided in Requires etc.
  • libraries provided by crates e.g. windows-targets (which does not install its .lib) or libsodium-sys (which does not provide a .pc file) break static usage of the .pc module

My proposal in https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2162 was to handle it on our end by manually parsing and deduplicating entries, however it was determined that it was best to handle this at the source.

@lu-zero could this be handled in cargo-c in a reasonable way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions