feat(cargo): Use the CARGO_HOME environment variable to locate the co…#348
Open
AnonTokio wants to merge 2 commits intoRubyMetric:devfrom
Open
feat(cargo): Use the CARGO_HOME environment variable to locate the co…#348AnonTokio wants to merge 2 commits intoRubyMetric:devfrom
AnonTokio wants to merge 2 commits intoRubyMetric:devfrom
Conversation
|
Hi @AnonTokio ❤️ 感谢你的贡献!我们将在最少半小时,最多5天内阅读此 PR 并回复你 |
There was a problem hiding this comment.
Pull request overview
This PR updates the Rust/Cargo recipe to respect the CARGO_HOME environment variable when locating Cargo’s config file, aligning behavior with Cargo’s documented config location precedence.
Changes:
- Added a helper to compute the Cargo config file path using
CARGO_HOMEwhen set, otherwise falling back to~/.cargo/config.toml. - Updated
pl_rust_cargo_getsrcandpl_rust_cargo_setsrcto use the new helper and free the returned path.
Contributor
|
@AnonTokio 👍👍👍 最后需要在:
通过运行 |
ccmywish
reviewed
Mar 21, 2026
Contributor
ccmywish
left a comment
There was a problem hiding this comment.
pl_rust_cargo_config_file() 这个函数可以提一个公用的函数出来给 xy.h:
xy_path_join(): 函数名 @flavor Ruby: Pathname#join
Author
|
@ccmywish 好的,我修改一下,以及 xy_path_join 也放在这个 pr 里提还是单独再提一个 pr?因为功能和这个 pr 不太相关。 |
Contributor
我不介意作为同一个 PR,因为这两个已经确定都要被合并,并且另一个PR的修改将会触及这个PR。 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
问题描述
方案与实现
先检查是否设置了 CARGO_HOME 环境变量,若存在,则使用 $CARGO_HOME/config.toml 作为配置文件地址,否则使用 ~/.cargo/config.toml
@Mikachu2333 @ccmywish