Commit graph

421 commits

Author SHA1 Message Date
bors e6ec71a852 auto merge of #817 : alexcrichton/cargo/build-cmd, r=brson
This registers a new cargo snapshot as well as updates all dependencies to versions that are using build scripts. This means that overrides can now be used when looking for native libs for cargo!

This also modifies the behavior of `--enable-nightly` to add some extra configuration the buildbot needs to build cargo on CentOS.
2014-11-11 22:44:53 +00:00
Alex Crichton 079d90235d Upgrade all deps to using build scripts 2014-11-11 14:31:23 -08:00
Richard Diamond b9f54c5524 Don't count custom compile scripts as targets. 2014-11-11 14:51:27 -06:00
bors 4444c1d6dc auto merge of #829 : alexcrichton/cargo/less-paniks, r=brson
Unused overrides previously led to a panic, and build cmd outputs were cached in the *host* location instead of the *target* location.
2014-11-11 18:59:12 +00:00
Alex Crichton 0c08e0d74f Don't panic on unused overrides
This previously did a failing hashtable lookup when an `Option`-returning `get`
would suffice.
2014-11-10 09:36:36 -08:00
Alex Crichton 5eab8ec160 Don't look at custom build targets for output locs
They don't have any! We also care more about the other targets regardless.

Closes #821
2014-11-10 09:23:14 -08:00
Alex Crichton 3a3d5d6a90 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.
2014-11-07 12:59:44 -08:00
bors ad4f3c99f7 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).
2014-11-07 19:28:57 +00:00
Alex Crichton ac4eddbbc8 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.
2014-11-07 11:22:53 -08:00
Alex Crichton b9c2b46e33 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.
2014-11-07 09:25:25 -08:00
bors e2ef57d391 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.

Closes #777
2014-11-07 16:52:47 +00:00
Alex Crichton 9879a0a5f6 Pass -C prefer-dynamic for dylib dependencies 2014-11-06 08:58:01 -08:00
Alex Crichton c7699d2c66 Merge branch 'add-did-you-mean' of https://github.com/pwoolcoc/cargo into update 2014-11-06 08:49:16 -08:00
Paul Woolcock 12f5de8e9b Add 'did you mean...' message when a subcommand is not found. 2014-11-06 09:23:44 -05:00
Paul Woolcock d33f50c0f0 TcpListener::bind now takes 1 argument instead of 2 2014-11-06 08:08:38 -05:00
bors 43cf7dcbee auto merge of #804 : alexcrichton/cargo/moar-fixes, r=alexcrichton
Some flaky test improvements as well as some updates to the styling of the docs.
2014-11-05 23:43:18 +00:00
Alex Crichton 7a67808ae7 Fix some more flaky tests
At the same time, also improve the deprecation message for the old build command
to be a little more descriptive about how to migrate
2014-11-05 15:12:09 -08:00
bors d49b20d440 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.

Closes #801
2014-11-05 23:02:41 +00:00
Alex Crichton 76305ddfa0 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.
2014-11-05 14:33:34 -08:00
Alex Crichton 5e29a8bbac Fix custom build tests on windows 2014-11-05 13:11:04 -08:00
Alex Crichton 291c774763 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.

Closes #777
2014-11-05 11:40:15 -08:00
Alex Crichton 8670b56af3 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.

Closes #801
2014-11-05 11:39:57 -08:00
Alex Crichton 85a96e44ca Follow through on the OUT_DIR promise for rustc compiles 2014-11-05 11:37:34 -08:00
Alex Crichton 2833358294 Fix some flaky tests 2014-11-05 11:37:34 -08:00
Alex Crichton 800d9eb86a Fix the build command passing -L/-l without links 2014-11-05 11:37:34 -08:00
Alex Crichton a5c868a9dc Really fix cargo test and fix an OUT_DIR bug
Assorted bug fixes discovered while migrating packages to using this build
command infrastructure.
2014-11-05 11:37:34 -08:00
Alex Crichton bf30c8cfa0 Add a test for build commands with build commands 2014-11-05 11:37:34 -08:00
Alex Crichton 8960dd1850 Implement build-dependencies
This adds a flavor of Dependency for build dependencies. Build dependencies are
only ever used when building build commands themselves.
2014-11-05 11:37:34 -08:00
Alex Crichton cde3b1e4fc Add tests for other cargo cmds + -L propagation 2014-11-05 11:37:34 -08:00
Alex Crichton 3b21f7ac43 Ensure fresh build commands populate build info
Whenever a build command is fresh, we need to be sure to propagate its build
information upwards from the cache stored on disk.
2014-11-05 11:37:34 -08:00
Alex Crichton a0d499e028 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.
2014-11-05 11:37:34 -08:00
Alex Crichton 6391536087 Implement overrides via local cargo configuration
This is an implementation of overriding native dependencies and passing
aribtrary metadata and such.
2014-11-05 11:37:34 -08:00
Alex Crichton 4358288600 Fix lines_match test for matching process output 2014-11-05 11:37:34 -08:00
Alex Crichton 87ad4426dd 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!
2014-11-05 11:37:34 -08:00
Pierre Krieger d9066f6eea Tweak tests that check whether the build script is being run 2014-11-05 11:37:34 -08:00
Pierre Krieger f888b4b780 Flags from custom build script are now used 2014-11-05 11:37:34 -08:00
Pierre Krieger 34ace11060 Build command output now being checked and written to filesystem 2014-11-05 11:37:34 -08:00
Pierre Krieger 019d5157c1 Custom build commands are now being run 2014-11-05 11:37:34 -08:00
Pierre Krieger 82e65c30b3 Deprecate old build system and add rust build script as target 2014-11-05 11:37:34 -08:00
Pierre Krieger e3f60a7c99 Extract custom build tests and prefix with "old_" 2014-11-05 11:37:34 -08:00
bors 492bc86063 auto merge of #775 : alexcrichton/cargo/issue-771, r=brson
The examples output directory was accidentally taken into account twice, and
this removes one source of the output directory confusion.

Closes #771
2014-10-31 22:14:45 +00:00
bors 55d79ae875 auto merge of #774 : alexcrichton/cargo/issue-740, r=brson
Closes #740
2014-10-31 21:29:46 +00:00
bors fd44d93464 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.
2014-10-31 20:44:47 +00:00
Alex Crichton bdb496688f Update to rust master 2014-10-31 09:37:44 -07:00
bors 7e7834109e auto merge of #735 : tomaka/cargo/platform-specific-deps, r=alexcrichton
cc #610
2014-10-30 23:29:53 +00:00
Alex Crichton efb36f51ba Update deps with fail => panic
Also fix a few test's assertion messages
2014-10-30 08:48:32 -07:00
Steve Klabnik 33c6edba07 fail -> panic 2014-10-29 21:59:06 -04:00
Alex Crichton 333af13610 Check USERNAME for a users's name with cargo new
Closes #740
2014-10-29 17:29:19 -07:00
Alex Crichton d188fcc9d1 Fix a repeated cargo test with examples
The examples output directory was accidentally taken into account twice, and
this removes one source of the output directory confusion.
2014-10-29 16:49:59 -07:00
Alex Crichton ce14ff2f77 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.
2014-10-29 11:50:24 -07:00