Find a file
Carl Lerche 8c005bb48d Initial stab at integration tests
At the same time, we started adding a generic error handling concept to
Cargo.

The idea is that every Result gets converted to a CargoError, which
includes all the information that Cargo needs to print out a friendly
human error message and exit gracefully.
2014-03-18 18:10:48 -07:00
DESIGN Move design docs to DESIGN 2014-03-17 13:07:23 -07:00
libs Vendor hamcrest-rust 2014-03-12 16:19:39 -07:00
src Initial stab at integration tests 2014-03-18 18:10:48 -07:00
tests Initial stab at integration tests 2014-03-18 18:10:48 -07:00
.gitignore Add missing files 2014-03-12 13:03:36 -07:00
.gitmodules Vendor hamcrest-rust 2014-03-12 16:19:39 -07:00
Makefile Initial stab at integration tests 2014-03-18 18:10:48 -07:00
MANIFEST.md Add missing files 2014-03-12 13:03:36 -07:00
README.md Initial README with some commands sketched out 2014-03-04 16:06:39 -08:00

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 of prepare or a different step between prepare and cargo-rustc.