feat(prepare): accept comma-separated --target list (image-bake friendly)#925
Merged
Conversation
…dly)
`soldr prepare --target all` requires a workspace `Cargo.toml` with
`[workspace.metadata.soldr].targets` populated. Docker-image bake
steps don't have one mounted yet — the source volume is mounted at
`docker run` time, not at `docker build` time.
Extend `--target` to accept three shapes:
* `<triple>` — single triple (unchanged)
* `<a>,<b>,<c>` — explicit comma-separated list (NEW)
* `all` — workspace-metadata resolution (unchanged)
The new comma-separated form lets a Dockerfile bake the full cross-
toolchain into the image without inventing a placeholder Cargo.toml:
RUN soldr prepare --target \
x86_64-pc-windows-msvc,aarch64-apple-darwin,...
Parsing lives in `prepare_cmd::parse_target_arg` so it's unit-
testable; main.rs dispatches on the `ParsedTargetArg` enum. Whitespace
around comma-separated entries is trimmed, leading/trailing/
consecutive commas are silently dropped (copy-paste tolerance), and
an all-empty list errors instead of producing a zero-target run.
Six new unit tests cover the parser. No existing CLI surface
changes; the legacy single-triple and `all` shapes pass through
unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zackees
added a commit
that referenced
this pull request
Jun 22, 2026
The seed/Cargo.toml workaround existed only so `soldr prepare --target all` had a `[workspace.metadata.soldr].targets` table to read from at image-build time. Switching to the explicit comma-separated form (soldr PR #925) lets the bake step pass the 8 triples directly and removes the seed manifest entirely. Now requires a soldr release containing #925. Bump SOLDR_VERSION when that lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zackees
added a commit
that referenced
this pull request
Jun 22, 2026
Replace the `pipx install soldr==<ver>` step with a two-stage build:
Stage 1 — debian + rust 1.94.1 + git clone soldr at `SOLDR_GIT_REF`
(default main) + `cargo build --release`
Stage 2 — runtime image with the built binary copied in + the
existing soldr bootstrap / toolchain install / prepare
sequence
Avoids the PyPI release cadence — the example always builds against
latest main (which now includes #925's comma-separated --target
form). Override with `--build-arg SOLDR_GIT_REF=<sha|branch>` to
pin a specific revision.
Image grows by the rust-toolchain layer in stage 1 but stage 2
remains lean; the final image carries only the soldr binary.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
soldr prepare --target allrequires a workspaceCargo.tomlwith[workspace.metadata.soldr].targetspopulated. Docker-image bake steps don't have one mounted yet — the source volume is mounted atdocker runtime, not atdocker buildtime.Extend
--targetto accept three shapes:<triple>— single triple (unchanged)<a>,<b>,<c>— explicit comma-separated list (new)all— workspace-metadata resolution (unchanged)Why this matters
The new comma-separated form lets a Dockerfile bake the full cross-toolchain into the image without inventing a placeholder Cargo.toml:
RUN soldr prepare --target \ x86_64-pc-windows-msvc,aarch64-apple-darwin,x86_64-unknown-linux-musl,...That's exactly what the upcoming
examples/docker-cross-all/recipe (#924) needs — it has no source volume mounted at image bake time.Implementation
prepare_cmd::parse_target_argreturnsParsedTargetArg::AllorParsedTargetArg::Explicit(Vec<String>).main.rsdispatches on the enum:All→resolve_all_targets(),Explicit→ use as-is.Tests
Six new unit tests cover the parser. Existing CLI surface unchanged; the legacy single-triple and
allshapes pass through identical to before.Refs #914.
🤖 Generated with Claude Code