feat(coreutils-port): add module-vendor mode with manifest and drift CI#1593
Merged
feat(coreutils-port): add module-vendor mode with manifest and drift CI#1593
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 407ccf0 | Commit Preview URL Branch Preview URL |
May 07 2026, 10:40 PM |
Adds a `port-module` subcommand to `bashkit-coreutils-port` that vendors platform-clean uucore modules verbatim into `crates/bashkit/src/builtins/generated/<out>/`, gated by a `vendored.toml` manifest declaring per-import substitution policy. Args mode is unchanged (legacy positional CLI preserved). Tool capability only: the first consumer (uucore::format for the printf migration, #1534) lands separately. - main.rs splits into `args` / `module` / `manifest` modules; args logic relocates verbatim. - Module mode walks every top-level `use`, flattens nested groups, hard-errors on Fluent / `uucore::translate` / `uucore::i18n` imports, and requires every other uucore-internal path to match a manifest substitution. `error` action is fully implemented; `inline` / `replace_with` are accepted in the schema but error at runtime — they need the future `syn`-based import rewriter. - `vendored.toml` lives next to the tool (the tool owns it; the drift workflow only reads it). Initial manifest is empty. - `coreutils-args-drift.yml` extends to iterate the manifest and re-port every vendored module against uutils HEAD; args drift and module drift now land in a single auto-PR. - Spec updates: `specs/coreutils-args-port.md` gains a Module Mode section covering the substitution model, manifest schema, and drift integration. `specs/maintenance.md` broadens the drift review checklist. AGENTS.md spec table description updated. - 13 unit tests cover happy path, Fluent rejection, unresolved imports, error/inline/replace_with actions, directory walking, and use-tree group flattening. Closes #1533
`bashkit-coreutils-port` adds a `toml = "0.8"` dep to parse the vendored-module manifest. cargo-vet's supply-chain audit fails CI without exemptions for the transitive crates pulled in (toml, toml_edit, toml_datetime, toml_write, serde_spanned, winnow).
586dbe0 to
407ccf0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds module-vendor mode to
bashkit-coreutils-port— aport-modulesubcommand that vendors platform-clean uucore modules verbatim into
crates/bashkit/src/builtins/generated/<out>/, gated by avendored.tomlmanifest declaring per-import substitution policy.Args mode is unchanged. Closes #1533. The first consumer (uucore::format
for the printf migration) lands separately as #1534.
What
port-module <UUTILS_DIR> <MODULE> [<REV>]subcommand. Existingpositional CLI (args mode) is preserved unchanged.
main.rs(dispatcher) →args.rs,module.rs,manifest.rs. Args logic relocates verbatim.use, flattens nestedgroups. Hard errors on Fluent /
uucore::translate/uucore::i18n.Every other uucore-internal
usemust match a manifest substitution(unmatched aborts the port — silent emission of broken imports is
rejected).
erroris fully implemented;inline/replace_withare accepted in the schema but error at runtime — theyneed the future
syn-based import rewriter, which the first realconsumer (Vendor uucore::format and migrate printf.rs to use it #1534) will drive.
vendored.tomllives next to the tool (the tool owns the manifest;the drift workflow only reads it). Initial manifest is empty.
coreutils-args-drift.ymlextends to iterate the manifest andre-port every vendored module against uutils HEAD; args drift and
module drift now land in a single auto-PR.
specs/coreutils-args-port.mdgains a Module Modesection.
specs/maintenance.mdbroadens the drift checklist.AGENTS.mdspec-table description updated.Why
Verification on a probe branch ruled out depending on
uucoreatruntime: +98 s cold build, declared-but-unused 9 KB binary growth,
and a hard wasm32 break (
uucore → rustix → errno). Vendoringselected modules at port-time using the same machinery (and drift CI)
that args mode uses today gives reviewable, grep-able output and
predictable build times — at the cost of needing to re-run the recipe
on every uutils bump (the drift workflow handles that).
Tests
13 unit tests in
bashkit-coreutils-portcovering:uucore::translate/uucore::i18nhard errorserroraction policy rejectionreplace_with/inlinerewriter-not-implemented errorsuse uucore::{a, b})Test plan
cargo test -p bashkit-coreutils-port— 13/13 greencargo fmt --checkcleancargo clippy --all-targets -- -D warningsclean across workspaceport-moduleusage prints, missing module surfacesmanifest path
Closes #1533
Generated by Claude Code