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

Remove version and publish from cargo metadata #5660

Merged
merged 3 commits into from
Jan 9, 2024

Conversation

faern
Copy link
Member

@faern faern commented Jan 5, 2024

Since Rust 1.75.0 the version field is optional. The version defaults to "0.0.0" if it's not specified, and publish defaults to false if no version has been given. So by not specifying a version we get both version = "0.0.0" and publish = false "for free". This means we can get away with a bit less metadata boilerplate ✨


This change is Reviewable

@faern faern requested a review from Serock3 January 5, 2024 15:19
Copy link
Member Author

@faern faern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 35 files reviewed, 1 unresolved discussion


.github/workflows/rust-supply-chain.yml line 23 at r1 (raw file):

        with:
          log-level: warn
          rust-version: stable

This was needed since it by default used some older version of Rust/cargo. Luckily it accepted "stable" and did not need a specific version.

@faern faern force-pushed the remove-cargo-version-field branch from 1682ed2 to 7d10a53 Compare January 8, 2024 10:51
@faern faern changed the title Remove version and publish cargo metadata Remove version and publish from cargo metadata Jan 8, 2024
Copy link
Member Author

@faern faern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 36 files reviewed, 1 unresolved discussion


.github/workflows/rust-unused-dependencies.yml line 13 at r2 (raw file):

env:
  # Pinning nightly just to avoid random breakage. It's fine to bump this at any time
  RUST_NIGHTLY_TOOLCHAIN: nightly-2024-01-07

Another place that needed bumping to a version of cargo that was fine with no version field.

@faern faern force-pushed the remove-cargo-version-field branch from 7d10a53 to 9f5f344 Compare January 9, 2024 08:19
Copy link
Contributor

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!:lgtm:

Reviewable status: 0 of 36 files reviewed, 1 unresolved discussion

Copy link
Contributor

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 36 files reviewed, all discussions resolved


.github/workflows/rust-supply-chain.yml line 23 at r1 (raw file):

Previously, faern (Linus Färnstrand) wrote…

This was needed since it by default used some older version of Rust/cargo. Luckily it accepted "stable" and did not need a specific version.

:lgtm:

Copy link
Contributor

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 35 of 35 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

faern added 3 commits January 9, 2024 13:01
Since Rust 1.75.0 the `version` field is optional. The version
defaults to "0.0.0" if it's not specified, and `publish` defaults
to false if no version has been given. So by not specifying
a version we get both `version = "0.0.0" and `publish = false`
"for free"
@faern faern force-pushed the remove-cargo-version-field branch from 9f5f344 to d884332 Compare January 9, 2024 12:01
@faern faern merged commit 5d0bcc2 into main Jan 9, 2024
29 checks passed
@faern faern deleted the remove-cargo-version-field branch January 9, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants