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 workspace.package inheritance for most package fields #804

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

kkysen
Copy link
Contributor

@kkysen kkysen commented Jan 30, 2023

This uses workspace.package inheritance for most package fields to standardize and sync fields.

Most packages repeat a lot of the package fields with minor variations, or omit them entirely (including ones like license that are mandatory for publishing). This uses cargo's workspace inheritance to set defaults in the workspace root's Cargo.toml, which are then either explicitly inherited in each Cargo.toml or overrided.

The defaults used here are:

version = "0.16.0"
authors = ["The C2Rust Project Developers <c2rust@immunant.com>"]
edition = "2021"
license = "BSD-3-Clause"
homepage = "https://c2rust.com/"
repository = "https://github.com/immunant/c2rust/"
readme = "README.md"
categories = ["development-tools", "development-tools::ffi", "command-line-utilities"]
keywords = ["transpiler", "migration", "translation", "c"]

which are taken mostly from c2rust/Cargo.toml. description (a required field for publishing) is omitted as that should be unique for each package.

The major benefit of this is that we standardize the fields and have a single source of truth, which is especially useful for something like version, which we want to update in sync.

The changes caused by this "standardization" are:

  • All versions are changed to 0.16.0, the current version.
  • The authors are standardized on ["The C2Rust Project Developers <c2rust@immunant.com>"]. Previously, they would sometimes include specific developers, but it was somewhat haphazard and not updated when new people worked on them. I think it's much simpler to standardize on this general author.
    • The exception is c2rust-ast-printer/Cargo.toml, which is forked from libsyntax and thus also credits "The Rust Project Developers".
  • homepage, repository, readme, categories, keywords are all set the same for each package, with the exception of readme, which is set to readme = "README.md" (the local one) if it exists.

Note that c2rust-macros and c2rust-refactor are not updated at all, as they are no longer part of the workspace.

This greatly simplifies things for the upcoming 0.17 release, as it

  • unifies versions for all packages intended to be published
  • sets the license and homepage/repository fields for all new packages, which are required to publish them (description is also needed, but I don't think that it good to inherit; we should fix that in a separate PR)

@kkysen kkysen force-pushed the kkysen/workspace-package-inheritance branch from 49894c9 to 1e07be8 Compare January 30, 2023 07:02
@kkysen kkysen force-pushed the kkysen/workspace-package-inheritance branch from 1e07be8 to 565d7b9 Compare January 30, 2023 08:14
Copy link
Contributor

@fw-immunant fw-immunant left a comment

Choose a reason for hiding this comment

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

Individual changes look OK; this should simplify future version bumps, which is good.

@fw-immunant fw-immunant merged commit 4bb830e into master Jan 30, 2023
@kkysen kkysen deleted the kkysen/workspace-package-inheritance branch January 30, 2023 21:54
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