-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo add overwrites a symlink Cargo.toml #15241
Comments
for those curious to know why I'm using a Cargo.toml symlink in the first place, read my blog post on that (I didn't make this issue for advertising; I'm just answering a very likely question in advance) |
btw are you aware of native support for cargo script? I posted an update today on it at https://blog.rust-lang.org/inside-rust/2025/02/27/this-development-cycle-in-cargo-1.86.html#cargo-script I would be interested in performance feedback. While we likely won't be doing any |
@epage I'm glad that cargo-script is being worked on on the core side, but it's probably not going to plug all of my holes as well as my current system does rust-analyzer support I heard is coming, which is great news! I avoid writing fish scripts and instead write fish functions specifically because of the startup cost; I can't see cargo-script not having that cost, unfortunately |
better way to phrase things: I have a rust binary generating system, not a rust scripting system. so I think I'm just not the audience for cargo-script, lol |
When Cargo.toml is a symlink, cargo add was overwriting it with a regular file. This change follows the symlink and writes to the target file instead, preserving the symlink structure. Fixes rust-lang#15241
When Cargo.toml is a symlink, cargo add was overwriting it with a regular file. This change follows the symlink and writes to the target file instead, preserving the symlink structure. Fixes rust-lang#15241
When Cargo.toml is a symlink, cargo add was overwriting it with a regular file. This change follows the symlink and writes to the target file instead, preserving the symlink structure. Fixes rust-lang#15241
When Cargo.toml is a symlink, cargo add was overwriting it with a regular file. This change follows the symlink and writes to the target file instead, preserving the symlink structure. Fixes rust-lang#15241
Problem
I'll start with a codeblock as imo it's the most straightforward explanation:
I have Cargo.toml symlinked to the real Cargo.toml somewhere else. When using
cargo add
, I expect the symlink to not be broken. However,cargo add
overrides the symlink into being a normal file, breaking the symlink tie to that other Cargo.toml.I don't think that's intentional.
Steps
viola.
stat
the Cargo.toml to see that it's now a regular file, rather than a symlink.the target Cargo.toml stays untouched, btw
Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: