-
Notifications
You must be signed in to change notification settings - Fork 21
github actions: use actions-rust-lang/setup-rust-toolchain #1282
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
🧩 Analysis chain
🌐 Web query:
Fortoml-cli, doestoml get --toml-path Cargo.toml "workspace.package.rust-version"return quoted strings by default, and is--rawthe correct way to emit an unquoted value for CI outputs?💡 Result:
Yes, for the
toml-clitool (by gnprice), thetoml getcommand emits data as JSON by default [1]. When the target data is a string, this default JSON output includes quotes [1]. Using the--raw(or-r) flag is the correct way to emit the value as a raw string without quotes, which is specifically designed for use in shell scripts and CI/CD pipelines [1]. Example usage: toml get --toml-path Cargo.toml "workspace.package.rust-version" --raw [1]Citations:
Use
--rawflag withtoml getto extract unquoted MSRV values.By default,
toml-cliemits JSON-formatted output, which wraps string values in quotes. Without the--rawflag,MSRVwill contain"1.xx"instead of1.xx. Passing quoted strings tosetup-rust-toolchainrisks breaking toolchain resolution and failing CI jobs.✅ Proposed fix
- name: Get package MSRV id: msrv run: | - MSRV=$(toml get --toml-path Cargo.toml "workspace.package.rust-version") + MSRV=$(toml get --raw --toml-path Cargo.toml "workspace.package.rust-version") + test -n "$MSRV" echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT" working-directory: stratisdAlso applies to: lines 152-155, 219-220, 222-225
🤖 Prompt for AI Agents
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.
toml-cli gethas no--rawflag and its output without that non-existent--rawflag is plain text.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.
@mulkieran, you are correct — I apologize for the confusion. My review comment was based on the gnprice/toml-cli Rust crate, which outputs JSON by default and requires--raw/-rto print strings directly. However, the workflow uses--toml-pathsyntax, which identifies it as the Pythontoml-clifrom PyPI — a completely different tool that outputs plain text by default and does not have a--rawflag. The review comment was incorrect and the existing code is fine. Sorry for the noise!✏️ Learnings added