Auto merge of #1566 - alexcrichton:fix-transitive-update-dash-p, r=brson
Currently when a dependency is transitively updated the source may not itself be
updated, so an update may not happen at all. This commit modifies this behavior
to be sure to add the non-updated source to the registry for any matching
package which will trigger the source to update itself.
Auto merge of #1564 - alexcrichton:right-timeout, r=brson
Previously a timeout was set via libcurl's blanket timeout option, which is a
timeout for the entire request. This isn't always what we want, however, as
cargo is used on quite a variety of networks. Instead what we really want is
timing out data being received, so instead of a blanket timeout we set two
different timeouts:
* The connect timeout is now configured (time it takes to connect the socket)
* A "low speed" timeout is now also set. This means that if Cargo doesn't
receive 10 bytes of data in the specified tiemout period that the entire
transfer will be timed out.
Alex Crichton [Wed, 29 Apr 2015 18:58:13 +0000 (11:58 -0700)]
Tweak the meaning of HTTP timeouts
Previously a timeout was set via libcurl's blanket timeout option, which is a
timeout for the entire request. This isn't always what we want, however, as
cargo is used on quite a variety of networks. Instead what we really want is
timing out data being received, so instead of a blanket timeout we set two
different timeouts:
* The connect timeout is now configured (time it takes to connect the socket)
* A "low speed" timeout is now also set. This means that if Cargo doesn't
receive 10 bytes of data in the specified tiemout period that the entire
transfer will be timed out.
Alex Crichton [Thu, 30 Apr 2015 01:42:52 +0000 (18:42 -0700)]
Fix transitively updating dependencies
Currently when a dependency is transitively updated the source may not itself be
updated, so an update may not happen at all. This commit modifies this behavior
to be sure to add the non-updated source to the registry for any matching
package which will trigger the source to update itself.
Auto merge of #1558 - alexcrichton:less-hashes, r=brson
The root crate often has artifacts which are later intended for distribution of
some form, so adding a hash will just make predicting the file name difficult.
The hash also isn't necessary as it's guaranteed to not conflict with other
files (no other dependencies are in the same directory) and all other libraries
have metadata so symbols will not conflict.
Auto merge of #1505 - alexcrichton:issue-1478, r=brson
This commit enables the build script for a crate to provide feedback to the
crate itself about how it should be built. This is done through the `--cfg`
flags of the compiler, and each build script is now allowed to print `rustc-cfg`
directives to inform Cargo about what `--cfg` flags it should pass.
All `--cfg` flags are local to the current crate and are not propagated outwards
to transitive dependencies. The primary use-case that this feature is targeting
is compile-time feature detection for applications like C bindings or C
libraries where the version being targeted may change over time.
Auto merge of #1557 - alexcrichton:exhaustive, r=brson
This commit fills out the functionality of `--lib`, `--test`, `--bin`,
`--bench`, and `--example` for the `cargo {test,build,bench}` commands all at
once. The support for all of this was introduced long ago, and the flags just
weren't exposed at the time.
Alex Crichton [Wed, 29 Apr 2015 18:30:20 +0000 (11:30 -0700)]
Relax the test for ar/linker with plugins
On windows it won't actually succeed or get past the first compile with cc/ar,
so just set it to something that for sure won't exist so it doesn't progress on
*any* platform.
Alex Crichton [Wed, 29 Apr 2015 17:12:23 +0000 (10:12 -0700)]
Don't put hashes in libraries of the root crate
The root crate often has artifacts which are later intended for distribution of
some form, so adding a hash will just make predicting the file name difficult.
The hash also isn't necessary as it's guaranteed to not conflict with other
files (no other dependencies are in the same directory) and all other libraries
have metadata so symbols will not conflict.
Alex Crichton [Wed, 29 Apr 2015 16:42:29 +0000 (09:42 -0700)]
Allow more advanced filtering of what to build
This commit fills out the functionality of `--lib`, `--test`, `--bin`,
`--bench`, and `--example` for the `cargo {test,build,bench}` commands all at
once. The support for all of this was introduced long ago, and the flags just
weren't exposed at the time.
Auto merge of #1540 - lfairy:strip-affixes, r=alexcrichton
If the user invokes `cargo new` with a name of the form `rust-foo` or `foo-rs` (or any variation of the two), and the `--bin` option is *not* present, then the resulting `Cargo.toml` will have a `name` field of just `foo` instead.
Auto merge of #1535 - mohtar:doc-open, r=alexcrichton
`start` is not an actual executable, but rather a built-in command in Command Prompt. The correct way of launching a file using the default application is thus: `cmd /C start "" <file>`.
Since #318, the `doc` command generates documentation for binaries in addition to libraries. But currently running `cargo doc --open` would not launch the browser for binary-only packages, even though it should. This commit changes the logic: binaries will be searched when there are no libraries in the package.
A simple test case:
`Cargo.toml`:
[package]
name = "foo"
version = "0.1.0"
authors = []
Alex Crichton [Thu, 9 Apr 2015 21:35:48 +0000 (14:35 -0700)]
Allow build script feedback to the crate compiled
This commit enables the build script for a crate to provide feedback to the
crate itself about how it should be built. This is done through the `--cfg`
flags of the compiler, and each build script is now allowed to print `rustc-cfg`
directives to inform Cargo about what `--cfg` flags it should pass.
All `--cfg` flags are local to the current crate and are not propagated outwards
to transitive dependencies. The primary use-case that this feature is targeting
is compile-time feature detection for applications like C bindings or C
libraries where the version being targeted may change over time.
Auto merge of #1519 - alfiedotwtf:master, r=alexcrichton
Currently getting:
note: /usr/bin/ld: /home/alfie/tmp/test/target/debug/build/test-39af07f97c17512a/out/libhello.a(hello.o):
relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
Alfie John [Mon, 13 Apr 2015 12:36:32 +0000 (22:36 +1000)]
docs: fix shared library compilation error
Currently getting:
note: /usr/bin/ld: /home/alfie/tmp/test/target/debug/build/test-39af07f97c17512a/out/libhello.a(hello.o):
relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
Auto merge of #1507 - jimmycuadra:cargo-new-semver, r=alexcrichton
This patch updates the initial version of packages generated with `cargo new` to 0.1.0 (rather than 0.0.1), which better follows SemVer. The docs are also updated to show examples that follow this convention.
For reference, the same change was recently made in Bundler for the Ruby ecosystem: bundler/bundler#3322
Auto merge of #1475 - alexcrichton:update, r=huonw
Along the way, this also removes the ability to specify `[[lib]]` targets while
getting warnings. While we're at it remove nearly all unstable features that
Cargo is depending on as well!
Auto merge of #1452 - alexcrichton:issue-1355, r=huonw
The hashes would occasionally disappear when the main package registry overwrote
a previous registry source, so this just adds logic to load hashes if they're
missing.
Alex Crichton [Thu, 2 Apr 2015 18:12:21 +0000 (11:12 -0700)]
Update to rust-2015-04-02
Along the way, this also removes the ability to specify `[[lib]]` targets while
getting warnings. While we're at it remove nearly all unstable features that
Cargo is depending on as well!
bors [Tue, 31 Mar 2015 17:07:38 +0000 (17:07 +0000)]
Auto merge of #1455 - alexcrichton:issue-1449, r=brson
Previously --extern was passed for *all* upstream dependencies, causing
conflicts if some had duplicate names. Now cargo only passes --extern for
libraries that were built including immediate dependencies. Cargo also
additionally now properly passes `-L dependency=` instead of just a plain `-L`.
Alex Crichton [Wed, 25 Mar 2015 19:46:21 +0000 (12:46 -0700)]
Fix passing --extern and -L to doc tests
Previously --extern was passed for *all* upstream dependencies, causing
conflicts if some had duplicate names. Now cargo only passes --extern for
libraries that were built including immediate dependencies. Cargo also
additionally now properly passes `-L dependency=` instead of just a plain `-L`.