Commit graph

2043 commits

Author SHA1 Message Date
Alex Crichton 81ecf8bd82 Update the Rust snapshot used
At least one important I/O related perf fix has landed on nightly (reading
`DT_DIR` for `DirEntry::file_type`) and there are a few other assorted bug fixes
which are being picked up.
2015-06-02 18:05:47 -07:00
Alex Crichton 7d49029a1c Switch from a custom MTime to the filetime crate
The crate provides the same functionality necessary for Cargo, but it's
maintained elsewhere now.
2015-06-02 18:05:47 -07:00
Alex Crichton 450e81d800 Don't recurse so often in the dependency graph
Prior to this commit the entire dependency tree would be traversed many, many
times as the short circuits weren't applying fast enough. This commit modifies
the recursion to only happen if the target in question was actually compiled.

This commit saw a noop build time for Servo drop from 4.5s to 2.5s.
2015-06-02 18:05:47 -07:00
Alex Crichton 7762289269 Implement caching among fingerprint resolutions
This commit adds support for caching the resolved value of a fingerprint among
calls to `resolve`. Due to the recursive nature of a fingerprint, it means that
`resolve` is currently executed a very large number of times for packages which
at transitively dependend up on many times. By caching the returned value of a
fingerprint we're able to prevent extraneous calls into the filesystem or
extraneous hashing.

This also adds an `Arc` to share a `Fingerprint` among all its dependencies as
each fingerprint stores a list of fingerprints that it depends on, and if
they're not shared then the cache isn't exactly the most helpful!

For a noop `cargo build` on Servo (e.g. everything was already built), this
decreased Cargo's runtime from 5s to ~4.5s
2015-06-02 18:05:47 -07:00
root 877a85efe6 Fix erronous cfg directive 2015-06-02 23:06:52 +02:00
bors 34a52a4468 Auto merge of #1674 - wca:add-freebsd-snapshot, r=alexcrichton
This branch includes a change to dl-snapshot.py that makes it less directly linked to the format of snapshots.txt, and also adds an initial FreeBSD x86_64 cargo snapshot.  The original URL for my snapshot is:

http://people.freebsd.org/~will/public_distfiles/cargo-nightly-x86_64-unknown-freebsd.tar.gz

SHA256: de678e858de5d2923cc206b7aa1cc84ddc67be00748160f66fc9b7325409e7c7
2015-06-02 21:00:35 +00:00
Will Andrews 400c0339d1 Restore the original triple split. 2015-06-02 14:40:37 -06:00
bors bc40ad7b14 Auto merge of #1664 - IvanUkhov:is-dir, r=alexcrichton
The pull request addresses issue #1663. The problem is that `libgit2` [combines][1] `S_IFDIR ` with `S_IFLNK`, and, therefore, the [strict comparison][2] based on `S_ISDIR` rejects directories.


Regards,
Ivan

[1]: 47f3740025/src/index.c (L308)
[2]: 06dbe6555a/src/cargo/sources/path.rs (L150)
2015-06-02 20:38:40 +00:00
Will Andrews ffa9a68f73 Add initial FreeBSD x86_64 cargo snapshot. 2015-06-02 14:01:35 -06:00
Will Andrews d3f590f59f Make fewer assumptions about snapshots.txt format.
- Read the file into a nested dictionary instead of variables.
- Only apply special cases where they are really needed.
- Apply a transform to the triple argument to get the platform name to
  determine whether there is a snapshot available for it.
- Apply a similar (but slightly different) transform to get the snapshot's
  file name.  It would be better if the file name matched the platform name
  in snapshots.txt, but it's too late for that now (older versions of this
  script will certainly expect the existing name format).
2015-06-02 14:01:35 -06:00
root f8e02317db shell_escape: Only add quotes if it contains spaces 2015-06-02 20:24:43 +02:00
Ivan Ukhov 632780ebef Fix the detection of directories when listing files using libgit2 2015-06-02 10:55:04 -04:00
Ivan Ukhov 036d6f6d16 tests: add a test for submodule packaging 2015-06-02 10:55:00 -04:00
root 04f1c1bdbf Shell Escape for Windows
With great help from @retep998
2015-06-02 16:11:12 +02:00
Ivan Ukhov 32dae0bb37 tests: move Git-related routines to support 2015-06-02 10:00:32 -04:00
root caef41000f Update for windows (WIP) 2015-06-02 15:21:34 +02:00
root 6e05b3b042 Also escape spaces in shell_escape 2015-06-02 15:21:34 +02:00
root cd58dd28c5 Shell escape process arguments that are printed out
cargo build --verbose does output some command lines that cannot be
simply copy and pasted into the shell again. The problem is the
arguments which are output exactly like this: --feature="foo"

