Skip to content

Commit

Permalink
Simplify Cargo metadata for publish = false crates
Browse files Browse the repository at this point in the history
As of Cargo 1.75 the `version` property in `Cargo.toml` is now optional,
and if omitted is the same as having specified `version = "0.0.0"` and
`publish = false`:
https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-175-2023-12-28
https://doc.rust-lang.org/cargo/reference/manifest.html#the-version-field

Therefore for crates that we do not publish, we can now remove both
the `version` and `publish` properties, avoiding the need for the fake
`0.0.0` version that differs from the actual buildpack version in
`buildpack.toml`.

GUS-W-14821120.
  • Loading branch information
edmorley committed Jan 15, 2024
1 parent add3ee7 commit 9ef1a85
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["buildpacks/ruby", "commons"]

[workspace.package]
edition = "2021"
rust-version = "1.74"
rust-version = "1.75"

[workspace.lints.rust]
unreachable_pub = "warn"
Expand Down
3 changes: 0 additions & 3 deletions buildpacks/ruby/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[package]
name = "heroku-ruby-buildpack"
# This crate is not published, so the only version that is used is the one in buildpack.toml.
version = "0.0.0"
publish = false
edition.workspace = true
rust-version.workspace = true

Expand Down
2 changes: 0 additions & 2 deletions commons/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[package]
name = "commons"
version = "1.0.0"
publish = false
edition.workspace = true
rust-version.workspace = true

Expand Down

0 comments on commit 9ef1a85

Please sign in to comment.