Skip to content

Commit

Permalink
Simplify Cargo.toml for crates that are not published (#759)
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

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 authored Jan 15, 2024
1 parent a7a048f commit 2209e8f
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 29 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ members = [

[workspace.package]
version = "0.17.0"
rust-version = "1.74"
rust-version = "1.75"
edition = "2021"
license = "BSD-3-Clause"

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

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

[lints]
workspace = true
Expand Down
3 changes: 0 additions & 3 deletions libcnb-cargo/tests/fixtures/multiple_buildpacks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ members = [
"buildpacks/one",
"buildpacks/two"
]

[workspace.package]
version = "0.0.0"
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[package]
name = "one"
version = "0.0.0"
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[package]
name = "two"
version = "0.0.0"
3 changes: 0 additions & 3 deletions libcnb-cargo/tests/fixtures/no_buildpacks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
members = [
"not_a_buildpack"
]

[workspace.package]
version = "0.0.0"
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[package]
name = "not_a_buildpack"
version = "0.0.0"
1 change: 0 additions & 1 deletion libcnb-cargo/tests/fixtures/single_buildpack/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[package]
name = "single_buildpack"
version = "0.0.0"

[workspace]
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[package]
name = "compile-error"
version = "0.0.0"
publish = false

[workspace]
2 changes: 0 additions & 2 deletions libcnb-test/tests/fixtures/buildpacks/component-a/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[package]
name = "component-a"
version = "0.0.0"
publish = false

[workspace]
2 changes: 0 additions & 2 deletions libcnb-test/tests/fixtures/buildpacks/component-b/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[package]
name = "component-b"
version = "0.0.0"
publish = false

[workspace]
2 changes: 0 additions & 2 deletions test-buildpacks/readonly-layer-files/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
[package]
name = "readonly-layer-files"
version = "0.0.0"
edition.workspace = true
rust-version.workspace = true
publish = false

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

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

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

[lints]
workspace = true
Expand Down

0 comments on commit 2209e8f

Please sign in to comment.