When pasted back into the shell, the shell will parse and remove the
double quotes. To counteract this, escape special shell characters when
printing commandlines. Cargo will print --feature=\"foo\" instead, which
can be pasted back into the shell.
2015-06-02 15:21:34 +02:00
bors e91865c19a Auto merge of #1671 - alexcrichton:osx-more-robust, r=huonw
Tests are often flaky because the resolution of the OSX filesystem timestamps
appears to be 1s, so we often have to manually sleep for 1s to ensure that
enough time has passed to guarantee that the timestamp is different (used in
freshness calculations).
2015-06-02 02:32:13 +00:00
Alex Crichton 8086ab40d5 Make a freshness test more robust on OSX
Tests are often flaky because the resolution of the OSX filesystem timestamps
appears to be 1s, so we often have to manually sleep for 1s to ensure that
enough time has passed to guarantee that the timestamp is different (used in
freshness calculations).
2015-06-01 18:24:57 -07:00
bors 06dbe6555a Auto merge of #1656 - EduardoBautista:cargo-home-absolute-path, r=alexcrichton
OK, this should fix https://github.com/rust-lang/cargo/issues/1655.  It worked on my local.  I am not entirely sure how to write a test for this.  Can I get some help and be pointed in the right direction?
2015-05-29 05:54:27 +00:00
bors bedfde0b9c Auto merge of #1659 - alexcrichton:shorten-paths-on-windows, r=alexcrichton
Unfortunately paths are getting a little too long on Windows and libgit2 is
given us back the error:

      Failed to rename lockfile to 'C:/bot/slave/nightly-dist-cargo-win-gnu-64-64/build/target/x86_64-pc-windows-gnu/debug/cit/test-155/home/.cargo/git/checkouts/meta-dep-27104ee87001fd00/08c585f6f3927118da012a2d682b67a789c35211/.git/objects/pack/pack-ba5fd201f4c1be9792e6d54eef194e6b733ae719.idx': The data area passed to a system call is too small.

Windows isn't always the best at handling long paths, so this commit changes the
location of the `cit` output directory where tests are located as well as
shortening the name of each test's folder to hopefully get the folder sizes a
little under the limit.

I believe this test is only failing on the nightly bots because the folder name
for the nightly bots is longer than the folder name for the auto bots. Hurray!
2015-05-29 00:08:40 +00:00
Alex Crichton ef13d35b08 Shorten paths in the test runner for windows
Unfortunately paths are getting a little too long on Windows and libgit2 is
given us back the error:

      Failed to rename lockfile to 'C:/bot/slave/nightly-dist-cargo-win-gnu-64-64/build/target/x86_64-pc-windows-gnu/debug/cit/test-155/home/.cargo/git/checkouts/meta-dep-27104ee87001fd00/08c585f6f3927118da012a2d682b67a789c35211/.git/objects/pack/pack-ba5fd201f4c1be9792e6d54eef194e6b733ae719.idx': The data area passed to a system call is too small.

Windows isn't always the best at handling long paths, so this commit changes the
location of the `cit` output directory where tests are located as well as
shortening the name of each test's folder to hopefully get the folder sizes a
little under the limit.

I believe this test is only failing on the nightly bots because the folder name
for the nightly bots is longer than the folder name for the auto bots. Hurray!
2015-05-28 17:06:25 -07:00
Eduardo Bautista f8b91b577b Use absolute path for CARGO_HOME 2015-05-28 18:34:50 -05:00
bors 9a09446474 Auto merge of #1658 - alexcrichton:debug-windows, r=alexcrichton
This test is failing on the win64 bot, and I'm not 100% sure why, so trying to
get some more info out of it.
2015-05-28 22:59:10 +00:00
Alex Crichton 7d73487e5a Try to debug a failing test on the windows bots
This test is failing on the win64 bot, and I'm not 100% sure why, so trying to
get some more info out of it.
2015-05-28 15:56:42 -07:00
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
Alex Crichton 655c40be25 Bump Cargo.toml's version to 0.3.0 2015-05-28 15:39:03 -07:00
bors de903c7739 Auto merge of #1653 - alexcrichton:update-tar, r=alexcrichton
Fixes some extraction bugs when unpacking archives.
2015-05-27 20:14:08 +00:00
bors 727e7ce2cd Auto merge of #1654 - alexcrichton:udpate-ssh2-sys, r=alexcrichton
The bots are trying to build something which isn't needed and is failing on
nightlies, so the build script has been updated to not bulid this unnecessary
artifact as part of libssh2
2015-05-27 19:35:25 +00:00
bors 8fa3aaf697 Auto merge of #1642 - alexcrichton:opt-fs, r=huonw
Traversing large directory trees can take quite some time, and this commit optimizes a few locations to reduce the number of calls to `fs::metadata`.
2015-05-27 19:16:14 +00:00
bors cd46b343a6 Auto merge of #1641 - alexcrichton:update-less, r=brson
Updating a path source can be a possibly expensive operation (lots of
directories that need to be traversed), and currently the root path source is
updated three times:

