Conversation
Reviewer's GuideThis PR refactors the OpenBSD setup in the GitHub Action by pinning and exporting a nightly toolchain, computing its sysroot dynamically, updating caching and installation steps to use this sysroot, and hardening the stdlib copy with an existence check, while also cleaning up documentation and the changelog. Sequence diagram for OpenBSD stdlib build and installation in setup-rust actionsequenceDiagram
participant Runner as GitHub Runner (Linux)
participant Rustup
participant RustSource as Rust Source
participant Cache
participant Env as GitHub Env
Runner->>Env: Set OPENBSD_NIGHTLY=nightly-2025-07-20
Runner->>Rustup: rustup toolchain install "$OPENBSD_NIGHTLY"
Runner->>Env: Set NIGHTLY_SYSROOT from rustc +$OPENBSD_NIGHTLY --print sysroot
Runner->>Cache: Restore cache at $NIGHTLY_SYSROOT/lib/rustlib/x86_64-unknown-openbsd
alt Cache miss
Runner->>RustSource: Clone Rust repo
Runner->>RustSource: Build OpenBSD stdlib
RustSource->>Runner: Build artifacts at ARTIFACT_DIR
Runner->>Runner: Check if ARTIFACT_DIR exists
alt ARTIFACT_DIR exists
Runner->>Runner: mkdir -p $NIGHTLY_SYSROOT/lib/rustlib/x86_64-unknown-openbsd
Runner->>Runner: Copy artifacts to sysroot
else ARTIFACT_DIR missing
Runner->>Runner: Exit with error
end
end
Runner->>Rustup: rustup target add x86_64-unknown-openbsd --toolchain $OPENBSD_NIGHTLY
Class diagram for environment and caching variables in setup-rust actionclassDiagram
class Env {
+OPENBSD_NIGHTLY: string
+NIGHTLY_SYSROOT: string
}
class Cache {
+path: string
+key: string
}
Env <|-- Cache : uses
Env : +exported to GITHUB_ENV
Cache : +uses $NIGHTLY_SYSROOT for path
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary by CodeRabbit
WalkthroughReorder changelog entries in the setup-rust action to correct their chronological sequence. Update the README to clarify that a pinned nightly Rust toolchain is used for OpenBSD, and remove the Changes
Sequence Diagram(s)sequenceDiagram
participant Workflow
participant SetupRustAction
participant Rustup
participant ShellScript
Workflow->>SetupRustAction: Start action
SetupRustAction->>Rustup: Install pinned nightly toolchain (nightly-2025-07-20)
SetupRustAction->>Rustup: Add OpenBSD target using pinned nightly
SetupRustAction->>ShellScript: Build OpenBSD stdlib from source
ShellScript->>ShellScript: Check for build artifact directory
alt Directory exists
ShellScript->>Rustup: Copy build artifacts to dynamic sysroot path
else Directory missing
ShellScript->>Workflow: Print error and exit
end
SetupRustAction->>Workflow: Export environment variables for toolchain and sysroot
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Hey @leynos - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Add tests to cover the new error handling for missing OpenBSD build artifacts. (link)
General comments:
- Hardcoding the OPENBSD_NIGHTLY date in action.yml will force manual updates whenever that nightly changes—consider exposing it as an input or deriving it automatically to reduce maintenance.
- The CHANGELOG entries are out of order (v1.0.8 appears before v1.0.6) which can confuse readers—please reorder them chronologically.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Hardcoding the OPENBSD_NIGHTLY date in action.yml will force manual updates whenever that nightly changes—consider exposing it as an input or deriving it automatically to reduce maintenance.
- The CHANGELOG entries are out of order (v1.0.8 appears before v1.0.6) which can confuse readers—please reorder them chronologically.
## Individual Comments
### Comment 1
<location> `.github/actions/setup-rust/action.yml:109` </location>
<code_context>
- cp -r build/$HOST_TRIPLE/stage1/lib/rustlib/x86_64-unknown-openbsd/* \
- ~/.rustup/toolchains/nightly/lib/rustlib/x86_64-unknown-openbsd/
+ ARTIFACT_DIR="build/$HOST_TRIPLE/stage1/lib/rustlib/x86_64-unknown-openbsd"
+ if [ ! -d "$ARTIFACT_DIR" ]; then
+ echo "Error: Build artifacts not found at $ARTIFACT_DIR"
+ exit 1
</code_context>
<issue_to_address>
Add tests to cover the new error handling for missing OpenBSD build artifacts.
The new check for the existence of $ARTIFACT_DIR and the error message/exit is a change in behaviour. You must add tests to ensure this error path is exercised and behaves as expected.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
.github/actions/setup-rust/CHANGELOG.md(1 hunks).github/actions/setup-rust/README.md(1 hunks).github/actions/setup-rust/action.yml(3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
.github/actions/*/README.md
📄 CodeRabbit Inference Engine (AGENTS.md)
.github/actions/*/README.md: Each action must have aREADME.mdcontaining a one-liner summary, table of inputs, table of outputs, usage example withuses: ./.github/actions/<name>@<major>, and a release history link to CHANGELOG.
Add aDEPRECATED:banner to README and repository description when deprecating an action.
Files:
.github/actions/setup-rust/README.md
.github/actions/*/CHANGELOG.md
📄 CodeRabbit Inference Engine (AGENTS.md)
Each action must have a
CHANGELOG.mdthat follows SemVer-based changelog for that action only.
Files:
.github/actions/setup-rust/CHANGELOG.md
.github/actions/*/action.yml
📄 CodeRabbit Inference Engine (AGENTS.md)
.github/actions/*/action.yml: Each action must have anaction.ymlfile containing every input and output, with required ones clearly marked.
Composite actions referencing sibling scripts must use${{ github.action_path }}for portability.
Files:
.github/actions/setup-rust/action.yml
🪛 LanguageTool
.github/actions/setup-rust/README.md
[typographical] ~58-~58: The word ‘When’ starts a question. Add a question mark (“?”) at the end of the sentence.
Context: ...arget is readily available on later runs. ```yaml # Bring in MSYS2 plus th...
(WRB_QUESTION_MARK)
.github/actions/setup-rust/CHANGELOG.md
[typographical] ~4-~4: To join two clauses or introduce examples, consider using an em dash.
Context: # Changelog ## v1.0.8 - 2025-07-24 - Build OpenBSD standard lib...
(DASH_RULE)
[typographical] ~8-~8: To join two clauses or introduce examples, consider using an em dash.
Context: ...e updated library/std path. ## v1.0.7 - 2025-07-24 - Quote boolean defaults in ...
(DASH_RULE)
[typographical] ~12-~12: To join two clauses or introduce examples, consider using an em dash.
Context: ...ml` to avoid type mismatches. ## v1.0.6 - 2025-07-24 - Cache OpenBSD standard lib...
(DASH_RULE)
[typographical] ~19-~19: To join two clauses or introduce examples, consider using an em dash.
Context: ...x README example indentation. ## v1.0.5 - 2025-07-24 - Install macOS cross build ...
(DASH_RULE)
[typographical] ~30-~30: To join two clauses or introduce examples, consider using an em dash.
Context: ...ninput (defaultv0.0.10`). ## v1.0.4 - 2025-06-21 - Optionally install SQLite ...
(DASH_RULE)
🔇 Additional comments (1)
.github/actions/setup-rust/action.yml (1)
99-101: Guard cache path against undefinedNIGHTLY_SYSROOT
path: ${{ env.NIGHTLY_SYSROOT }}/lib/...relies onNIGHTLY_SYSROOTbeing exported in an earlier step. If the nightly installation fails, cache resolution expands to/lib/..., polluting the workspace. Addif: env.NIGHTLY_SYSROOT != ''or exit early when the install step fails.
| ARTIFACT_DIR="build/$HOST_TRIPLE/stage1/lib/rustlib/x86_64-unknown-openbsd" | ||
| if [ ! -d "$ARTIFACT_DIR" ]; then | ||
| echo "Error: Build artifacts not found at $ARTIFACT_DIR" | ||
| exit 1 | ||
| fi | ||
| mkdir -p "$NIGHTLY_SYSROOT/lib/rustlib/x86_64-unknown-openbsd" | ||
| cp -r "$ARTIFACT_DIR"/* "$NIGHTLY_SYSROOT/lib/rustlib/x86_64-unknown-openbsd/" | ||
| - name: Add OpenBSD target |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Copy artefacts atomically to avoid half-written stdlib
Copying with cp -r risks leaving a partial tree if the job is cancelled. Use rsync -a --delete into a temporary directory and move it into place, or copy into ${NIGHTLY_SYSROOT}/lib/rustlib/x86_64-unknown-openbsd.new and mv it afterwards to ensure consumers only ever see a complete stdlib.
🤖 Prompt for AI Agents
In .github/actions/setup-rust/action.yml around lines 108 to 115, the current
use of 'cp -r' to copy build artifacts can result in partial copies if
interrupted. To fix this, copy the artifacts into a temporary directory such as
'${NIGHTLY_SYSROOT}/lib/rustlib/x86_64-unknown-openbsd.new' using 'rsync -a
--delete' for atomicity, then move the temporary directory to replace the
original directory with 'mv' to ensure consumers only see a complete stdlib.
| ## v1.0.5 - 2025-07-24 | ||
|
|
||
| - Install macOS cross build toolchain via `with-darwin`. | ||
| - Build OpenBSD standard library and add target via `with-openbsd`. | ||
|
|
||
| ## v1.0.4 - 2025-06-21 | ||
|
|
||
| - Optionally install SQLite development libraries on Windows via MSYS2 using the | ||
| `install-sqlite-deps` input. | ||
|
|
||
| ## v1.0.5 – 2025-07-22 | ||
|
|
||
| - Integrate `sccache` on non-release runs to speed up compilation. |
There was a problem hiding this comment.
Remove duplicate version heading to preserve SemVer chronology
Two distinct entries use the tag v1.0.5 (lines 19 and 24). This breaks SemVer, confuses consumers and tooling, and renders the release history ambiguous.
Apply a unique version (e.g. rename the 2025-07-22 section to v1.0.4 and bump later entries) or merge the bullet points under a single correct heading.
-## v1.0.5 – 2025-07-22
+## v1.0.4 – 2025-07-22📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## v1.0.5 - 2025-07-24 | |
| - Install macOS cross build toolchain via `with-darwin`. | |
| - Build OpenBSD standard library and add target via `with-openbsd`. | |
| ## v1.0.4 - 2025-06-21 | |
| - Optionally install SQLite development libraries on Windows via MSYS2 using the | |
| `install-sqlite-deps` input. | |
| ## v1.0.5 – 2025-07-22 | |
| - Integrate `sccache` on non-release runs to speed up compilation. | |
| ## v1.0.5 - 2025-07-24 | |
| - Install macOS cross build toolchain via `with-darwin`. | |
| - Build OpenBSD standard library and add target via `with-openbsd`. | |
| ## v1.0.4 – 2025-07-22 | |
| - Integrate `sccache` on non-release runs to speed up compilation. |
🧰 Tools
🪛 LanguageTool
[typographical] ~19-~19: To join two clauses or introduce examples, consider using an em dash.
Context: ...x README example indentation. ## v1.0.5 - 2025-07-24 - Install macOS cross build ...
(DASH_RULE)
🤖 Prompt for AI Agents
In .github/actions/setup-rust/CHANGELOG.md around lines 19 to 26, there are two
entries with the same version tag v1.0.5, which breaks SemVer and causes
confusion. To fix this, rename the earlier entry dated 2025-07-22 to v1.0.4 and
adjust subsequent version numbers accordingly, or merge the bullet points under
a single v1.0.5 heading to maintain unique and chronological version tags.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (1)
.github/actions/setup-rust/CHANGELOG.md (1)
20-25: Fix the duplicate version tags.Two entries still use the same version tag
v1.0.5(lines 20 and 25) with different dates. This breaks semantic versioning and creates ambiguity in the release history.Apply this diff to resolve the duplication:
-## v1.0.5 – 2025-07-22 +## v1.0.4 – 2025-07-22Then update the existing v1.0.4 entry at line 31 to v1.0.3 and adjust subsequent versions accordingly.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (6)
.github/actions/setup-rust/CHANGELOG.md(1 hunks).github/actions/setup-rust/README.md(2 hunks).github/actions/setup-rust/action.yml(4 hunks).github/actions/setup-rust/scripts/copy_openbsd_stdlib.py(1 hunks).github/actions/setup-rust/tests/conftest.py(1 hunks).github/actions/setup-rust/tests/test_copy_stdlib.py(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
.github/actions/setup-rust/tests/conftest.py (1)
shellstub.py (1)
StubManager(39-153)
🪛 LanguageTool
.github/actions/setup-rust/CHANGELOG.md
[typographical] ~4-~4: To join two clauses or introduce examples, consider using an em dash.
Context: # Changelog ## v1.0.8 - 2025-07-24 - Build OpenBSD standard lib...
(DASH_RULE)
[typographical] ~9-~9: To join two clauses or introduce examples, consider using an em dash.
Context: ...the pinned nightly toolchain. ## v1.0.7 - 2025-07-24 - Quote boolean defaults in ...
(DASH_RULE)
[typographical] ~13-~13: To join two clauses or introduce examples, consider using an em dash.
Context: ...ml` to avoid type mismatches. ## v1.0.6 - 2025-07-24 - Cache OpenBSD standard lib...
(DASH_RULE)
[typographical] ~20-~20: To join two clauses or introduce examples, consider using an em dash.
Context: ...x README example indentation. ## v1.0.5 - 2025-07-24 - Install macOS cross build ...
(DASH_RULE)
[typographical] ~31-~31: To join two clauses or introduce examples, consider using an em dash.
Context: ...ninput (defaultv0.0.10`). ## v1.0.4 - 2025-06-21 - Optionally install SQLite ...
(DASH_RULE)
🪛 Ruff (0.12.2)
.github/actions/setup-rust/tests/conftest.py
25-25: Missing return type annotation for public function shell_stubs
(ANN201)
.github/actions/setup-rust/scripts/copy_openbsd_stdlib.py
11-11: Move standard library import pathlib.Path into a type-checking block
Move into type-checking block
(TC003)
.github/actions/setup-rust/tests/test_copy_stdlib.py
9-9: Missing docstring in public function
(D103)
11-11: subprocess call: check for execution of untrusted input
(S603)
14-14: Missing docstring in public function
(D103)
29-29: Missing docstring in public function
(D103)
🔇 Additional comments (12)
.github/actions/setup-rust/README.md (2)
18-18: Documentation accurately reflects the new input parameter.The addition of the
openbsd-nightlyinput parameter with its default value properly documents the pinned nightly toolchain approach for OpenBSD builds.
56-58: Clear explanation of the OpenBSD nightly toolchain usage.The updated description properly explains how the action uses the configurable nightly toolchain version for OpenBSD standard library builds, improving clarity over the previous generic description.
.github/actions/setup-rust/tests/conftest.py (1)
12-17: Root finding logic is robust and well-implemented.The function correctly traverses the directory hierarchy looking for standard project markers (
pyproject.tomlor.git) and provides clear error handling when no root is found..github/actions/setup-rust/tests/test_copy_stdlib.py (3)
9-11: Test helper function works correctly for script execution.The function properly uses
uv run --scriptto execute the copy script in isolation with captured output.
14-26: Comprehensive test of successful copying behaviour.The test creates a realistic directory structure, executes the script, and verifies both successful execution and correct file placement in the expected sysroot location.
29-37: Proper error handling test for missing artifacts.The test correctly verifies that the script exits with error code 1 and provides an appropriate error message when the source directory doesn't exist.
.github/actions/setup-rust/scripts/copy_openbsd_stdlib.py (3)
1-6: Proper script setup with clear dependencies.The uv script metadata correctly specifies Python 3.12+ requirement and the typer dependency needed for the CLI interface.
18-23: Robust error handling for missing source directory.The function properly validates the artifact directory exists before proceeding and provides clear error messaging when it doesn't.
25-35: Correct implementation of recursive copying logic.The script properly creates the target directory structure and handles both files and directories with appropriate shutil functions. The
dirs_exist_ok=Trueparameter correctly allows merging of existing directories..github/actions/setup-rust/action.yml (3)
32-35: Expose nightly version as configurable input – good upgradeInput
openbsd-nightlyremoves the hard-coded date and lets callers override the default.
Documentation update already landed, so no further action needed.
103-103: Cache path now parameterised – looks correctThe cache key tracks the resolved sysroot, matching the earlier env export. No issues spotted.
117-117: Target addition wired to pinned toolchain – OK
rustup target add … --toolchain ${{ env.OPENBSD_NIGHTLY }}correctly uses the earlier export.
No further changes required.
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (1)
.github/actions/setup-rust/tests/test_copy_stdlib.py (1)
9-11: Add docstring to the helper function.The
run_scriptfunction lacks documentation. Add a docstring to explain its purpose and parameters.def run_script(script: Path, *args: str) -> subprocess.CompletedProcess[str]: + """Execute a script using uv run and return the completed process.""" cmd = ["uv", "run", "--script", str(script), *args]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
.github/actions/setup-rust/CHANGELOG.md(1 hunks).github/actions/setup-rust/scripts/copy_openbsd_stdlib.py(1 hunks).github/actions/setup-rust/tests/test_copy_stdlib.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
.github/actions/*/CHANGELOG.md
📄 CodeRabbit Inference Engine (AGENTS.md)
Each action must have a
CHANGELOG.mdthat follows SemVer-based changelog for that action only.
Files:
.github/actions/setup-rust/CHANGELOG.md
.github/actions/*/tests/**
📄 CodeRabbit Inference Engine (AGENTS.md)
.github/actions/*/tests/**: Tests for each action must be present in atests/directory within the action's directory.
Contract tests must validate that declared inputs and outputs round-trip correctly.
Files:
.github/actions/setup-rust/tests/test_copy_stdlib.py
🪛 LanguageTool
.github/actions/setup-rust/CHANGELOG.md
[typographical] ~4-~4: To join two clauses or introduce examples, consider using an em dash.
Context: # Changelog ## v1.0.8 - 2025-07-24 - Build OpenBSD standard lib...
(DASH_RULE)
[typographical] ~9-~9: To join two clauses or introduce examples, consider using an em dash.
Context: ...the pinned nightly toolchain. ## v1.0.7 - 2025-07-24 - Quote boolean defaults in ...
(DASH_RULE)
[typographical] ~13-~13: To join two clauses or introduce examples, consider using an em dash.
Context: ...ml` to avoid type mismatches. ## v1.0.6 - 2025-07-24 - Cache OpenBSD standard lib...
(DASH_RULE)
[typographical] ~20-~20: To join two clauses or introduce examples, consider using an em dash.
Context: ...x README example indentation. ## v1.0.5 - 2025-07-24 - Install macOS cross build ...
(DASH_RULE)
🪛 Ruff (0.12.2)
.github/actions/setup-rust/tests/test_copy_stdlib.py
9-9: Missing docstring in public function
(D103)
11-11: subprocess call: check for execution of untrusted input
(S603)
14-14: Missing docstring in public function
(D103)
29-29: Missing docstring in public function
(D103)
47-47: Missing docstring in public function
(D103)
.github/actions/setup-rust/scripts/copy_openbsd_stdlib.py
14-14: Move standard library import pathlib.Path into a type-checking block
Move into type-checking block
(TC003)
36-36: subprocess call: check for execution of untrusted input
(S603)
🔇 Additional comments (5)
.github/actions/setup-rust/CHANGELOG.md (1)
4-26: LGTM! Changelog entries properly reordered and duplicate versions resolved.The changelog entries are now correctly ordered chronologically, and the duplicate v1.0.5 issue from previous reviews has been resolved. The v1.0.8 entry properly documents the OpenBSD-related changes including the new
openbsd-nightlyinput and updated build path..github/actions/setup-rust/tests/test_copy_stdlib.py (1)
14-55: Excellent test coverage for the copy script.The tests comprehensively cover the main scenarios: successful copying, overwriting existing content, and handling missing source directories. The test logic correctly validates both success and failure paths.
.github/actions/setup-rust/scripts/copy_openbsd_stdlib.py (3)
26-28: Excellent error handling for missing artifacts.The guard condition properly checks for the existence of the source directory and provides a clear error message, preventing potential errors during the build process as mentioned in the PR objectives.
34-40: Robust atomic copy implementation.The use of a temporary directory with rsync followed by atomic rename ensures consumers never see partially copied standard library files. This is a solid approach for maintaining build consistency.
14-16: Reorganise imports for better grouping.Move the standard library import into the correct group according to PEP 8.
+import shutil +import subprocess from pathlib import Path -import shutil -import subprocessLikely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/actions/setup-rust/action.yml (1)
113-115: Install uv before script execution.The script uses
uv runwhich requiresuvto be available on the runner. GitHub Actions runners don't includeuvby default.Add
uvinstallation before script execution:+ pip install uv uv run --script "${{ github.action_path }}/scripts/copy_openbsd_stdlib.py" \ "$ARTIFACT_DIR" "$NIGHTLY_SYSROOT"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
.github/actions/setup-rust/action.yml(4 hunks).github/actions/setup-rust/scripts/copy_openbsd_stdlib.py(1 hunks).github/actions/setup-rust/tests/conftest.py(1 hunks).github/actions/setup-rust/tests/test_copy_stdlib.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
.github/actions/*/tests/**
📄 CodeRabbit Inference Engine (AGENTS.md)
.github/actions/*/tests/**: Tests for each action must be present in atests/directory within the action's directory.
Contract tests must validate that declared inputs and outputs round-trip correctly.
Files:
.github/actions/setup-rust/tests/conftest.py.github/actions/setup-rust/tests/test_copy_stdlib.py
.github/actions/*/action.yml
📄 CodeRabbit Inference Engine (AGENTS.md)
.github/actions/*/action.yml: Each action must have anaction.ymlfile containing every input and output, with required ones clearly marked.
Composite actions referencing sibling scripts must use${{ github.action_path }}for portability.
Files:
.github/actions/setup-rust/action.yml
🧬 Code Graph Analysis (1)
.github/actions/setup-rust/tests/conftest.py (1)
shellstub.py (1)
StubManager(39-153)
🔇 Additional comments (11)
.github/actions/setup-rust/tests/conftest.py (1)
1-36: Test utilities implementation looks solid.The fixture setup correctly establishes isolated test environments with proper path management and stubbed shell commands. The return type annotation addresses the previous review feedback.
.github/actions/setup-rust/tests/test_copy_stdlib.py (4)
9-12: Helper function implementation is appropriate.The
run_scriptfunction correctly usesuv run --scriptto execute the target script with proper output capture.
15-28: Basic success test covers expected behaviour.Test verifies successful copying with content preservation to the correct destination path structure.
31-47: Overwrite test validates atomic replacement.Test confirms that existing destination content is completely replaced, not merged, which aligns with the atomic copy design.
50-59: Error handling test ensures robustness.Test properly validates the error path when source artifacts are missing, checking both exit code and error message.
.github/actions/setup-rust/scripts/copy_openbsd_stdlib.py (2)
1-5: Script metadata configuration is appropriate.The uv script configuration correctly specifies Python 3.12+ and Typer dependency requirements.
23-42: Atomic copying implementation is well-designed.The use of rsync with a temporary directory followed by atomic rename ensures consumers never see partial copies. Error handling for missing source directory is appropriate.
.github/actions/setup-rust/action.yml (4)
32-35: New input parameter improves toolchain management.The
openbsd-nightlyinput parameter provides explicit version control for the nightly toolchain, addressing the previous concern about hard-coded dates.
46-51: Nightly toolchain installation is well-structured.The addition of defensive shell options (
set -euo pipefail) and minimal profile installation addresses previous feedback. Dynamic environment variable setup enables proper caching and path resolution.
104-104: Dynamic cache path improves maintainability.Using the
NIGHTLY_SYSROOTenvironment variable instead of a hard-coded path makes the caching more robust and consistent with the toolchain version.
118-118: Dynamic toolchain reference ensures consistency.Using the
OPENBSD_NIGHTLYenvironment variable maintains consistency with the installed toolchain version.
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (1)
.github/actions/setup-rust/action.yml (1)
116-118: Invoke the copy script viapython, notuv
uv runadds a hard dependency on theuvbinary for a single script call. Invoke the script directly with the system Python to simplify the toolchain and avoid another cache layer.- uv run --script "${{ github.action_path }}/scripts/copy_openbsd_stdlib.py" \ - "$ARTIFACT_DIR" "$NIGHTLY_SYSROOT" + python "${{ github.action_path }}/scripts/copy_openbsd_stdlib.py" \ + "$ARTIFACT_DIR" "$NIGHTLY_SYSROOT"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
.github/actions/generate-coverage/CHANGELOG.md(1 hunks).github/actions/generate-coverage/action.yml(1 hunks).github/actions/setup-rust/CHANGELOG.md(1 hunks).github/actions/setup-rust/action.yml(4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
.github/actions/*/CHANGELOG.md
📄 CodeRabbit Inference Engine (AGENTS.md)
Each action must have a
CHANGELOG.mdthat follows SemVer-based changelog for that action only.
Files:
.github/actions/generate-coverage/CHANGELOG.md.github/actions/setup-rust/CHANGELOG.md
.github/actions/*/action.yml
📄 CodeRabbit Inference Engine (AGENTS.md)
.github/actions/*/action.yml: Each action must have anaction.ymlfile containing every input and output, with required ones clearly marked.
Composite actions referencing sibling scripts must use${{ github.action_path }}for portability.
Files:
.github/actions/generate-coverage/action.yml.github/actions/setup-rust/action.yml
🪛 LanguageTool
.github/actions/setup-rust/CHANGELOG.md
[typographical] ~4-~4: To join two clauses or introduce examples, consider using an em dash.
Context: # Changelog ## v1.0.9 - 2025-07-26 - Install uv for running h...
(DASH_RULE)
[typographical] ~8-~8: To join two clauses or introduce examples, consider using an em dash.
Context: ...` for running helper scripts. ## v1.0.8 - 2025-07-24 - Build OpenBSD standard lib...
(DASH_RULE)
[typographical] ~13-~13: To join two clauses or introduce examples, consider using an em dash.
Context: ...the pinned nightly toolchain. ## v1.0.7 - 2025-07-24 - Quote boolean defaults in ...
(DASH_RULE)
[typographical] ~17-~17: To join two clauses or introduce examples, consider using an em dash.
Context: ...ml` to avoid type mismatches. ## v1.0.6 - 2025-07-24 - Cache OpenBSD standard lib...
(DASH_RULE)
[typographical] ~24-~24: To join two clauses or introduce examples, consider using an em dash.
Context: ...x README example indentation. ## v1.0.5 - 2025-07-24 - Install macOS cross build ...
(DASH_RULE)
🔇 Additional comments (4)
.github/actions/setup-rust/action.yml (1)
32-35: Expose nightly version via input – good
Addingopenbsd-nightlymakes the pinned date override-able and resolves earlier feedback..github/actions/generate-coverage/action.yml (1)
49-50: Pin UV action – good practice
Lockingastral-sh/setup-uvto a commit hash ensures repeatable builds and guards against unexpected upstream changes..github/actions/setup-rust/CHANGELOG.md (1)
4-8: Prefer an en dash (–) over hyphen (-) in version headings
Using typographically correct dashes improves readability and matches common changelog style guides.-## v1.0.9 - 2025-07-26 +## v1.0.9 – 2025-07-26Likely an incorrect or invalid review comment.
.github/actions/generate-coverage/CHANGELOG.md (1)
12-18: Changelog re-ordering looks correct
Re-positioning v1.3.0 below v1.3.1 preserves chronological order.
| ## v1.3.2 (2025-07-26) | ||
|
|
||
| - Add optional ratcheting support via `with-ratchet`. Coverage percentages for | ||
| Rust and Python are tracked separately and compared against their respective | ||
| baselines. | ||
| - Improve baseline caching to allow updates and consolidate ratcheting steps. | ||
| - Pin `setup-uv` step to v6.4.3. | ||
|
|
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Include the exact commit hash in the new entry for full traceability
Spell out the SHA (e92bafb6253dcd438e0484186d7669ea7a8ca1cc) alongside v6.4.3 so that readers can quickly verify the pinned revision without digging into the workflow file.
🤖 Prompt for AI Agents
In .github/actions/generate-coverage/CHANGELOG.md around lines 3 to 6, the
changelog entry for pinning the `setup-uv` step to v6.4.3 should include the
exact commit SHA for full traceability. Update the entry to spell out the full
commit hash alongside the version number so readers can easily verify the pinned
revision without needing to check the workflow file.
| - name: Install uv | ||
| # v6.4.3 | ||
| uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Install uv only when required
setup-uv executes on every platform even when the action never calls uv. Gate the step behind the same condition that triggers the OpenBSD build (or any other uv use) to trim ~100 MB download and seconds per job.
- - name: Install uv
- # v6.4.3
- uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc
+ - name: Install uv
+ if: ${{ inputs.with-openbsd == 'true' && runner.os == 'Linux' }}
+ # v6.4.3
+ uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Install uv | |
| # v6.4.3 | |
| uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc | |
| - name: Install uv | |
| if: ${{ inputs.with-openbsd == 'true' && runner.os == 'Linux' }} | |
| # v6.4.3 | |
| uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc |
🤖 Prompt for AI Agents
In .github/actions/setup-rust/action.yml around lines 44 to 46, the step
installing uv runs on every platform regardless of whether uv is needed. Modify
the step to run conditionally only when the OpenBSD build or any other build
requiring uv is triggered, using the same condition that controls uv usage. This
will avoid unnecessary downloads and speed up the job.
| run: | | ||
| set -euo pipefail | ||
| OPENBSD_NIGHTLY='${{ inputs.openbsd-nightly }}' | ||
| rustup toolchain install --profile minimal "$OPENBSD_NIGHTLY" | ||
| echo "OPENBSD_NIGHTLY=$OPENBSD_NIGHTLY" >> "$GITHUB_ENV" | ||
| echo "NIGHTLY_SYSROOT=$(rustc +$OPENBSD_NIGHTLY --print sysroot)" >> "$GITHUB_ENV" | ||
| - name: Cache cargo registry |
There was a problem hiding this comment.
💡 Verification agent
❓ Verification inconclusive
Verify that the pinned nightly is still hosted
Rust nightly toolchains older than ~1 year are pruned. Avoid sudden CI failures by validating the URL or refreshing the pin during releases.
🏁 Script executed:
#!/usr/bin/env bash
# Abort (non-zero) if the nightly metadata file is missing.
set -euo pipefail
NIGHTLY='${{ inputs.openbsd-nightly }}'
URL="https://static.rust-lang.org/dist/channel-rust-${NIGHTLY}.toml"
curl -I --fail --silent "$URL" | head -n1Length of output: 272
Add nightly availability check
Rust prunes nightly toolchains older than ~1 year. Insert a CI step to validate the pinned nightly before installation:
run: |
set -euo pipefail
- OPENBSD_NIGHTLY='${{ inputs.openbsd-nightly }}'
+ OPENBSD_NIGHTLY=${{ inputs.openbsd-nightly }}
+ # Verify that the pinned nightly is still hosted
+ URL="https://static.rust-lang.org/dist/channel-rust-${OPENBSD_NIGHTLY}.toml"
+ curl --fail --silent --head "$URL"
rustup toolchain install --profile minimal "$OPENBSD_NIGHTLY"
echo "OPENBSD_NIGHTLY=$OPENBSD_NIGHTLY" >> "$GITHUB_ENV"
echo "NIGHTLY_SYSROOT=$(rustc +$OPENBSD_NIGHTLY --print sysroot)" >> "$GITHUB_ENV"Place this check immediately before the rustup toolchain install line to avoid sudden CI failures when old nightly channels are pruned.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| run: | | |
| set -euo pipefail | |
| OPENBSD_NIGHTLY='${{ inputs.openbsd-nightly }}' | |
| rustup toolchain install --profile minimal "$OPENBSD_NIGHTLY" | |
| echo "OPENBSD_NIGHTLY=$OPENBSD_NIGHTLY" >> "$GITHUB_ENV" | |
| echo "NIGHTLY_SYSROOT=$(rustc +$OPENBSD_NIGHTLY --print sysroot)" >> "$GITHUB_ENV" | |
| - name: Cache cargo registry | |
| run: | | |
| set -euo pipefail | |
| OPENBSD_NIGHTLY=${{ inputs.openbsd-nightly }} | |
| # Verify that the pinned nightly is still hosted | |
| URL="https://static.rust-lang.org/dist/channel-rust-${OPENBSD_NIGHTLY}.toml" | |
| curl --fail --silent --head "$URL" | |
| rustup toolchain install --profile minimal "$OPENBSD_NIGHTLY" | |
| echo "OPENBSD_NIGHTLY=$OPENBSD_NIGHTLY" >> "$GITHUB_ENV" | |
| echo "NIGHTLY_SYSROOT=$(rustc +$OPENBSD_NIGHTLY --print sysroot)" >> "$GITHUB_ENV" |
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 55-55: syntax error: expected , but found ''
(syntax)
🤖 Prompt for AI Agents
In .github/actions/setup-rust/action.yml around lines 49 to 55, add a step
before the rustup toolchain install command to check if the specified nightly
toolchain is available. Implement a command that queries the availability of the
pinned nightly version and fails early if it is not found, preventing CI
failures due to pruned or outdated nightly toolchains. This validation should be
inserted immediately before the rustup toolchain install line.
Summary
Testing
pytest -qhttps://chatgpt.com/codex/tasks/task_e_6882b2efff9883228658e1a7a2016234
Summary by Sourcery
Improve OpenBSD cross-compilation support in the setup-rust action by pinning and dynamically resolving the nightly toolchain, adding error checks for stdlib copying, cleaning up undocumented inputs, and reordering changelog entries.
Enhancements:
Documentation:
nightly-2025-07-20) for OpenBSD in READMEChores: