Skip to content

Unify servo package naming#42916

Merged
jschwe merged 4 commits intoservo:mainfrom
jschwe:servo_packages
Mar 1, 2026
Merged

Unify servo package naming#42916
jschwe merged 4 commits intoservo:mainfrom
jschwe:servo_packages

Conversation

@jschwe
Copy link
Copy Markdown
Member

@jschwe jschwe commented Feb 27, 2026

This is a preparation for publishing to crates.io. Changes include:

  • Add servo- prefixes to avoid name collisions on crates.io
  • Use - instead of _ in package names.
  • Rename the crates to their original names in Cargo.toml,
    to keep the diff minimal
  • Rename media to servo-media-thread to avoid name collision with
    servo-media (originally from the media repository).

This is an outcome of the previous discussion at #general > Switch remaining git dependencies to crates.io

Testing: This should be mostly covered by our CI, but some amount of breakage is to be expected, since some package names could still be referenced from scripts which are not tested or run in CI. mach try run

This is a prepration for publishing to crates.io.
- Add `servo-` prefixes to avoid name collisions on crates.io
- Use `-` instead of `_` in package names.
- Rename the crates to their original names in Cargo.toml,
  to keep the diff minimal
- Rename `media` to `servo-media-thread` to avoid name collision with
  `servo-media` (originally from the media repository).

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
@jschwe jschwe marked this pull request as ready for review February 27, 2026 20:28
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Feb 27, 2026
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Copy link
Copy Markdown
Contributor

@nicoburns nicoburns left a comment

Choose a reason for hiding this comment

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

Changes look good.

I think it might also make sense to rename *-traits crates to *-api for consistency, as I believe *-traits and *-api crates serve fundamentally the same purpose, but we have to two different naming conventions for them.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Feb 27, 2026
@nicoburns
Copy link
Copy Markdown
Contributor

nicoburns commented Feb 27, 2026

We may also want to move all the repo-local (path) dependency specifications to being defined at the workspace level as that makes it much easier to update the version specifications for intra-repo dependency links (which are required for publishing to crates.io). Otherwise you have to dig through the Cargo.toml files for individual crates in the top each time you want to bump the repo's (servo crate and sub-crates') version.

(we have already applied this pattern to the stylo (https://github.com/servo/stylo/blob/main/Cargo.toml#L22) and html5ever (https://github.com/servo/html5ever/blob/main/Cargo.toml#L20) repos)

(this could be done in a follow-up)

@Loirooriol
Copy link
Copy Markdown
Contributor

Use - instead of _ in package names.

Note this is inconsistent with Stylo

@jschwe
Copy link
Copy Markdown
Member Author

jschwe commented Feb 28, 2026

Note this is inconsistent with Stylo

The stylo crates are already published though, right? Is this just a note, or a blocking concern that should be discussed first?
Personally I'd say it's slightly unfortunate but at least stylo is consistent in itself, and we are too here.

@mrobinson
Copy link
Copy Markdown
Member

Use - instead of _ in package names.

Note this is inconsistent with Stylo

Also note the discussion about the naming here: #general > Switch remaining git dependencies to crates.io

@jschwe
Copy link
Copy Markdown
Member Author

jschwe commented Feb 28, 2026

Also note the discussion about the naming here: #general > Switch remaining git dependencies to crates.io

Added the link to the PR description, since that was the basis of this PR - thanks for the reminder.

@Loirooriol
Copy link
Copy Markdown
Contributor

Not a blocking concern, it's just a bit unfortunate

@jschwe jschwe added this pull request to the merge queue Mar 1, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 1, 2026
Merged via the queue into servo:main with commit 37dfa42 Mar 1, 2026
32 checks passed
@jschwe jschwe deleted the servo_packages branch March 1, 2026 14:51
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 1, 2026
simonwuelker pushed a commit to simonwuelker/servo that referenced this pull request Mar 3, 2026
This is a preparation for publishing to crates.io. Changes include:
- Add `servo-` prefixes to avoid name collisions on crates.io
- Use `-` instead of `_` in package names.
- Rename the crates to their original names in Cargo.toml,
  to keep the diff minimal
- Rename `media` to `servo-media-thread` to avoid name collision with
  `servo-media` (originally from the media repository).

This is an outcome of the previous discussion at [#general > Switch
remaining git dependencies to
crates.io](https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Switch.20remaining.20git.20dependencies.20to.20crates.2Eio/with/576336288)

Testing: This should be mostly covered by our CI, but some amount of
breakage is to be expected, since some package names could still be
referenced from scripts which are not tested or run in CI. [mach try
run](https://github.com/jschwe/servo/actions/runs/22502945949)

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
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.

5 participants