Skip to content

cargo clean fails on projects using cxx for rust <> c++ bindings #13752

@moizzd

Description

@moizzd

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 the target directory.

Steps

  1. Clone https://github.com/dtolnay/cxx
  2. cd to the demo directory
  3. Run cargo build
  4. Run cargo clean
  5. It will fail with the following error:
    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

cargo version --verbose
cargo 1.77.1 (e52e36006 2024-03-26)
release: 1.77.1
commit-hash: e52e360061cacbbeac79f7f1215a7a90b6f08442
commit-date: 2024-03-26
host: x86_64-pc-windows-msvc
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.5.0-DEV (sys:0.4.70+curl-8.5.0 vendored ssl:Schannel)
os: Windows 10.0.19045 (Windows 10 Pro) [64-bit]

Metadata

Metadata

Assignees

Labels

C-bugCategory: bugCommand-cleanE-easyExperience: EasyO-windowsOS: WindowsS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions