-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 clean fails on projects using cxx for rust <> c++ bindings #13752
Comments
Thanks for the report!
The fix seems to be straightforward: here whenever we delete a file, on Windows we additionally check if it is a symlink to a directory. If yes then call |
When submitting a pull request, the first commit should be a test demonstrating the current “bad behavior”, followed by other commits fixing the bug and tests, so that we know we're fixing an issue that really exists. |
@rustbot claim I will take a look. |
Get back from my holiday and start working on this now! |
@hi-rustin I will try it later today.
Thanks
…----------------------------------------
From: "二手掉包工程师" ***@***.***>
Sent: 5/14/24 8:46 AM
To: rust-lang/cargo ***@***.***>
Cc: Moiz Dohadwala ***@***.***>, Mention ***@***.***>
Subject: Re: [rust-lang/cargo] cargo clean fails on projects using cxx for rust <> c++ bindings (Issue #13752)
@moizzd #13910 Could you please help test this patch? I had some issues when I tried to test on my virtual machine.
- You need to clone my repo or clone the Cargo repo and apply my patch.
- Build Cargo with my patch.
- Try `some-path/cargo/target/debug/cargo clean
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
@moizzd Have you tested it? Did it work? |
@hi-rustin No, I haven't had a chance unfortunately. Work related urgency intervened. I will do it today. |
@hi-rustin I built the cargo repo with your patch. I then ran the build on the cxx demo directory and then ran clean:
|
with the unpatched ( installed cargo): Z:\projects\other\demo>cargo clean Caused by: |
Thank you for the efforts. |
The PR that fixes this (#13910) is tagged with the |
Problem
When using the cxx crate to generate rust <> C++ bindings,
cargo clean
fails. The error is due to failure to delete directories generated by the cxx tool chain under thetarget
directory.Steps
demo
directorycargo build
cargo clean
error: failed to remove file
<homedir>\projects\other\cxx\target\debug\build\cxx-test-suite-2dda1da2c847afa7\out\cxxbridge\crate\tests\ffi
Possible Solution(s)
It seems that it is failing to remove a directory that is not empty and/or has sub-directories.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: