bors [Fri, 7 Nov 2014 21:15:52 +0000 (21:15 +0000)]
auto merge of #815 : alexcrichton/cargo/another-fix-oh-by-wait-i-verified-this-one-its-ok, r=alexcrichton
Previously the host/target requirement for packages was not correctly calculated
as dependency edges to build dependencies weren't traversed by accident.
Alex Crichton [Fri, 7 Nov 2014 20:59:44 +0000 (12:59 -0800)]
Another fix for cross-compiled build scripts
Previously the host/target requirement for packages was not correctly calculated
as dependency edges to build dependencies weren't traversed by accident.
bors [Fri, 7 Nov 2014 19:28:57 +0000 (19:28 +0000)]
auto merge of #813 : alexcrichton/cargo/build-cmd-cross-compile, r=brson
These commits contain a number of improvements to the usage of build scripts when cross compiling. A few erroneous assumptions were made to start out with, and this also fixes the long-standing bug of using build scripts in host packages (e.g. plugins and build dependencies).
Alex Crichton [Fri, 7 Nov 2014 19:09:59 +0000 (11:09 -0800)]
Fix build scripts and double-compiled packages
This commit fixes support for build scripts in packages which are compiled for
both the host and target architectures. The support was previously hindered by
the fact that the build script was always invoked precisely once for the target
architecture unconditionally.
This adds support for build scripts themselves to depend on build scripts, and
everything should "just work" if build scripts respect their environment
variables.
Alex Crichton [Fri, 7 Nov 2014 17:25:25 +0000 (09:25 -0800)]
Fix cross compiling with a build script
Previously there was a mixup of where the build script was getting compiled into
as well as where the output was going to. This commit fixes the problems for
now, but still has room for improvement in the future.
Build scripts themselves are now unconditionally built into `target/build/..`
because they're compiled for the host platform. Their outputs are in
`target/$target/build/..` as expected.
bors [Fri, 7 Nov 2014 16:52:47 +0000 (16:52 +0000)]
auto merge of #798 : alexcrichton/cargo/issue-777, r=brson
At the same time this commit renames the `.tar.gz` extension to `.crate`. This
helps our perception on Windows as we're not trying to leave them out in the
dark, and we'd also like the ability to modify the format later in the future.
bors [Thu, 6 Nov 2014 00:02:30 +0000 (00:02 +0000)]
auto merge of #799 : alexcrichton/cargo/moar-parallel, r=brson
When building unit tests for a library, we don't need the library itself to be
built beforehand, so the two can be built in parallel. If the crate takes awhile
to compile, this shows some excellent wall-time speedups.
bors [Wed, 5 Nov 2014 23:02:41 +0000 (23:02 +0000)]
auto merge of #802 : alexcrichton/cargo/issue-801, r=brson
Previously all features were traversed when adding information to the lockfile,
but the traversal forgot to add optional dependencies that did not have a
corresponding feature.
bors [Wed, 5 Nov 2014 22:35:35 +0000 (22:35 +0000)]
auto merge of #803 : alexcrichton/cargo/fix-some-tests, r=alexcrichton
Right now we're accidentally not actually leveraging this function well in some
tests due to this sequence of events:
1. The tests run at time X, building artifacts that remember the fingerprint is
at time X.
2. The entire project is moved back one hour to (X-1).
3. A new file is created, at time X (second-level resolution on some systems).
4. On a rebuild, the maximum mtime is still X (due to the new file).
For this reason there are some more calls to move_into_the_past() to push files
back another hour after they've been created to make sure the maximum mtime is
(X-1), or something different than X.
Alex Crichton [Wed, 5 Nov 2014 22:00:38 +0000 (14:00 -0800)]
More aggresively move_into_the_past for tests
Right now we're accidentally not actually leveraging this function well in some
tests due to this sequence of events:
1. The tests run at time X, building artifacts that remember the fingerprint is
at time X.
2. The entire project is moved back one hour to (X-1).
3. A new file is created, at time X (second-level resolution on some systems).
4. On a rebuild, the maximum mtime is still X (due to the new file).
For this reason there are some more calls to move_into_the_past() to push files
back another hour after they've been created to make sure the maximum mtime is
(X-1), or something different than X.
Alex Crichton [Wed, 5 Nov 2014 03:40:06 +0000 (19:40 -0800)]
Build lib tests and libraries in parallel
When building unit tests for a library, we don't need the library itself to be
built beforehand, so the two can be built in parallel. If the crate takes awhile
to compile, this shows some excellent wall-time speedups.
bors [Wed, 5 Nov 2014 21:13:08 +0000 (21:13 +0000)]
auto merge of #792 : alexcrichton/cargo/build-cmd, r=brson
This series of commits (based on https://github.com/rust-lang/cargo/pull/763) is an implementation of the recent [Cargo RFC](https://github.com/rust-lang/rfcs/blob/master/text/0403-cargo-build-command.md). This should implement all portions of the RFC, but there's a lot so an extra set of eyes would be nice!
I haven't added documentation for it all yet, but I would like to do so before landing (starting with https://github.com/rust-lang/cargo/pull/749). Otherwise I've been migrating all of the existing cargo dependencies away from the build command to a build script, and the progress can be seen with these repositories:
Alex Crichton [Wed, 5 Nov 2014 02:56:08 +0000 (18:56 -0800)]
Move generated tarballs under target/package
At the same time this commit renames the `.tar.gz` extension to `.crate`. This
helps our perception on Windows as we're not trying to leave them out in the
dark, and we'd also like the ability to modify the format later in the future.
Alex Crichton [Wed, 5 Nov 2014 19:13:04 +0000 (11:13 -0800)]
Be sure to lock purely optional dependencies
Previously all features were traversed when adding information to the lockfile,
but the traversal forgot to add optional dependencies that did not have a
corresponding feature.
Alex Crichton [Fri, 31 Oct 2014 22:51:13 +0000 (15:51 -0700)]
Refine the dependency graph for build scripts
Build scripts can immediately start building as soon as all build dependencies
are available and not need to wait for normal dependencies. This commit also
includes a number of refactorings and reorganizations to tidy up how build
scripts are processed.
One primary piece of state introduced in this commit is a shared Arc<Mutex<T>>
which contains information about the processed build scripts as compilation
continues. Compilation commands will draw information from this state and build
scripts will feed information back into this state to ensure it's up to date.
Alex Crichton [Fri, 31 Oct 2014 17:49:04 +0000 (10:49 -0700)]
Implement the `links` manifest key
This commit adds the `links` manifest key as a string of a C library which is
being linked to. This is passed as an argument to the build command when not
overridden. The implementation of overrides will come soon!
bors [Fri, 31 Oct 2014 20:44:47 +0000 (20:44 +0000)]
auto merge of #773 : alexcrichton/cargo/update-all-packages-from-a-git-repo, r=brson
With the recent resolve rewrite, `cargo update -p foo` would only update one
package in a git repository, even if the repository provided many packages.
Cargo does not currently support depending on the same git repository source
with different precise revisions, and this would cause errors down the line
depending on what happened.
This adds a fix to the `resolve_with_previous` method to ensure that any
non-registry sources being updated will not have any locked packages inside them
which would result in an invalid lockfile.
Alex Crichton [Wed, 29 Oct 2014 18:42:45 +0000 (11:42 -0700)]
Be sure to update all packages from a git source
With the recent resolve rewrite, `cargo update -p foo` would only update one
package in a git repository, even if the repository provided many packages.
Cargo does not currently support depending on the same git repository source
with different precise revisions, and this would cause errors down the line
depending on what happened.
This adds a fix to the `resolve_with_previous` method to ensure that any
non-registry sources being updated will not have any locked packages inside them
which would result in an invalid lockfile.
Alex Crichton [Tue, 28 Oct 2014 15:32:54 +0000 (08:32 -0700)]
Update curl-rust to handle SSL config for linuxes
Right now the cargo built on the snapshot bot isn't able to talk to the registry
due to failing to validate the SSL certificate. This is likely due to the
certificate path being hardcoded to something that's compatible with CentOS
(which isn't what I'm running locally).
I've modified curl-rust to use openssl-static-sys to probe the system for where
certificates are located and inform handles by default about the found
locations. This is the same strategy that git2-rs uses to inform openssl about
where the certificates are located.
Tomas Sedovic [Mon, 27 Oct 2014 21:49:20 +0000 (22:49 +0100)]
Add `--name` and `--example` to cargo run
This lets us compile and run examples using `cargo run --example NAME`.
Selecting the other binary targets is now done using the `--name` flag.
`cargo run` falls back to the old behaviour (running the only bin target
in the project, failing if there are more) in neither `--name` nor
`--example` are present.
bors [Mon, 27 Oct 2014 23:49:37 +0000 (23:49 +0000)]
auto merge of #767 : alexcrichton/cargo/issue-637, r=wycats
Each dependency itself already has the precise source listed, and we're
guaranteed that for each (source, name) pair that there is exactly one
dependency, so there is always a way to rebuild the precise dependency graph
after the fact by looking up the (source, name) pair in the hash map.
This should help with some of the readability concerns in #637 because the git
SHA that a source is locked to is now only mentioned once in a lockfile.
This commit does preserve, however, the mention of the version in each
dependency line which will likely never go away. This means that for
registry-based packages will still run into the same lockfile merge conflict
troubles, there will just be more readable versions than git hashes.
It should also be noted that this will alter all currently generated lockfiles
as any dependencies mentioned will lose the hashes mentioned afterwards. This
will likely cause somewhat of a transitionary pain as this version of cargo
propagates throughout.
Alex Crichton [Mon, 27 Oct 2014 18:54:48 +0000 (11:54 -0700)]
Don't encode precise in lockfile dep pointers
Each dependency itself already has the precise source listed, and we're
guaranteed that for each (source, name) pair that there is exactly one
dependency, so there is always a way to rebuild the precise dependency graph
after the fact by looking up the (source, name) pair in the hash map.
This should help with some of the readability concerns in #637 because the git
SHA that a source is locked to is now only mentioned once in a lockfile.
This commit does preserve, however, the mention of the version in each
dependency line which will likely never go away. This means that for
registry-based packages will still run into the same lockfile merge conflict
troubles, there will just be more readable versions than git hashes.
It should also be noted that this will alter all currently generated lockfiles
as any dependencies mentioned will lose the hashes mentioned afterwards. This
will likely cause somewhat of a transitionary pain as this version of cargo
propagates throughout.
bors [Mon, 27 Oct 2014 22:43:26 +0000 (22:43 +0000)]
auto merge of #758 : alexcrichton/cargo/issue-751, r=brson
This ends up killing two birds with one stone! The rationale behind this is that
the example and bin namespaces are not the same, and we don't mix metadata into
either filename, so the outputs need to be in different locations.
bors [Mon, 27 Oct 2014 20:41:25 +0000 (20:41 +0000)]
auto merge of #725 : alexcrichton/cargo/registry-fixes, r=brson
This PR contains a laundry list of improvements when using the registry as a source, and should be one of the last steps necessary for whipping cargo into shape to using the registry. Some of the highlights include:
* All APIs have been updated to the registry's current interface
* Lockfiles are now respected with registry sources
* Conservatively updating dependencies should work
* The network shouldn't be touched unless absolutely necessary
* Lockfiles actually keep versions locked when using a newer registry with more versions
* A new standalone lib was added for interoperating with the registry (HTTP-request-wise)
* Packages are now verified before being published to the registry (this can be opted out of)
* `cargo upload` was renamed to `cargo publish`
The commit series is intended to be individually reviewable and each commit should compile and pass all tests independently (but still needs to be applied in order).