Skip to content
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

Allow specifying a custom output directory #1657

Merged
merged 2 commits into from
Jun 4, 2015

Commits on May 28, 2015

  1. Configuration menu
    Copy the full SHA
    655c40b View commit details
    Browse the repository at this point in the history
  2. Allow specifying a custom output directory

    This commit adds support to allow specifying a custom output directory to Cargo.
    First, the `build.target-dir` configuration key is checked, and failing that the
    `CARGO_TARGET_DIR` environment variable is checked, and failing that the root
    package's directory joined with the directory name "target" is used.
    
    There are a few caveats to switching target directories, however:
    
    * If the target directory is in the current source tree, and the folder name is
      not called "target", then Cargo may walk the output directory when determining
      whether a tree is fresh.
    * If the target directory is not called "target", then Cargo may look inside it
      currently for `Cargo.toml` files to learn about local packages.
    * Concurrent usage of Cargo will still result in badness (rust-lang#354), and this is now
      exascerbated because many Cargo projects can share the same output directory.
    * The top-level crate is not cached for future compilations, so if a crate is
      built into directory `foo` and then that crate is later used as a dependency,
      it will be recompiled.
    
    The naming limitations can be overcome in time, but for now it greatly
    simplifies the crawling routines and shouldn't have much of a negative impact
    other than some Cargo runtimes (which can in turn be negated by following the
    "target" name convention).
    
    Closes rust-lang#482
    alexcrichton committed May 28, 2015
    Configuration menu
    Copy the full SHA
    014765f View commit details
    Browse the repository at this point in the history