- The new tests verifies that the extra arguments gets appended to the command. One is for lib and one is for main
- Currently the arguments gets passed on to *every* target that gets built, so the tests only contain one file each
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.
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.
Closes#1560
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.
Closes#1560
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.
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.
Closes#1484
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.
Closes#1478
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.
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.
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.
Closes#1484
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.
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.
Closes#1532
`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>`.
Fixes#741.
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 = []
`src/main.rs`:
pub fn main() {
println!("Hello, world!");
}
EDIT: I should add that this should fix#1472