mirror of
https://github.com/rust-lang/cargo
synced 2024-10-13 19:22:33 +00:00
21322f07b4
At the moment, the rustc exec for the root project inherits the stdout and stderr FDs (so that warnings and errors flow through), but output from dependencies is only emitted if the compilation fails to avoid warning noise from dependencies. |
||
---|---|---|
.vagrant/machines/default/virtualbox | ||
DESIGN | ||
libs | ||
src | ||
tests | ||
.gitignore | ||
.gitmodules | ||
.vimrc | ||
Makefile | ||
MANIFEST.md | ||
README.md | ||
Vagrantfile |
Compiling cargo
You'll want to clone cargo using --recursive on git, to clone in it's submodule dependencies.
$ git clone --recursive https://github.com/carlhuda/cargo
or
$ git submodule init
$ git submodule upgrade
Then it's as simple as make
and you're ready to go.
Porcelain
cargo-compile
$ cargo compile
This command assumes the following directory structure:
|Cargo.toml
|~src
| | {main,lib}.rs
|~target
| |~x86_64-apple-darwin
| | |~lib
| | | |~[symlinked dependencies]
| | | | [build artifacts]
| |~...
When running cargo compile
, Cargo runs the following steps:
cargo verify --manifest=[location of Cargo.toml]
- ... TODO: dependency resolution and downloading ...
cargo prepare
cargo rustc --out-dir=[from Cargo.toml]/[platform] -L [from Cargo.toml]/[platform]/lib ...
Plumbing
cargo-verify
$ cargo verify --manifest=MANIFEST
Verifies that the manifest is in the location specified, in a valid format, and contains all of the required sections.
Success
{ "success": true }
Errors
{
"invalid": < "not-found" | "invalid-format" >,
"missing-field": [ required-field... ],
"missing-source": bool,
"unwritable-target": bool
}
cargo-rustc
$ cargo rustc --out-dir=LOCATION -L LIBDIR -- ...ARGS
cargo-prepare
Prepare the directories (including symlinking dependency libraries) to
be ready for the flags Cargo plans to pass into rustc
.
NOTES and OPEN QUESTIONS
- We need to support per-platform calls to
make
(et al) to build native (mostly C) code. Should this be part ofprepare
or a different step betweenprepare
andcargo-rustc
.