EmbarkStudios / EmbarkStudios/cargo-about

Deterministic output

Open
#202 3 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
782
Forks
46
Avg merge
1d 4h
Merged PRs (30d)
3

Description

**Is your feature request related to a problem? Please describe.**

We have been (successfully, tysm! ❤️) using cargo about to generate our [licenses.html](https://github.com/apollographql/router/blob/main/licenses.html) file for a while, and we love it so much we have had a CI step that ensures the licenses.html file is always up to date.

We currently do that by invoking `cargo about generate` in CI and [checking if there's a diff](https://github.com/apollographql/router/blob/a366da95211b0827e1352afa80f58055ae1684aa/xtask/src/commands/compliance.rs#L37).

CI sometimes turns red, and after a bit of investigation it seems like the licenses.html file generation isn't deterministic.

**Describe the solution you'd like**

Would you be open to receiving a PR that makes licenses.html file generation deterministic?

I haven't dug too much yet (I wanted to first make sure this would fit your goals, and you'd be open to receiving a PR first), but this may involve having a (possibly gated) "preserve-order" feature on `serde_json`, but it might be a bit more involved.

**Describe alternatives you've considered**

We haven't considered any alternatives yet, but we'd be happy to discuss this if there's an other way to make sure licenses are always in sync :)

Thanks a lot! :)

Contributor guide

Open the contributing guide

Research direction

Start with the cargo about generate command and the CI check in xtask/src/commands/compliance.rs, which compares the generated licenses.html file for changes. Trace the generation path to identify the source of unstable ordering and determine how to make repeated generation produce identical output. Done means the CI diff check remains clean across repeated runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.