* Once when the root package is initially loaded.
* Again when the first resolution pass happens over a graph.
* Finally a third when the second resolution pass happens over the graph.

This commit pushes through the original `Source` trait object into the
`PackageRegistry` and removes the implicit call to `add_sources`, pushing that
call up to the stack a bit.
2015-05-27 19:03:50 +00:00
bors 00016d6210 Auto merge of #1639 - jimmycuadra:jobs-flag-docs, r=wycats
Addresses #1591.

I believe this issue only affects `cargo bench` and `cargo test`. If it's applicable to any of the other commands, let me know and I'll amend this.
2015-05-27 18:51:59 +00:00
bors 463a5fa539 Auto merge of #1637 - dhuseby:bitrig_snapshot, r=alexcrichton
adds the bitrig cargo snapshot.  d/l the tarball from here: http://blog.linuxprogrammer.org/cargo-nightly-x86_64-unknown-bitrig.tar.gz
2015-05-27 18:41:28 +00:00
Alex Crichton b98344935d Update libssh2-sys's build script
The bots are trying to build something which isn't needed and is failing on
nightlies, so the build script has been updated to not bulid this unnecessary
artifact as part of libssh2
2015-05-27 11:31:33 -07:00
bors 980d7cf94e Auto merge of #1617 - alexcrichton:fix-kind-after-the-fact, r=brson
The wrong kind was mistakenly used in the case of having a dependency on a
plugin.

Unfortunately I don't know of a great way to test this, so no unit test is included for now.

Closes #1612
2015-05-27 18:29:48 +00:00
bors 6c86f13312 Auto merge of #1651 - Roysten:master, r=alexcrichton 2015-05-26 20:05:48 +00:00
Roy van der Vegt "platypus 284c0ef974 fix name escaping issue in Cargo.toml (#1635) and added corresponding
test
2015-05-26 21:42:10 +02:00
Alex Crichton c111410791 Update the tar-rs dependency
Fixes some extraction bugs when unpacking archives.
2015-05-26 10:16:41 -07:00
Brian Anderson 3090cc3151 Merge pull request #1640 from alexcrichton/fix-rel-config
Fix a relative `rustc` spec to .cargo/config
2015-05-21 20:01:39 -07:00
Alex Crichton 046a6c59e9 Reduce calls to fs::metadata in list_git_files
When walking over entries in the index of a git repository the file type can be
known without a syscall (in the form of a libc constant), but walking over
untracked files still requires a syscall to determine if it's a directory.
2015-05-19 23:07:15 -07:00
Alex Crichton e595e87762 Optimize the number of calls to fs::metadata
When iterating over `DirEntry` values the file type of the entry can typically
be determined without a syscall, so use the new unstable APIs in `std::fs` to
avoid an extra call to `fs::metadata`. When traversing large directory trees the
improvement is quite noticeable!
2015-05-19 23:04:47 -07:00
Alex Crichton ef8c651af1 Don't update the same path source multiple times
Updating a path source can be a possibly expensive operation (lots of
directories that need to be traversed), and currently the root path source is
updated three times:

* Once when the root package is initially loaded.
* Again when the first resolution pass happens over a graph.
* Finally a third when the second resolution pass happens over the graph.

This commit pushes through the original `Source` trait object into the
`PackageRegistry` and removes the implicit call to `add_sources`, pushing that
call up to the stack a bit.
2015-05-19 22:57:37 -07:00
Alex Crichton 081065d369 Fix a relative rustc spec to .cargo/config
The paths were mistakenly relative to .cargo/config, not the directory
containing .cargo/config
2015-05-19 21:43:41 -07:00
Jimmy Cuadra 07df28e8e1 Clarify that --jobs doesn't affect parallelism when running the resulting binary. 2015-05-19 21:06:24 -07:00
Dave Huseby f96f0ba654 oops forgot to grab the bitrig line 2015-05-19 15:38:10 -07:00
Dave Huseby d31bd78be3 updating snapshot scripts to support bitrig 2015-05-19 15:36:13 -07:00
Dave Huseby 3474a1a78b adding bitrig cargo snapshot 2015-05-19 15:06:28 -07:00
bors a1778efa74 Auto merge of #1629 - alexcrichton:env-rustc, r=alexcrichton
These commits add two vectors through which the compiler run can be configured:

* A `RUSTC` environment variable
* A `build.rustc` configuration variable in a `.cargo/config` file
2015-05-19 04:13:45 +00:00
Alex Crichton 8a8ea1e89e Add rustc/rustdoc config keys to Cargo config
In addition to global RUSTC/RUSTDOC env vars, this commit recognizes
`build.rustc` and `build.rustdoc` as configuration keys for Cargo to instruct
what tools should be used instead of the default.

Closes #967
2015-05-18 21:11:51 -07:00