Skip to content

fix(rs): pass _select seeds to awk via ENVIRON for BSD awk - #4568

Merged
kixelated merged 1 commit into
mainfrom
fix/select-bsd-awk
Sep 30, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/select-bsd-awk

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

just rs _select passed the newline-separated seed list to awk with -v seeds=.... GNU awk accepts that, but BSD awk (macOS) rejects a newline in a -v value:

awk: newline in string moq-auth
moq-relay... at source line 1

So the macOS platform job failed on any PR touching two or more crates (e.g. #4527). The seeds now go through ENVIRON, which is POSIX and takes any value.

Reproduced on Linux with nixpkgs nawk (the one-true-awk macOS ships) as awk on PATH: the old recipe exits 2, the new one selects all crates, and just rs _select-test passes. _select-test also gains a two-crate case; it runs under GNU awk on Linux CI, so it guards the union behaviour rather than the BSD quirk.

Public API / wire impact: none (CI recipe only).

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

BSD awk (macOS) rejects a newline in a -v value, so the macOS platform
job failed on any PR touching two or more crates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@kixelated

Copy link
Copy Markdown
Collaborator Author

MERGE

Positive improvement: yes. just rs _select was embedding a newline-separated seed list in awk -v, which GNU awk accepts but BSD awk (macOS / one-true-awk) rejects. That broke the macOS platform job whenever a PR touched two or more crates. Routing seeds through ENVIRON["SEEDS"] is the right POSIX fix and keeps the same selection logic.

Worth the complexity: yes — tiny, localized justfile change with a clear comment. No public API or wire impact.

Different approach: none better. Alternatives like joining seeds on a delimiter other than newline, or shell-looping instead of awk, would either redo the same contract or add more surface area. The new two-crate _select-test case is a good guard for the union path (even though Linux CI still runs GNU awk).

Ship it.

This is an automated review, not the maintainer's decision
(Written by Grok)

@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b5e3ee5b-0141-4cb3-a3cc-8bbe9b3fcd2b

📥 Commits

Reviewing files that changed from the base of the PR and between 4885cbc and 6afea66.

📒 Files selected for processing (1)
  • rs/justfile

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.


Walkthrough

The _select command now passes its seed list to awk through the SEEDS environment variable. The _select-test check verifies that a diff containing two crate paths selects both crate names.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 6afea

The crate-selection change preserves both seeds in the inspected implementation, and the test checks that both crates are selected. No merge-blocking risk is evident; normal checks remain appropriate.

Architecture Summary

Architecture risk: 🔵 Low · up to 6afea

The change affects 1 system.

Changed systems: rs

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — rs (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in rs/justfile: _select now supplies seeds through the SEEDS environment variable and reads them from ENVIRON, replacing awk’s -v seeds argument.
  • observed — Modified behavior in rs/justfile: _select-test adds a regression check that a two-crate diff selects both moq-auth and moq-hls.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: passing _select seeds to awk through ENVIRON to support BSD awk.
Description check ✅ Passed The description directly explains the BSD awk failure, the ENVIRON fix, the added test coverage, and the lack of public API impact.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed head 6afea661334139a7771ec42552a6c13cde049b07.

No correctness findings in the reviewed diff. Direction: this is a focused, worthwhile fix. At rs/justfile:225-226, passing the quoted seed list through the command's environment preserves the newline-separated input without changing the dependency walk. POSIX specifies ENVIRON values as environment-variable strings. No new dependency or delimiter scheme is needed, and there is no public API or wire impact.

Nonblocking test suggestion (rs/justfile:413-416): run the multi-seed selector test with BSD/one-true-awk in CI, for example in the macOS job. The new case guards the union behavior on Linux, but this recipe-only PR makes _select return ALL at line 176 before reaching awk in the platform job, and _platform does not run _select-test. The specific portability regression therefore is not exercised there.

Validation: bash -n passed for both extracted recipe bodies. Ten fixture-backed checks of the exact _select body passed with Bash, jq, and mawk 1.3.4, covering multi-seed selection, transitive dependents, duplicate seeds, dependency-free crates, cycles, and empty/non-crate inputs. Cargo metadata was stubbed. BSD awk, Cargo, Nix, and just were unavailable here, so I did not independently reproduce the BSD failure or run the repository test suite.

(Written by review (OpenAI))

@kixelated
kixelated merged commit 6cbfddd into main Sep 30, 2026
6 checks passed
@kixelated
kixelated deleted the fix/select-bsd-awk branch September 30, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant