Update setup-rust action with cross toolchain options#29
Conversation
Reviewer's GuideExtend the composite setup-rust GitHub Action by adding Class diagram for updated setup-rust action inputsclassDiagram
class SetupRustAction {
+install-postgres-deps: bool
+install-sqlite-deps: bool
+use-sccache: bool
+sccache-action-version: string
+with-darwin: bool
+darwin-sdk-version: string
+with-openbsd: bool
+BUILD_PROFILE: string
}
Flow diagram for cross-compilation setup in setup-rust actionflowchart TD
Start([Start])
CheckDarwin{with-darwin == true\nand runner.os == Linux}
SetupOsxCross[Install osxcross]
AddDarwinTargets[Install Rust macOS targets]
CheckOpenBSD{with-openbsd == true\nand runner.os == Linux}
InstallNightly[Install nightly toolchain]
CacheOpenBSDStdlib[Cache OpenBSD stdlib]
BuildOpenBSDStdlib[Clone Rust repo & build OpenBSD std]
AddOpenBSDTarget[Add OpenBSD target]
End([End])
Start --> CheckDarwin
CheckDarwin -- Yes --> SetupOsxCross
SetupOsxCross --> AddDarwinTargets
AddDarwinTargets --> CheckOpenBSD
CheckDarwin -- No --> CheckOpenBSD
CheckOpenBSD -- Yes --> InstallNightly
InstallNightly --> CacheOpenBSDStdlib
CacheOpenBSDStdlib -- Cache Miss --> BuildOpenBSDStdlib
BuildOpenBSDStdlib --> AddOpenBSDTarget
CacheOpenBSDStdlib -- Cache Hit --> AddOpenBSDTarget
AddOpenBSDTarget --> End
CheckOpenBSD -- No --> End
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Rate limit exceeded@leynos has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 58 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
Summary by CodeRabbit
WalkthroughExpand the Changes
Sequence Diagram(s)sequenceDiagram
participant UserWorkflow as GitHub Workflow
participant SetupRust as setup-rust Action
participant OSXCross as osxcross Action
participant RustRepo as Rust Source Repo
UserWorkflow->>SetupRust: Run setup-rust with inputs
alt with-darwin == true and runner == Linux
SetupRust->>OSXCross: Setup macOS cross toolchain (osxcross)
end
alt with-openbsd == true and runner == Linux
SetupRust->>RustRepo: Clone Rust repository
SetupRust->>RustRepo: Build OpenBSD stdlib with x.py
SetupRust->>SetupRust: Copy stdlib to rustup toolchain
end
alt with-openbsd == true
SetupRust->>SetupRust: rustup target add x86_64-unknown-openbsd
end
SetupRust-->>UserWorkflow: Rust toolchain ready for cross-compilation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 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.
- Consider adding caching for the OpenBSD stdlib build artifacts to avoid rebuilding on every run and speed up the action.
- Make the macOS SDK version configurable via an input instead of hardcoding '12.3' in the osxcross setup step.
- Scope the "Add OpenBSD target" step to only run on Linux runners (runner.os == 'Linux') to prevent failures on other operating systems.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding caching for the OpenBSD stdlib build artifacts to avoid rebuilding on every run and speed up the action.
- Make the macOS SDK version configurable via an input instead of hardcoding '12.3' in the osxcross setup step.
- Scope the "Add OpenBSD target" step to only run on Linux runners (runner.os == 'Linux') to prevent failures on other operating systems.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: 2
🔭 Outside diff range comments (1)
.github/actions/setup-rust/README.md (1)
23-30: Fix YAML indentation in usage example
The snippet is not valid YAML;with:must be nested under the step item.-uses: ./.github/actions/setup-rust@v1 - with: + - uses: ./.github/actions/setup-rust@v1 + with: install-postgres-deps: true install-sqlite-deps: true with-darwin: true with-openbsd: true
📜 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(3 hunks).github/actions/setup-rust/action.yml(2 hunks)
🪛 LanguageTool
.github/actions/setup-rust/README.md
[typographical] ~47-~47: The word ‘When’ starts a question. Add a question mark (“?”) at the end of the sentence.
Context: ...t crates can be cross-compiled for macOS. When with-openbsd is enabled, the ac...
(WRB_QUESTION_MARK)
[typographical] ~51-~51: The word ‘When’ starts a question. Add a question mark (“?”) at the end of the sentence.
Context: ...nknown-openbsd` target becomes available. ```yaml # Bring in MSYS2 plus th...
(WRB_QUESTION_MARK)
🧰 Additional context used
🪛 LanguageTool
.github/actions/setup-rust/README.md
[typographical] ~47-~47: The word ‘When’ starts a question. Add a question mark (“?”) at the end of the sentence.
Context: ...t crates can be cross-compiled for macOS. When with-openbsd is enabled, the ac...
(WRB_QUESTION_MARK)
[typographical] ~51-~51: The word ‘When’ starts a question. Add a question mark (“?”) at the end of the sentence.
Context: ...nknown-openbsd` target becomes available. ```yaml # Bring in MSYS2 plus th...
(WRB_QUESTION_MARK)
🔇 Additional comments (1)
.github/actions/setup-rust/CHANGELOG.md (1)
4-8: Add trailing full stop for consistencyKeep bullet lists consistent with previous entries.
- - Install macOS cross build toolchain via `with-darwin`. - - Build OpenBSD standard library and add target via `with-openbsd`. + - Install macOS cross build toolchain via `with-darwin`. + - Build OpenBSD standard library and add target via `with-openbsd`.Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 2
📜 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(3 hunks).github/actions/setup-rust/action.yml(2 hunks)
🧰 Additional context used
🪛 LanguageTool
.github/actions/setup-rust/README.md
[typographical] ~48-~48: The word ‘When’ starts a question. Add a question mark (“?”) at the end of the sentence.
Context: ...t crates can be cross-compiled for macOS. The SDK version can be configured via t...
(WRB_QUESTION_MARK)
[typographical] ~53-~53: 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)
🔇 Additional comments (3)
.github/actions/setup-rust/CHANGELOG.md (1)
4-10: Changelog entry reads clearly – good to go.
All additions follow the existing style and ordering..github/actions/setup-rust/README.md (1)
25-31: Example block is up-to-date – no issues spotted.
The example demonstrates the new inputs without breaking existing users..github/actions/setup-rust/action.yml (1)
68-72: No change:osx-versionis the correct input for setup-osxcross
Official documentation confirms thatosx-versionis the sole parameter for mbround18/setup-osxcross. Keep the snippet as-is.• File: .github/actions/setup-rust/action.yml (lines 68–72)
There was a problem hiding this comment.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
.github/actions/setup-rust/action.yml (1)
74-93: Ensure nightly toolchain exists before using its path.Steps below assume
~/.rustup/toolchains/nightlyis present, but the composite action never installsnightly.
Cross-compilation will fail on a cache miss.@@ - name: Install rust uses: actions-rust-lang/setup-rust-toolchain@9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9 with: override: true components: rustfmt, clippy, llvm-tools-preview + + - name: Install nightly toolchain (needed for OpenBSD cross-compilation) + if: ${{ inputs.with-openbsd == 'true' && runner.os == 'Linux' }} + run: rustup toolchain install nightly
♻️ Duplicate comments (1)
.github/actions/setup-rust/action.yml (1)
87-87: Build path still uses deprecatedsrc/libstd.The Rust source tree moved
libstdtolibrary/std; the old symlink may disappear.
Switch to the canonical location.- ./x.py build --stage 1 --target x86_64-unknown-openbsd src/libstd + ./x.py build --stage 1 --target x86_64-unknown-openbsd library/std
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
.github/actions/setup-rust/CHANGELOG.md(1 hunks).github/actions/setup-rust/action.yml(2 hunks)
🔇 Additional comments (1)
.github/actions/setup-rust/action.yml (1)
12-23: Quote boolean defaults – good job.Quoting the defaults prevents YAML boolean coercion issues. No further action required.
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (2)
.github/actions/setup-rust/CHANGELOG.md (1)
4-18: Release-date requirement satisfied – good jobThe new entries now include ISO-8601 dates, addressing the earlier request.
No further action required..github/actions/setup-rust/action.yml (1)
71-78: Darwin targets step added – resolvedThe action now installs
x86_64-apple-darwinandaarch64-apple-darwinafter setting up osxcross, fulfilling the prior request.
📜 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(3 hunks).github/actions/setup-rust/action.yml(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
.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/*/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/*/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/CHANGELOG.md
[typographical] ~4-~4: To join two clauses or introduce examples, consider using an em dash.
Context: # Changelog ## v1.0.6 - 2025-07-24 - Cache OpenBSD standard lib...
(DASH_RULE)
[typographical] ~11-~11: To join two clauses or introduce examples, consider using an em dash.
Context: ...x README example indentation. ## v1.0.7 - 2025-07-24 - Quote boolean defaults in ...
(DASH_RULE)
[typographical] ~15-~15: To join two clauses or introduce examples, consider using an em dash.
Context: ...ml` to avoid type mismatches. ## v1.0.8 - 2025-07-24 - Build OpenBSD standard lib...
(DASH_RULE)
[typographical] ~19-~19: To join two clauses or introduce examples, consider using an em dash.
Context: ...e updated library/std path. ## v1.0.5 - 2025-07-24 - Install macOS cross build ...
(DASH_RULE)
[typographical] ~24-~24: To join two clauses or introduce examples, consider using an em dash.
Context: ...dd target via with-openbsd. ## v1.0.4 - 2025-06-21 - Optionally install SQLite ...
(DASH_RULE)
[typographical] ~29-~29: To join two clauses or introduce examples, consider using an em dash.
Context: ... install-sqlite-deps input. ## v1.0.3 - 2025-06-20 - Install PostgreSQL client ...
(DASH_RULE)
[typographical] ~33-~33: To join two clauses or introduce examples, consider using an em dash.
Context: ...es on Windows via Chocolatey. ## v1.0.2 - 2025-06-20 - Document BUILD_PROFILE e...
(DASH_RULE)
[typographical] ~37-~37: To join two clauses or introduce examples, consider using an em dash.
Context: ...riable and fix README example ## v1.0.1 - 2025-06-20 - Document caching requireme...
(DASH_RULE)
[typographical] ~41-~41: To join two clauses or introduce examples, consider using an em dash.
Context: ...larify when caches are saved. ## v1.0.0 - 2025-06-20 - Initial version.
(DASH_RULE)
.github/actions/setup-rust/README.md
[typographical] ~48-~48: The word ‘When’ starts a question. Add a question mark (“?”) at the end of the sentence.
Context: ...t crates can be cross-compiled for macOS. The SDK version can be configured via t...
(WRB_QUESTION_MARK)
[typographical] ~56-~56: 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)
🪛 markdownlint-cli2 (0.17.2)
.github/actions/setup-rust/CHANGELOG.md
41-41: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
🪛 YAMLlint (1.37.1)
.github/actions/setup-rust/action.yml
[error] 27-27: wrong indentation: expected 4 but found 6
(indentation)
🔇 Additional comments (2)
.github/actions/setup-rust/README.md (2)
3-5: Documentation extension looks sound – no action needed.The updated one-liner correctly mentions the new cross-compiler capabilities without becoming verbose.
53-57: Pin the nightly toolchain date to avoid sudden breakage.Nightly Rust changes frequently; an unpinned channel can silently break the OpenBSD std rebuild. Pin a date or auto-update via Renovate.
| ## v1.0.0 - 2025-06-20 | ||
| - Initial version. |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Insert the missing blank line after the v1.0.0 heading
markdownlint (MD022) complains because the bullet list begins immediately after the heading. Add an empty line to keep headings surrounded by blank lines.
## v1.0.0 - 2025-06-20
+
- Initial version.📝 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.0 - 2025-06-20 | |
| - Initial version. | |
| ## v1.0.0 - 2025-06-20 | |
| - Initial version. |
🧰 Tools
🪛 LanguageTool
[typographical] ~41-~41: To join two clauses or introduce examples, consider using an em dash.
Context: ...larify when caches are saved. ## v1.0.0 - 2025-06-20 - Initial version.
(DASH_RULE)
🪛 markdownlint-cli2 (0.17.2)
41-41: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
42-42: Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
🤖 Prompt for AI Agents
In .github/actions/setup-rust/CHANGELOG.md at lines 41 to 42, add a blank line
immediately after the "## v1.0.0 - 2025-06-20" heading to separate it from the
bullet list below. This will satisfy markdownlint MD022 by ensuring the heading
is surrounded by blank lines.
| | install-postgres-deps | Install PostgreSQL system dependencies | no | `false` | | ||
| | install-sqlite-deps | Install SQLite development libraries (Windows) | no | `false` | | ||
| | with-darwin | Install macOS cross build toolchain | no | `false` | | ||
| | darwin-sdk-version | macOS SDK version for osxcross | no | `12.3` | | ||
| | with-openbsd | Build OpenBSD std library for cross-compilation | no | `false` | | ||
| | BUILD_PROFILE | Build profile used for caching | no | `release` | |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Alphabetise the inputs table for faster scanning.
Keep the inputs list in lexicographical order to help users locate a flag quickly.
-| install-postgres-deps | Install PostgreSQL system dependencies | no | `false` |
-| install-sqlite-deps | Install SQLite development libraries (Windows) | no | `false` |
-| with-darwin | Install macOS cross build toolchain | no | `false` |
-| darwin-sdk-version | macOS SDK version for osxcross | no | `12.3` |
-| with-openbsd | Build OpenBSD std library for cross-compilation | no | `false` |
-| BUILD_PROFILE | Build profile used for caching | no | `release` |
+| BUILD_PROFILE | Build profile used for caching | no | `release` |
+| darwin-sdk-version | macOS SDK version for osxcross | no | `12.3` |
+| install-postgres-deps | Install PostgreSQL system dependencies | no | `false` |
+| install-sqlite-deps | Install SQLite development libraries (Windows) | no | `false` |
+| with-darwin | Install macOS cross build toolchain | no | `false` |
+| with-openbsd | Build OpenBSD std library for cross-compilation | no | `false` |📝 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.
| | install-postgres-deps | Install PostgreSQL system dependencies | no | `false` | | |
| | install-sqlite-deps | Install SQLite development libraries (Windows) | no | `false` | | |
| | with-darwin | Install macOS cross build toolchain | no | `false` | | |
| | darwin-sdk-version | macOS SDK version for osxcross | no | `12.3` | | |
| | with-openbsd | Build OpenBSD std library for cross-compilation | no | `false` | | |
| | BUILD_PROFILE | Build profile used for caching | no | `release` | | |
| | BUILD_PROFILE | Build profile used for caching | no | `release` | | |
| | darwin-sdk-version | macOS SDK version for osxcross | no | `12.3` | | |
| | install-postgres-deps | Install PostgreSQL system dependencies | no | `false` | | |
| | install-sqlite-deps | Install SQLite development libraries (Windows) | no | `false` | | |
| | with-darwin | Install macOS cross build toolchain | no | `false` | | |
| | with-openbsd | Build OpenBSD std library for cross-compilation | no | `false` | |
🤖 Prompt for AI Agents
In .github/actions/setup-rust/README.md around lines 11 to 16, the inputs table
is not alphabetized, which makes it harder to scan. Rearrange the rows of the
inputs table so that the input names are in lexicographical order, ensuring the
table remains correctly formatted and aligned.
| ```yaml | ||
| uses: ./.github/actions/setup-rust@v1 | ||
| with: | ||
| install-postgres-deps: true | ||
| install-sqlite-deps: true | ||
| - uses: ./.github/actions/setup-rust@v1 | ||
| with: | ||
| install-postgres-deps: true | ||
| install-sqlite-deps: true | ||
| with-darwin: true | ||
| with-openbsd: true | ||
| ``` |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Show all new inputs in the usage snippet.
Demonstrate darwin-sdk-version so users see how to override the default.
install-sqlite-deps: true
with-darwin: true
+ # Override if a different SDK is required
+ darwin-sdk-version: '13.3'
with-openbsd: true📝 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.
| ```yaml | |
| uses: ./.github/actions/setup-rust@v1 | |
| with: | |
| install-postgres-deps: true | |
| install-sqlite-deps: true | |
| - uses: ./.github/actions/setup-rust@v1 | |
| with: | |
| install-postgres-deps: true | |
| install-sqlite-deps: true | |
| with-darwin: true | |
| with-openbsd: true | |
| ``` | |
| - uses: ./.github/actions/setup-rust@v1 | |
| with: | |
| install-postgres-deps: true | |
| install-sqlite-deps: true | |
| with-darwin: true | |
| # Override if a different SDK is required | |
| darwin-sdk-version: '13.3' | |
| with-openbsd: true |
🤖 Prompt for AI Agents
In .github/actions/setup-rust/README.md around lines 24 to 31, the usage snippet
does not show all new inputs, specifically the darwin-sdk-version input. Update
the snippet to include darwin-sdk-version with an example value to demonstrate
how users can override the default SDK version on Darwin systems.
| When `with-darwin` is enabled, the action installs the osxcross toolchain on | ||
| Linux so that Rust crates can be cross-compiled for macOS. The SDK version can | ||
| be configured via the `darwin-sdk-version` input and defaults to `12.3`. The | ||
| `x86_64-apple-darwin` and `aarch64-apple-darwin` Rust targets are installed so | ||
| that Cargo can produce macOS binaries. | ||
|
|
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Add a reference link and note Apple SDK licence.
Point readers at the osxcross project page and remind them that Apple’s SDK is subject to licensing terms.
-When `with-darwin` is enabled, the action installs the osxcross toolchain on
-Linux so that Rust crates can be cross-compiled for macOS.
+When `with-darwin` is enabled, the action installs the
+[osxcross](https://github.com/tpoechtrager/osxcross) toolchain on
+Linux so that Rust crates can be cross-compiled for macOS. Ensure your
+use of the Apple SDK complies with Apple’s licensing terms.📝 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.
| When `with-darwin` is enabled, the action installs the osxcross toolchain on | |
| Linux so that Rust crates can be cross-compiled for macOS. The SDK version can | |
| be configured via the `darwin-sdk-version` input and defaults to `12.3`. The | |
| `x86_64-apple-darwin` and `aarch64-apple-darwin` Rust targets are installed so | |
| that Cargo can produce macOS binaries. | |
| When `with-darwin` is enabled, the action installs the | |
| [osxcross](https://github.com/tpoechtrager/osxcross) toolchain on | |
| Linux so that Rust crates can be cross-compiled for macOS. Ensure your | |
| use of the Apple SDK complies with Apple’s licensing terms. | |
| The SDK version can be configured via the `darwin-sdk-version` input and defaults to `12.3`. The | |
| `x86_64-apple-darwin` and `aarch64-apple-darwin` Rust targets are installed so | |
| that Cargo can produce macOS binaries. |
🧰 Tools
🪛 LanguageTool
[typographical] ~48-~48: The word ‘When’ starts a question. Add a question mark (“?”) at the end of the sentence.
Context: ...t crates can be cross-compiled for macOS. The SDK version can be configured via t...
(WRB_QUESTION_MARK)
🤖 Prompt for AI Agents
In .github/actions/setup-rust/README.md around lines 47 to 52, add a reference
link to the osxcross project page to guide readers to the source of the
toolchain. Also include a note reminding users that Apple's SDK is subject to
licensing terms, ensuring they are aware of the legal considerations when using
the SDK.
40bb32b to
22f2b1e
Compare
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey @leynos - I've reviewed your changes and found some issues that need to be addressed.
- The README mentions a BUILD_PROFILE input that isn’t defined in action.yml; either remove it or add it to the inputs list.
- The changelog versions are out of order (v1.0.5 appears after v1.0.8); please reorder entries in descending version order.
- Consider pinning a specific nightly toolchain version for building the OpenBSD stdlib to ensure reproducible builds rather than using the floating “nightly” channel.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The README mentions a BUILD_PROFILE input that isn’t defined in action.yml; either remove it or add it to the inputs list.
- The changelog versions are out of order (v1.0.5 appears after v1.0.8); please reorder entries in descending version order.
- Consider pinning a specific nightly toolchain version for building the OpenBSD stdlib to ensure reproducible builds rather than using the floating “nightly” channel.
## Individual Comments
### Comment 1
<location> `.github/actions/setup-rust/action.yml:95` </location>
<code_context>
+ id: openbsd-stdlib-cache
+ uses: actions/cache@v4
+ with:
+ path: ~/.rustup/toolchains/nightly/lib/rustlib/x86_64-unknown-openbsd
+ key: openbsd-stdlib-${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}
+ - name: Clone Rust repo & build OpenBSD std
</code_context>
<issue_to_address>
Hardcoded path to nightly toolchain may not be robust across environments.
This path may not be valid if the nightly toolchain has a date suffix or custom name. Dynamically resolve the nightly toolchain directory to ensure compatibility.
</issue_to_address>
### Comment 2
<location> `.github/actions/setup-rust/action.yml:105` </location>
<code_context>
+ HOST_TRIPLE=$(rustc -vV | grep '^host:' | awk '{print $2}')
+ ./x.py build --stage 1 --target x86_64-unknown-openbsd library/std
+ mkdir -p ~/.rustup/toolchains/nightly/lib/rustlib/x86_64-unknown-openbsd
+ cp -r build/$HOST_TRIPLE/stage1/lib/rustlib/x86_64-unknown-openbsd/* \
+ ~/.rustup/toolchains/nightly/lib/rustlib/x86_64-unknown-openbsd/
+ - name: Add OpenBSD target
</code_context>
<issue_to_address>
No error handling for missing build artifacts during stdlib copy.
Add checks to verify the existence of build artifacts before copying to prevent silent failures if the build fails or directory structure changes.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
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
fi
cp -r "$ARTIFACT_DIR"/* \
~/.rustup/toolchains/nightly/lib/rustlib/x86_64-unknown-openbsd/
>>>>>>> REPLACE
</suggested_fix>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| id: openbsd-stdlib-cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.rustup/toolchains/nightly/lib/rustlib/x86_64-unknown-openbsd |
There was a problem hiding this comment.
issue: Hardcoded path to nightly toolchain may not be robust across environments.
This path may not be valid if the nightly toolchain has a date suffix or custom name. Dynamically resolve the nightly toolchain directory to ensure compatibility.
| cp -r build/$HOST_TRIPLE/stage1/lib/rustlib/x86_64-unknown-openbsd/* \ | ||
| ~/.rustup/toolchains/nightly/lib/rustlib/x86_64-unknown-openbsd/ |
There was a problem hiding this comment.
suggestion: No error handling for missing build artifacts during stdlib copy.
Add checks to verify the existence of build artifacts before copying to prevent silent failures if the build fails or directory structure changes.
| 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 | |
| fi | |
| cp -r "$ARTIFACT_DIR"/* \ | |
| ~/.rustup/toolchains/nightly/lib/rustlib/x86_64-unknown-openbsd/ |
Summary
with-darwinandwith-openbsdinputswith-darwinis enabledwith-openbsdTesting
pytest -qhttps://chatgpt.com/codex/tasks/task_e_687f39fefe248322867d8dbe54a81cb9
Summary by Sourcery
Enable macOS and OpenBSD cross-compilation support in the setup-rust action by introducing new inputs and implementing corresponding toolchain installation, build, and caching steps
New Features:
Enhancements:
Documentation:
Chores: