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

Use Cargo 1.64 features for workspace metadata #500

Merged
merged 5 commits into from
Sep 23, 2022

Conversation

Malax
Copy link
Member

@Malax Malax commented Sep 23, 2022

Cargo 1.64 allows to specify some package metadata at workspace level (https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#cargo-improvements-workspace-inheritance-and-multi-target-builds). This is something we wanted for some time now, especially when #492 was implemented.

The new Cargo version also allows to specify dependencies at workspace level that packages can inherit. This is quite useful for repository-local dependencies that are now only specified once and not across all packages in the repository. This makes cutting a release even easier.

Downsides are that Rust 1.64 is a very new release at the time of writing and people using libcnb might need to bump their Rust version in both CI and locally to use it. However, it will only affect users that bump their libcnb version.

Closes GUS-W-11800636

Cargo.toml Show resolved Hide resolved
@Malax Malax force-pushed the malax/workspace-package-metadata-and-dependencies branch from e78acf3 to 8b53a91 Compare September 23, 2022 10:11
@Malax Malax merged commit 4e6f210 into main Sep 23, 2022
@Malax Malax deleted the malax/workspace-package-metadata-and-dependencies branch September 23, 2022 10:35
edmorley added a commit that referenced this pull request Oct 3, 2022
The check was added in #492 as part of the switch to always
releasing all libcnb-related crates with identical version numbers.

At that point, crate versioning was controlled by each crate's `Cargo.toml`,
so it would be easy to forget to update some of the crates for each release
(particularly given anyone familiar with the previous process would be
used to only updating the version of the single crate being released).

However as of #500, the new Cargo workspace shared metadata feature
is being used, such that the single version number in the repo root
`Cargo.toml` is now inherited by any crate using `version.workspace = true`.

This means there is no risk of crate versions getting out of sync,
unless we happen to add a new crate (infrequent occurrence),
don't base it on the template from an existing crate (unlikely, since
that's what we've done every time before), and then also miss the
difference during code review (unlikely, since comparing a new thing
to an existing thing is the first step I take when reviewing such changes,
and I'm sure others do too).

As such, this check is not adding enough value to be worth cluttering
up the CI results overview with yet another check.
edmorley added a commit that referenced this pull request Oct 3, 2022
The check was added in #492 as part of the switch to always
releasing all libcnb-related crates with identical version numbers.

At that point, crate versioning was controlled by each crate's `Cargo.toml`,
so it would be easy to forget to update some of the crates for each release
(particularly given anyone familiar with the previous process would be
used to only updating the version of the single crate being released).

However as of #500, the new Cargo workspace shared metadata feature
is being used, such that the single version number in the repo root
`Cargo.toml` is now inherited by any crate using `version.workspace = true`.

This means there is no risk of crate versions getting out of sync,
unless we happen to add a new crate (infrequent occurrence),
don't base it on the template from an existing crate (unlikely, since
that's what we've done every time before), and then also miss the
difference during code review (unlikely, since comparing a new thing
to an existing thing is the first step I take when reviewing such changes,
and I'm sure others do too).

As such, this check is not adding enough value to be worth cluttering
up the CI results overview with yet another check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Cargo workspace inheritance to reduce Cargo.toml duplication
2 participants