Giter Club home page Giter Club logo

Comments (3)

weihanglo avatar weihanglo commented on June 26, 2024

See #7510 (comment) and dicussions in the closed PR, which consider this as an expected behavior. See also alternaive designs like rust-lang/rfcs#3371 for templating target directories.

Besides alternatives, is there any specific reason you can't set CARGO_TARGET_DIR to the actual directory instead of using a symlink?

from cargo.

SeseMueller avatar SeseMueller commented on June 26, 2024

See #7510 (comment) and dicussions in the closed PR, which consider this as an expected behavior. See also alternaive designs like rust-lang/rfcs#3371 for templating target directories.

Ok, yeah. That makes sense. But given that cargo clean is mostly a manual command, maybe it should warn the user, but proceed as normal?

Besides alternatives, is there any specific reason you can't set CARGO_TARGET_DIR to the actual directory instead of using a symlink?

I didn't realize that setting the target-dir would propagate through modules in my context, that did in fact work. Thanks for pointing that out.

from cargo.

weihanglo avatar weihanglo commented on June 26, 2024

From the manual:

With no options, cargo clean will delete the entire target directory.

Basically cargo clean is an rm -rf taking effect like immediately, so when seeing a warning it's too late. There is a --dry-run flag. When with doubt, users can dry-run a clean before the actual clean, such as cargo clean --verbose --dry-run. Interactive console is also an option, but due to compatibility reasons, that won't become the default behavior of cargo clean in my opinion.

Going to close this in favor of rust-lang/rfcs#3371 and CARGO_TARGET_DIR. Thank you for the report :)

from cargo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.