chore: convert to a Cargo workspace (fj, fj-client, fj-core) (FJ-5) #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/cargo-workspace-fj-5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
FJ-5: FJ-3 Phase 1 - convert to a Cargo workspace (fj, fj-client, fj-core)
Phase 1 of 5 of FJ-3. Stands up the workspace and relocates the existing crate. No command logic moves in this phase; behavior is identical.
What changed
Cargo.tomlis now a virtual workspace ([workspace],resolver = "2") withmembers = ["crates/fj", "crates/fj-client", "crates/fj-core"]and no[package].crates/fj/viagit mv(100% renames, history preserved):src/,build.rs,localization/, andCargo.toml. Package nameforgejo-cli,[[bin]] name = "fj", version0.5.0, and[package.metadata.binstall]are all preserved unchanged.crates/fj-clientandcrates/fj-coreare compiling placeholder library crates, wired as path deps now so later phases move only code, not manifests:fj->fj-coreandfj-client;fj-core->fj-client.build.rs+localization/live undercrates/fj/;build.rsreadslocalization/relative to its crate root, so the Fluent compile still runs at build time (verified).oci-build/DockerfileandDockerfile.windowscopy the rootCargo.toml/Cargo.lockplus everycrates/*/Cargo.toml, prime the dep cache with dummymain/libstubs, then copycrates/fj/build.rs,crates/fj/localization, and allcrates/*/srcfor the real build (build.rs/localizationdeferred to the final layer so a localization edit no longer busts the dependency cache)..dockerignorenote updated forcrates/**. Both build-binary workflow path filters now usecrates/**. Thejustfilecreate-releaserecipe reads/writes the version fromcrates/fj/Cargo.toml(the root manifest is now virtual). Binary output staystarget/release/fj.Verification
cargo build --lockedsucceeds at the workspace root.target/release/fj versionprintsfj v0.5.0.oci-build/Dockerfile) compiles all three crates and the exported binary printsfj v0.5.0.Heads-up: pre-existing clippy failure (NOT introduced by this PR)
cargo clippy --all-targets -- -D warnings(thecheck.ymlclippy step) fails on ~108 pre-existing lints (manual_repeat_n,needless_return,type_complexity,from_over_into,enum_variant_names, ...) in thecrates/fjsource. That source is byte-identical toorigin/main(every.rsfile is a 100% rename in this PR), so the lints predate this change. They are surfaced by a newer clippy build that landed under the mutableghcr.io/niceguyit/rust-builder-glibc:v1.0.0-rust1.94-trixietag (clippy build 2026-03-25), not by the workspace conversion. CI'scheck.ymlclippy step will therefore be red for any PR tomainuntil this is addressed. Recommend tracking the clippy/toolchain-drift cleanup as a separate issue rather than folding a ~108-site lint cleanup into this structural change. Left as-is here per FJ-5 scope ("No command logic moves in this phase").🤖 Generated with Claude Code