Find a file
Alex Crichton 014765f788 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 (#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 #482
2015-05-28 15:51:02 -07:00
src Allow specifying a custom output directory 2015-05-28 15:51:02 -07:00
tests Allow specifying a custom output directory 2015-05-28 15:51:02 -07:00
.gitignore Ignore target/ and Cargo.lock in src/registry 2015-04-19 20:11:01 +03:00
.gitmodules Use rust-installer for installation 2014-12-11 12:18:29 -08:00
.travis.install.deps.sh Fixup warnings and the travis script 2015-02-24 11:57:29 -08:00
.travis.yml Allow more advanced filtering of what to build 2015-04-29 10:59:02 -07:00
Cargo.lock Bump Cargo.toml's version to 0.3.0 2015-05-28 15:39:03 -07:00
Cargo.toml Bump Cargo.toml's version to 0.3.0 2015-05-28 15:39:03 -07:00
configure Use new kind= syntax for libs throughout Cargo 2015-03-26 14:05:13 -07:00
LICENSE-APACHE Add the standard Rust Apache/MIT license 2014-06-24 12:26:13 -07:00
LICENSE-MIT Add the standard Rust Apache/MIT license 2014-06-24 12:26:13 -07:00
LICENSE-THIRD-PARTY Install materials to comply with upstream licenses 2014-10-02 12:43:05 -07:00
Makefile.in Bump version to 0.3 2015-05-18 11:21:57 -07:00
README.md Add Third-party cargo subcommands to the README 2015-02-23 14:17:50 +01:00

Cargo downloads your Rust projects dependencies and compiles your project.

Learn more at http://doc.crates.io/.

Installing cargo from nightlies

Cargo has nightlies available for use. The cargo source is not always guaranteed to compile on rust master as it may lag behind by a day or two. Nightlies, however, will run regardless of this fact!

triple=x86_64-unknown-linux-gnu
curl -O https://static.rust-lang.org/cargo-dist/cargo-nightly-$triple.tar.gz
tar xf cargo-nightly-$triple.tar.gz
./cargo-nightly-$triple/install.sh

Nightlies are available for the following triples:

Note that if you're using the windows snapshot you will need Mingw-w64 installed as well as MSYS. The installation script needs to be run inside the MSYS shell.

Compiling cargo

Cargo requires the following tools and packages to build:

  • rustc
  • python
  • curl
  • cmake
  • pkg-config
  • OpenSSL headers (libssl-dev package on ubuntu)

Cargo can then be compiled like many other standard unix-like projects:

git clone https://github.com/rust-lang/cargo
cd cargo
git submodule update --init
./.travis.install.deps.sh
./configure --local-rust-root="$PWD"/rustc
make
make install

More options can be discovered through ./configure, such as compiling cargo for more than one target. For example, if you'd like to compile both 32 and 64 bit versions of cargo on unix you would use:

$ ./configure --target=i686-unknown-linux-gnu,x86_64-unknown-linux-gnu

Adding new subcommands to Cargo

Cargo is designed to be extensible with new subcommands without having to modify Cargo itself. See the Wiki page for more details and a list of known community-developed subcommands.

Contributing to the Docs

To contribute to the docs, all you need to do is change the markdown files in the src/doc directory.

Reporting Issues

Found a bug? We'd love to know about it!

Please report all issues on the github issue tracker.

License

Cargo is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

Third party software

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/).

In binary form, this product includes software that is licensed under the terms of the GNU General Public License, version 2, with a linking exception, which can be obtained from the upstream repository.