fix(ci): copy all workspace member manifests in Docker builds #64

Merged
David merged 2 commits from fix/docker-workspace-member-manifests into main 2026-05-31 19:58:38 +02:00
Owner

Problem

The Linux (musl) and Windows binary build workflows for v0.4.0 failed at the dependency-prime layer:

error: failed to load manifest for workspace member `/build/crates/yt-cli`
referenced via `crates/*` by workspace at `/build/Cargo.toml`
Caused by: failed to read `/build/crates/youtrack-client/Cargo.toml`
Caused by: No such file or directory (os error 2)

Both oci-build/Dockerfile and oci-build/Dockerfile.windows predate the workspace split (YT-16/17/18). They copy only crates/yt-cli/Cargo.toml into the build context, but the workspace is members = ["crates/*"] and yt-cli path-depends on youtrack-client and youtrack-config. Cargo cannot load the workspace at all without every member manifest present, so the priming build fails before compiling anything.

Fix

In both Dockerfiles:

  • Copy every member manifest: yt-cli, youtrack-client, youtrack-config.
  • Create a stub source for each member before the priming build: main.rs + build.rs for the yt-cli bin, lib.rs for the two libs.
  • Copy all three real src/ trees for the actual build.
  • Extend the post-prime cleanup to drop the stub lib artifacts so they are rebuilt from real sources.

Verification

Built both locally with docker buildx --target export:

  • musl (oci-build/Dockerfile): 10 MB statically-linked ELF, runs (yt --version -> yt 0.4.0), ldd reports "statically linked".
  • Windows (oci-build/Dockerfile.windows): PE32+ x86-64 console .exe (14 MB).
## Problem The Linux (musl) and Windows binary build workflows for v0.4.0 failed at the dependency-prime layer: ``` error: failed to load manifest for workspace member `/build/crates/yt-cli` referenced via `crates/*` by workspace at `/build/Cargo.toml` Caused by: failed to read `/build/crates/youtrack-client/Cargo.toml` Caused by: No such file or directory (os error 2) ``` Both `oci-build/Dockerfile` and `oci-build/Dockerfile.windows` predate the workspace split (YT-16/17/18). They copy only `crates/yt-cli/Cargo.toml` into the build context, but the workspace is `members = ["crates/*"]` and `yt-cli` path-depends on `youtrack-client` and `youtrack-config`. Cargo cannot load the workspace at all without every member manifest present, so the priming build fails before compiling anything. ## Fix In both Dockerfiles: - Copy every member manifest: `yt-cli`, `youtrack-client`, `youtrack-config`. - Create a stub source for each member before the priming build: `main.rs` + `build.rs` for the `yt-cli` bin, `lib.rs` for the two libs. - Copy all three real `src/` trees for the actual build. - Extend the post-prime cleanup to drop the stub lib artifacts so they are rebuilt from real sources. ## Verification Built both locally with `docker buildx --target export`: - musl (`oci-build/Dockerfile`): 10 MB statically-linked ELF, runs (`yt --version` -> `yt 0.4.0`), `ldd` reports "statically linked". - Windows (`oci-build/Dockerfile.windows`): PE32+ x86-64 console .exe (14 MB).
fix(ci): copy all workspace member manifests in Docker builds
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 19s
2b04c24226
The Linux (musl) and Windows Docker builds failed at the dependency-prime layer with "failed to read crates/youtrack-client/Cargo.toml (No such file or directory)". Both Dockerfiles predate the workspace split (YT-16/17/18): they copied only crates/yt-cli/Cargo.toml, but the workspace is members = ["crates/*"] and yt-cli path-depends on youtrack-client and youtrack-config, so cargo cannot load the workspace without all three member manifests present.

Copy every member manifest (yt-cli, youtrack-client, youtrack-config) and create a stub source for each (main.rs + build.rs for the yt-cli bin, lib.rs for the two libs) before the priming build, then copy all three real src trees for the actual build. Extend the post-prime cleanup to drop the stub lib artifacts so they are recompiled from real sources.

Verified locally with docker buildx: the musl export stage produces a 10 MB statically-linked ELF that runs (`yt --version`), and the Windows export stage produces a PE32+ x86-64 .exe.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merge branch 'main' into fix/docker-workspace-member-manifests
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt + clippy + build + tests (pull_request) Successful in 22s
a0b9c3d2ba
David merged commit 233b7a0ff1 into main 2026-05-31 19:58:38 +02:00
David deleted branch fix/docker-workspace-member-manifests 2026-05-31 19:58:38 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/youtrack-cli!64
No description provided.