Thanks to visit codestin.com
Credit goes to github.com

Skip to content

enhancement: Add option to specify rust-toolchain.toml path#69

Merged
jonasbb merged 3 commits into
actions-rust-lang:mainfrom
Sanielia:main
Sep 14, 2025
Merged

enhancement: Add option to specify rust-toolchain.toml path#69
jonasbb merged 3 commits into
actions-rust-lang:mainfrom
Sanielia:main

Conversation

@Sanielia

Copy link
Copy Markdown
Contributor

Resolves: #47

@jonasbb jonasbb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The rust-cache action also needs to be configured if the Rust source is not in the root of the repository: Swatinem/rust-cache#153 or Swatinem/rust-cache#223.

As I understand it the workspaces value needs to be configured. Potentially you can just set it to the same value as rust_toolchain_dir.

If the cache-workspaces input is not set then it should autoconfigure based on rust_toolchain_dir. If cache-workspaces is explicitly provided, it must always take precedence.

Since the configuration now is for the Rust sources directory, not just the toolchain path, a better name might be something like "rust-src-dir" or "rust-base-dir".

Comment thread action.yml Outdated
@Sanielia Sanielia requested a review from jonasbb August 28, 2025 12:19
@Sanielia

Sanielia commented Sep 3, 2025

Copy link
Copy Markdown
Contributor Author

@jonasbb 👀

@jonasbb

jonasbb commented Sep 5, 2025

Copy link
Copy Markdown
Member

Thank you for preparing the changes. I want to see a test first that shows the cache successfully being used. I can setup one, but don't know right know when I find the time for it.

@jonasbb

jonasbb commented Sep 14, 2025

Copy link
Copy Markdown
Member

As far as I can tell this works. I created a repo where the code lives in a rust-code folder including the rust-toolchain.toml. The correct Rust version gets installed, plus the caching does consider the rust-code/target folder.

The second run shows that dependencies are not being rebuilt.

Run 1:
image

image

Run 2:
image

@jonasbb jonasbb closed this Sep 14, 2025
@jonasbb jonasbb reopened this Sep 14, 2025
@jonasbb jonasbb merged commit 89d3d96 into actions-rust-lang:main Sep 14, 2025
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add option to specify rust-toolchain.toml path

2 participants