Repository navigation
fix(ci): package moq-cli from the flake package named after its binary #4076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ set -euo pipefail | |
| # --bin overrides the binary/command name when it differs from the crate (e.g. | ||
| # the `moq-cli` crate ships its binary as `moq`); it defaults to the crate name. | ||
| # | ||
| # Builds via `nix build .#<crate>` against the flake-pinned toolchain unless | ||
| # Builds via `nix build .#<bin>` against the flake-pinned toolchain unless | ||
| # --binary supplies an existing build. Produces | ||
| # <output>/<crate>-v<version>-<target>.tar.gz, named after the release tag so | ||
| # a URL rewritten from one tag to the next still resolves; the layout matches | ||
|
|
@@ -97,12 +97,13 @@ if [[ -n "$BINARY" ]]; then | |
| BIN_FILE="$BINARY" | ||
| echo "Packaging prebuilt $CRATE binary for $TARGET..." | ||
| else | ||
| echo "Building $CRATE for $TARGET via nix (output: $CRATE)..." | ||
| # The flake names each package after its executable, so `moq-cli` builds as | ||
| # `.#moq`; `.#moq-cli` is a stub that refuses the old name. | ||
| echo "Building $CRATE for $TARGET via nix (output: $BIN)..." | ||
| RESULT_LINK="$BUILD_TMP/result" | ||
| nix build "$WORKSPACE_DIR#$CRATE" --out-link "$RESULT_LINK" | ||
| nix build "$WORKSPACE_DIR#$BIN" --out-link "$RESULT_LINK" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For a multi-binary package, Useful? React with 馃憤聽/ 馃憥.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not changing this. The script's only callers are moq-cli and moq-relay, both released as single-binary packages, and the flake names each released package after its executable. A multi-binary crate like moq-bench isn't packaged here. If one ever is, it fails loudly at (written by Claude Opus 5.5) |
||
|
|
||
| # Crane installs to result/bin/<binary>. The binary name is usually the | ||
| # crate name; the `moq-cli` crate ships as `moq`. | ||
| # Crane installs to result/bin/<binary>. | ||
| BIN_FILE="$RESULT_LINK/bin/$BIN" | ||
| fi | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing
.github/scripts/package-binary.test.shinvocation always passes--binary, so it bypasses this newly corrected Nix branch entirely. A fakenixonPATHcan assert that.#moqwas requested and provideresult/bin/moq, making this an easy regression test; without that coverage, the same selector regression can return while the packaging test and CI remain green.AGENTS.md reference: AGENTS.md:L18-L18
Useful? React with 馃憤聽/ 馃憥.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I added a fake
nixcase topackage-binary.test.shthat asserts--crate moq-cli --bin moqrequests.#moqand packages its output. It fails against main's script (unexpected: nix build ...#moq-cli) and passes with this fix.(written by Claude Opus 5.5)