From 70bf645ae30719808d99eb49389ae65318e16f3b Mon Sep 17 00:00:00 2001 From: Pierre Warnier Date: Tue, 15 Sep 2026 12:39:00 +0200 Subject: [PATCH] shadow-core: name the package uu_shadow_core, as crates.io knows it The library was published as uu_shadow_core (0.2.1) because shadow-core on crates.io belongs to an unrelated project, but the manifest still said shadow-core, so a publish from a checkout could not work and the crates.io copies fell three minor versions behind. The package is now uu_shadow_core; its Rust name stays shadow_core through [lib] name, and every dependant reaches it through the same `shadow-core` dependency key with `package = "uu_shadow_core"`, so no code changes. The fuzz workspace, the lockfile and the two `-p` invocations in ci.yml follow. CONTRIBUTING gains the publish order: the library, the tool crates, the five thin crates that wrap another tool's crate, then the multicall. `cargo publish --dry-run -p uu_shadow_core` packages 32 files; `make check` in the container is green. --- .github/workflows/ci.yml | 4 +- CHANGELOG.md | 8 ++++ CONTRIBUTING.md | 17 ++++++++ Cargo.lock | 80 +++++++++++++++++++------------------- Cargo.toml | 6 +-- fuzz/Cargo.toml | 2 +- src/shadow-core/Cargo.toml | 8 +++- 7 files changed, 77 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f54c516..9514f97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,12 +120,12 @@ jobs: # shadow-core's crypt(3) wrapper has musl-specific expectations (no # yescrypt, `rounds=` honoured). Run its unit tests against the static # musl libc, not only Alpine's dynamic one in the Docker matrix. - - run: cargo test --target x86_64-unknown-linux-musl -p shadow-core --features crypt + - run: cargo test --target x86_64-unknown-linux-musl -p uu_shadow_core --features crypt # `pam` must be refused on static musl, not silently produce a binary # whose authentication path can never work. - name: pam is rejected on static musl run: | - if cargo check --target x86_64-unknown-linux-musl -p shadow-core --features pam 2>check.log; then + if cargo check --target x86_64-unknown-linux-musl -p uu_shadow_core --features pam 2>check.log; then echo "::error::the pam feature built on static musl; the compile_error guard in shadow-core is gone" exit 1 fi diff --git a/CHANGELOG.md b/CHANGELOG.md index f34ade8..8af5a52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- The shared library crate is named `uu_shadow_core` in its manifest, which is + the name it was published under (0.2.1) and the only one it can be published + under: `shadow-core` on crates.io belongs to an unrelated project. Its Rust + name stays `shadow_core`, so no code changes; `cargo test -p` and the like + take the new package name + ## [0.5.1] - 2026-09-15 ### Fixed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2669745..cabe921 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -104,6 +104,23 @@ they all run as root. A green pipeline has shipped an archive that would not start and another whose setuid tools no user could run; this is what catches that. +### Publishing to crates.io + +The crates are owned by @sylvestre on crates.io; publishing needs an owner's +token. The library is published as `uu_shadow_core` (its Rust name stays +`shadow_core`; `shadow-core` on crates.io is somebody else's crate). Order +matters, since each crate's dependencies must already be on the registry at +the same version: + +1. `uu_shadow_core` +2. every `uu_` crate that depends only on it +3. `uu_vigr`, `uu_pwunconv`, `uu_grpconv`, `uu_grpunconv`, `uu_newgidmap`, + which each wrap another tool's crate +4. `uu_shadow`, the multicall binary, which depends on all of them + +`cargo publish --dry-run -p uu_shadow_core` works from a checkout; the others +can only be dry-run once their dependencies are published. + ### Linting ```shell diff --git a/Cargo.lock b/Cargo.lock index efd8bb9..9b9b78e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -532,22 +532,6 @@ dependencies = [ "syn 3.0.3", ] -[[package]] -name = "shadow-core" -version = "0.5.1" -dependencies = [ - "clap", - "landlock", - "libc", - "proptest", - "rustix", - "subtle", - "tempfile", - "thiserror", - "uucore", - "zeroize", -] - [[package]] name = "smallvec" version = "1.15.2" @@ -699,8 +683,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -710,8 +694,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -720,8 +704,8 @@ name = "uu_chgpasswd" version = "0.5.1" dependencies = [ "clap", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", "zeroize", ] @@ -732,8 +716,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", "zeroize", ] @@ -744,8 +728,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -755,8 +739,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -766,8 +750,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", "zeroize", ] @@ -778,8 +762,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -789,8 +773,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -800,8 +784,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -810,8 +794,8 @@ name = "uu_grpck" version = "0.5.1" dependencies = [ "clap", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -839,8 +823,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", "zeroize", ] @@ -860,7 +844,7 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", + "uu_shadow_core", "uucore", ] @@ -870,8 +854,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -880,8 +864,8 @@ name = "uu_newusers" version = "0.5.1" dependencies = [ "clap", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", "zeroize", ] @@ -892,8 +876,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -902,8 +886,8 @@ name = "uu_pwck" version = "0.5.1" dependencies = [ "clap", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -913,8 +897,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -932,7 +916,7 @@ name = "uu_sg" version = "0.5.1" dependencies = [ "clap", - "shadow-core", + "uu_shadow_core", "uucore", ] @@ -943,7 +927,6 @@ dependencies = [ "clap", "clap_complete", "rustix", - "shadow-core", "tempfile", "uu_chage", "uu_chfn", @@ -968,6 +951,7 @@ dependencies = [ "uu_pwconv", "uu_pwunconv", "uu_sg", + "uu_shadow_core", "uu_useradd", "uu_userdel", "uu_usermod", @@ -975,14 +959,30 @@ dependencies = [ "uu_vipw", ] +[[package]] +name = "uu_shadow_core" +version = "0.5.1" +dependencies = [ + "clap", + "landlock", + "libc", + "proptest", + "rustix", + "subtle", + "tempfile", + "thiserror", + "uucore", + "zeroize", +] + [[package]] name = "uu_useradd" version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -992,8 +992,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -1003,8 +1003,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] @@ -1023,8 +1023,8 @@ version = "0.5.1" dependencies = [ "clap", "rustix", - "shadow-core", "tempfile", + "uu_shadow_core", "uucore", ] diff --git a/Cargo.toml b/Cargo.toml index c457078..45c2d3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,7 +58,7 @@ categories = ["command-line-utilities"] [workspace.dependencies] # Internal crates -shadow-core = { path = "src/shadow-core", version = "0.5.1" } +shadow-core = { package = "uu_shadow_core", path = "src/shadow-core", version = "0.5.1" } # CLI clap = { version = "4", features = ["wrap_help"] } @@ -86,7 +86,7 @@ tempfile = "3" [dependencies] clap = { workspace = true } clap_complete = { workspace = true, optional = true } -shadow-core = { path = "src/shadow-core", version = "0.5.1" } +shadow-core = { package = "uu_shadow_core", path = "src/shadow-core", version = "0.5.1" } rustix = { workspace = true } # Tool crates (optional, enabled by features) @@ -178,7 +178,7 @@ userdel = { version = "0.5.1", package = "uu_userdel", path = "src/uu/userdel" } usermod = { version = "0.5.1", package = "uu_usermod", path = "src/uu/usermod" } pwck = { version = "0.5.1", package = "uu_pwck", path = "src/uu/pwck" } grpck = { version = "0.5.1", package = "uu_grpck", path = "src/uu/grpck" } -shadow-core = { path = "src/shadow-core", version = "0.5.1" } +shadow-core = { package = "uu_shadow_core", path = "src/shadow-core", version = "0.5.1" } rustix = { workspace = true } tempfile = { workspace = true } diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index da80641..5ddfb23 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -10,7 +10,7 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = "0.4" # The record parsers are no longer behind features; only linkage is. -shadow-core = { path = "../src/shadow-core" } +shadow-core = { package = "uu_shadow_core", path = "../src/shadow-core" } tempfile = "3" [workspace] diff --git a/src/shadow-core/Cargo.toml b/src/shadow-core/Cargo.toml index 0503ae1..a5a8876 100644 --- a/src/shadow-core/Cargo.toml +++ b/src/shadow-core/Cargo.toml @@ -1,5 +1,8 @@ [package] -name = "shadow-core" +# Published as uu_shadow_core: the name shadow-core on crates.io belongs to an +# unrelated project. The library keeps its Rust name, shadow_core, so nothing +# that uses it changes. +name = "uu_shadow_core" version.workspace = true edition.workspace = true license.workspace = true @@ -8,9 +11,10 @@ homepage.workspace = true keywords.workspace = true categories.workspace = true rust-version.workspace = true -description = "shadow-core ~ (shadow-rs) parsers, atomic file ops, locking, PAM" +description = "uutils shadow ~ shared library: record parsers, atomic file operations, locking, PAM" [lib] +name = "shadow_core" path = "src/lib.rs" [dependencies]