-
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
Error on cargo clean
when target directory is a mount point
#11887
Comments
Would you be willing to look into how other build systems handle this problem? |
What do you mean by that? What should I look for? Some existing generic build systems for Rust are either badly supported or stalled, but what I need is merely this small flag just not to suppress error code and keep from using If there is any problem or I just missed something, please point that out. |
e.g. Its both useful to see what we can learn from problems that other build systems have. It also provides an idea of how prevalent the problem is. |
I do not understand what do you mean by that. Clean command in go is not fully analogous to Cargo's command since there is basically no left over objects remaining in the source directory except for few specific ones; it uses temporary directory for intermediary files and source directory as a target for binary output. Same cmake uses an output target for removing objects on cleaning and I am not sure how it works, barely used cmake though. About prevalent problems, there was I am not sure what kind of things can be learned from cleaning commands in build systems without changing the semantics of how cargo manages building crates. I just think this flag would be useful for small scripts (and so I made a PR and I already have used the custom fork with this PR to assist the building pipeline, and it simplified building; I didn't notice perf regressions too). |
It would be nice if Cargo itself would support using different means for target directory filesystem where build artifacts are located but that's a no-go:
I found that (2.) was just not as simple as some quick manual mount and forgetting about it until next reboot and just pressing arrow keys until I find So this is why I suggested such a flag; other build systems either use their own means for temporary files already in temporary folders or provide same or less features as Cargo does right now relative to this problem. |
A few questions and comments on this:
|
As I understand the issue, rust-lang/rfcs#3371 would resolve this, I would appreciate comments on it if you think it doesn't @nandesu-utils :) |
cargo clean
when target directory is a mount point
I've updated the title to focus on the end-user problem, rather than one specific solution. |
Problem
I am using custom script to create a target and mount a
tmpfs
into it but when I run usualcargo clean
it tries to delete the directory which fails with error due to busy resource since a mount point can't be deleted without unmounting first.Proposed Solution
I think having a flag that controls whether the user would want to delete the
/target
directory when cleaning is going to help.Notes
No response
The text was updated successfully, but these errors were encountered: