]> git.proxmox.com Git - cargo.git/log
cargo.git
4 years agoRun rustfmt
Alex Crichton [Thu, 3 Oct 2019 19:18:48 +0000 (12:18 -0700)]
Run rustfmt

4 years agoHandle rebase conflicts
Alex Crichton [Thu, 3 Oct 2019 19:17:18 +0000 (12:17 -0700)]
Handle rebase conflicts

4 years agoSimplify `cargo-new` configuration reading
Alex Crichton [Fri, 27 Sep 2019 21:24:15 +0000 (14:24 -0700)]
Simplify `cargo-new` configuration reading

No need for lots of extra helpers/parsing when using serde!

4 years agoConsolidate `build` key configuration
Alex Crichton [Fri, 27 Sep 2019 21:19:48 +0000 (14:19 -0700)]
Consolidate `build` key configuration

Add a typed structure which lists all `build` key configuration
throughout Cargo.

4 years agoRemove dead `Config::get_i64` method
Alex Crichton [Fri, 27 Sep 2019 20:02:50 +0000 (13:02 -0700)]
Remove dead `Config::get_i64` method

4 years agoRemove no-longer-needed `Config::get_bool`
Alex Crichton [Fri, 27 Sep 2019 20:01:25 +0000 (13:01 -0700)]
Remove no-longer-needed `Config::get_bool`

4 years agoConsolidate `net` configuration into a typed structure
Alex Crichton [Fri, 27 Sep 2019 20:00:53 +0000 (13:00 -0700)]
Consolidate `net` configuration into a typed structure

Less need for `get_bool` and friends!

4 years agoAccess `term` config through a deserialized type
Alex Crichton [Fri, 27 Sep 2019 19:55:46 +0000 (12:55 -0700)]
Access `term` config through a deserialized type

Going through and removing users of raw `get_*` functions!

4 years agoCentralize HTTP configuration in one struct
Alex Crichton [Fri, 27 Sep 2019 19:51:44 +0000 (12:51 -0700)]
Centralize HTTP configuration in one struct

Gives us one nice place to access and document all HTTP-related configuration

4 years agoRemove a usage of `get_list`
Alex Crichton [Fri, 27 Sep 2019 19:33:28 +0000 (12:33 -0700)]
Remove a usage of `get_list`

This callsite doesn't need the full power of `get_list`, knowing the
definition path of each element along the list.

4 years agoFinish implementing `Value`, use it in helpers
Alex Crichton [Fri, 27 Sep 2019 19:29:01 +0000 (12:29 -0700)]
Finish implementing `Value`, use it in helpers

Rewrite helpers like `get_bool` to use `get::<Option<Value<bool>>>`
instead of duplicating the logic that's already with the typed access of
configuration. This is more along the effort to centralize all
deserialization of configuration into typed values instead of using
ad-hoc accessors in a number of locations.

4 years agoRefactor `ConfigKey` to its own file
Alex Crichton [Fri, 27 Sep 2019 18:34:29 +0000 (11:34 -0700)]
Refactor `ConfigKey` to its own file

Also make it a little less allocation-heavy by tweaking the API to
encourage incremental building of the key and incremental destruction as
we walk throughout the configuration tree.

4 years agoExtra serde config support to a separate file
Alex Crichton [Thu, 26 Sep 2019 21:09:17 +0000 (14:09 -0700)]
Extra serde config support to a separate file

4 years agoMove `config.rs` to `config/mod.rs`
Alex Crichton [Thu, 26 Sep 2019 20:59:05 +0000 (13:59 -0700)]
Move `config.rs` to `config/mod.rs`

4 years agoAuto merge of #7484 - ehuss:clippy-fixes, r=alexcrichton
bors [Mon, 7 Oct 2019 23:29:59 +0000 (23:29 +0000)]
Auto merge of #7484 - ehuss:clippy-fixes, r=alexcrichton

Some minor clippy fixes.

4 years agoSome minor clippy fixes.
Eric Huss [Fri, 4 Oct 2019 21:21:28 +0000 (14:21 -0700)]
Some minor clippy fixes.

4 years agoAuto merge of #7481 - Lythenas:doc-spdx-list-3.6, r=ehuss
bors [Fri, 4 Oct 2019 17:36:12 +0000 (17:36 +0000)]
Auto merge of #7481 - Lythenas:doc-spdx-list-3.6, r=ehuss

Update SPDX list to 3.6

Fixes #7477

4 years agoAuto merge of #7482 - alexcrichton:fix-bin, r=ehuss
bors [Fri, 4 Oct 2019 17:07:14 +0000 (17:07 +0000)]
Auto merge of #7482 - alexcrichton:fix-bin, r=ehuss

Fix wrong directories in PATH on Windows

This fixes an accidental regression from #7425 where `PATH` was being
augmented on Windows with the wrong search path for target/host
libraries. This commit fixes the issue by simply always calculating the
host/target library paths for `TargetInfo`, and then we explicitly use
the same `TargetInfo` for filling out information in `Compilation`.

Closes #7475

4 years agoFix wrong directories in PATH on Windows
Alex Crichton [Fri, 4 Oct 2019 15:04:48 +0000 (08:04 -0700)]
Fix wrong directories in PATH on Windows

This fixes an accidental regression from #7425 where `PATH` was being
augmented on Windows with the wrong search path for target/host
libraries. This commit fixes the issue by simply always calculating the
host/target library paths for `TargetInfo`, and then we explicitly use
the same `TargetInfo` for filling out information in `Compilation`.

Closes #7475

4 years agoAuto merge of #7476 - tlively:emscripten-wasm-aux, r=alexcrichton
bors [Fri, 4 Oct 2019 14:50:53 +0000 (14:50 +0000)]
Auto merge of #7476 - tlively:emscripten-wasm-aux, r=alexcrichton

Mark Emscripten's .wasm files auxiliary

This fixes #7471 and fixes #7255 by preventing the .wasm file from
being treated as an executable binary, so `cargo test` and `cargo run`
will no longer try to execute it directly. This change is only made
for Emscripten, which outputs a .js file as the primary executable
entry point, as opposed to other WebAssembly targets for which the
.wasm file is the only output.

4 years agoUpdate SPDX list to 3.6
Matthias Seiffert [Fri, 4 Oct 2019 13:59:40 +0000 (15:59 +0200)]
Update SPDX list to 3.6

4 years agoDrop unnecessary target check
Thomas Lively [Fri, 4 Oct 2019 01:06:00 +0000 (18:06 -0700)]
Drop unnecessary target check

4 years agorustfmt, even if I disagree
Thomas Lively [Thu, 3 Oct 2019 23:57:30 +0000 (16:57 -0700)]
rustfmt, even if I disagree

4 years agoMark Emscripten's .wasm files auxiliary
Thomas Lively [Thu, 3 Oct 2019 23:42:23 +0000 (16:42 -0700)]
Mark Emscripten's .wasm files auxiliary

This fixes #7471 and fixes #7255 by preventing the .wasm file from
being treated as an executable binary, so `cargo test` and `cargo run`
will no longer try to execute it directly. This change is only made
for emscripten, which outputs a .js file as the primary executable
entry point, as opposed to other WebAssembly targets for which the
.wasm file is the only output.

4 years agoAuto merge of #7464 - alexcrichton:update-curl-sys, r=ehuss
bors [Wed, 2 Oct 2019 17:55:29 +0000 (17:55 +0000)]
Auto merge of #7464 - alexcrichton:update-curl-sys, r=ehuss

Update `curl-sys` dependency requirement

Pulls in alexcrichton/curl-rust#304 which fixes a bug from the last curl
update in #7308. This bug was not introduced by the Cargo PR itself but
rather by updating the `curl` submodule in the `curl-sys` crate. Without
this bugfix all downloads of a crate will make a new connection to
crates.io, which drastically increases download time since setting up a
connection takes so long.

4 years agoAuto merge of #7443 - guanqun:patch-1, r=ehuss
bors [Wed, 2 Oct 2019 17:31:03 +0000 (17:31 +0000)]
Auto merge of #7443 - guanqun:patch-1, r=ehuss

add dependencies for `pkg-config`

Otherwise, it complains:

    run pkg_config fail: "Failed to run `\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"`: No such file or directory (os error 2)"

4 years agoAuto merge of #7400 - snf:fix_7358, r=alexcrichton
bors [Wed, 2 Oct 2019 15:55:23 +0000 (15:55 +0000)]
Auto merge of #7400 - snf:fix_7358, r=alexcrichton

Removing hash from output files when using MSVC

This is the fix for https://github.com/rust-lang/cargo/issues/7358 suggested by @alexcrichton . Tested and working.

I see a few tests failling but seem unrelated. I'll investigate them tomorrow.

4 years agoAuto merge of #7465 - alexcrichton:no-preserve, r=Eh2406
bors [Wed, 2 Oct 2019 15:31:58 +0000 (15:31 +0000)]
Auto merge of #7465 - alexcrichton:no-preserve, r=Eh2406

Disable preserving mtimes on archives

These are just wasted syscalls for our purposes, no need to issue
updates to the modification/creation/access times of files we unpack!

4 years agoremoving hash from output files when using MSVC
snf [Sat, 21 Sep 2019 01:38:24 +0000 (22:38 -0300)]
removing hash from output files when using MSVC

4 years agoDisable preserving mtimes on archives
Alex Crichton [Tue, 1 Oct 2019 21:39:13 +0000 (14:39 -0700)]
Disable preserving mtimes on archives

These are just wasted syscalls for our purposes, no need to issue
updates to the modification/creation/access times of files we unpack!

4 years agoUpdate `curl-sys` dependency requirement
Alex Crichton [Tue, 1 Oct 2019 21:36:04 +0000 (14:36 -0700)]
Update `curl-sys` dependency requirement

Pulls in alexcrichton/curl-rust#304 which fixes a bug from the last curl
update in #7308. This bug was not introduced by the Cargo PR itself but
rather by updating the `curl` submodule in the `curl-sys` crate. Without
this bugfix all downloads of a crate will make a new connection to
crates.io, which drastically increases download time since setting up a
connection takes so long.

4 years agoAuto merge of #7462 - hbina:redundant_borrow, r=ehuss
bors [Tue, 1 Oct 2019 20:35:54 +0000 (20:35 +0000)]
Auto merge of #7462 - hbina:redundant_borrow, r=ehuss

Removed redundant borrow

As described here https://rust-lang.github.io/rust-clippy/master/#needless_borrow.
rust-clippy is complaining that the related borrows are unnecessary.

4 years agoAuto merge of #7361 - Eh2406:public_dependency-as-type_4, r=alexcrichton
bors [Tue, 1 Oct 2019 19:01:47 +0000 (19:01 +0000)]
Auto merge of #7361 - Eh2406:public_dependency-as-type_4, r=alexcrichton

Public dependency refactor and re-allow backjumping

There were **three** attempts at vanquishing exponential time spent in Public dependency resolution. All failures. All three started with some refactoring that seams worth saving. Specifically the data structure `public_dependency` that is used to test for Public dependency conflicts is large, tricky, and modified in line. So lets make it a type with a name and move the interactions into methods.

Next each attempt needed to know how far back to jump to undo any given dependency edge. I am fairly confident that any full solution will need this functionality. I also think any solution will need a way to represent richer conflicts than the existing "is this pid active". So let's keep the `still_applies` structure from the last attempt.

Last each attempt needs to pick a way to represent a Public dependency conflict. The last attempt used three facts about a situation.

- `a1`: `PublicDependency(p)` witch can be read as the package `p` can see the package `a1`
- `b`: `PublicDependency(p)` witch can be read as the package `p` can see the package `b`
- `a2`: `PubliclyExports(b)` witch can be read as the package `b` has the package `a2` in its publick interface.

This representation is good enough to allow for `backjumping`. I.E. `find_candidate` can go back several frames until the `age` when the Public dependency conflict was introduced. This optimization, added for normal dependencies in #4834, saves the most time in practice. So having it for Public dependency conflicts is important for allowing real world experimentation of the Public dependencies feature.  We will have to alter/improve/replace this representation to unlock all of the important optimizations. But I don't know one that will work for all of them and this is a major step forward.

Can be read one commit at a time.

4 years agoRemoved redundant borrow
Hanif Bin Ariffin [Tue, 1 Oct 2019 18:16:58 +0000 (14:16 -0400)]
Removed redundant borrow

As described here https://rust-lang.github.io/rust-clippy/master/#needless_borrow.
rust-clippy is complaining that the related borrows are unnecessary.

4 years agoAuto merge of #7461 - guanqun:unify-quotes-in-cargo-toml, r=alexcrichton
bors [Tue, 1 Oct 2019 13:06:40 +0000 (13:06 +0000)]
Auto merge of #7461 - guanqun:unify-quotes-in-cargo-toml, r=alexcrichton

unify the quote in Cargo.toml

A bit nit-picked...

It tries to use double-quotes in Cargo.toml instead of single quote, that would be more uniform in this file.

4 years agounify the quote in Cargo.toml
Guanqun Lu [Tue, 1 Oct 2019 07:39:57 +0000 (15:39 +0800)]
unify the quote in Cargo.toml

4 years agoAuto merge of #6989 - da-x:custom-profile-pr-rfc, r=ehuss
bors [Mon, 30 Sep 2019 19:51:19 +0000 (19:51 +0000)]
Auto merge of #6989 - da-x:custom-profile-pr-rfc, r=ehuss

Support for named profiles (RFC 2678)

Tracking issue: https://github.com/rust-lang/cargo/issues/6988

Implementation according to the [RFC](https://github.com/rust-lang/rfcs/blob/master/text/2678-named-custom-cargo-profiles.md).

4 years agoAuto merge of #7308 - guanqun:add-ssl-version, r=alexcrichton
bors [Mon, 30 Sep 2019 18:35:21 +0000 (18:35 +0000)]
Auto merge of #7308 - guanqun:add-ssl-version, r=alexcrichton

add an option to specify ssl version

Fixes #6684

4 years agoadd a bit more docs
Guanqun Lu [Mon, 30 Sep 2019 16:05:23 +0000 (00:05 +0800)]
add a bit more docs

4 years agorun cargo fmt to pass the CI build
Guanqun Lu [Mon, 30 Sep 2019 15:48:08 +0000 (23:48 +0800)]
run cargo fmt to pass the CI build

4 years agoAuto merge of #7417 - alexcrichton:less-hashing, r=Eh2406
bors [Mon, 30 Sep 2019 14:57:58 +0000 (14:57 +0000)]
Auto merge of #7417 - alexcrichton:less-hashing, r=Eh2406

Go back to not hashing `RUSTFLAGS` in `-Cmetadata`

This is a moral revert of #6503 but not a literal code revert. This
switches Cargo's behavior to avoid hashing compiler flags into
`-Cmetadata` since we've now had multiple requests of excluding flags
from the `-Cmetadata` hash: usage of `--remap-path-prefix` and PGO
options. These options should only affect how the compiler is
invoked/compiled and not radical changes such as symbol names, but
symbol names are changed based on `-Cmetadata`. Instead Cargo will still
track these flags internally, but only for reinvoking rustc, and not for
caching separately based on rustc flags.

Closes #7416

4 years agofixes
Guanqun Lu [Sun, 29 Sep 2019 16:32:57 +0000 (00:32 +0800)]
fixes

4 years agomodify to enum/struct and add test for SslVersionConfig
Guanqun Lu [Sun, 29 Sep 2019 16:29:15 +0000 (00:29 +0800)]
modify to enum/struct and add test for SslVersionConfig

4 years agonamed-profiles: fix backward compatibility for `rustc` with `--profile=check`
Dan Aloni [Fri, 27 Sep 2019 22:10:08 +0000 (01:10 +0300)]
named-profiles: fix backward compatibility for `rustc` with `--profile=check`

And a small cleanup in `base_profile` to make the logic parallel to the
one in `get_profile`.

4 years agoadd a test to show the new performance
Eh2406 [Fri, 13 Sep 2019 19:22:43 +0000 (15:22 -0400)]
add a test to show the new performance

4 years agoallow `find_candidate` to backtrack from a `PublicDependency`
Eh2406 [Tue, 25 Jun 2019 21:28:06 +0000 (17:28 -0400)]
allow `find_candidate` to backtrack from a `PublicDependency`

4 years agochange `PublicDependency` to store the `age` for each edge
Eh2406 [Tue, 28 May 2019 18:40:26 +0000 (14:40 -0400)]
change `PublicDependency` to store the `age` for each edge

4 years agochange `age` to count edges not just activations
Eh2406 [Mon, 27 May 2019 03:55:42 +0000 (23:55 -0400)]
change `age` to count edges not just activations

A pub dep conflict can be made by connecting two already activated pids

4 years agoSome cleanups
Eh2406 [Sun, 26 May 2019 00:02:29 +0000 (20:02 -0400)]
Some cleanups

4 years agomove `public_dependency`s code to methods for better organization
Eh2406 [Fri, 24 May 2019 21:40:38 +0000 (17:40 -0400)]
move `public_dependency`s code to methods for better organization

Note: this commit does not change code, just moves it

4 years agonamed-profiles: add backward compatibility if feature is disabled
Dan Aloni [Fri, 27 Sep 2019 19:28:44 +0000 (22:28 +0300)]
named-profiles: add backward compatibility if feature is disabled

The effects over the profile used by targets are made conditional
in this commit, using the old scheme if the `named-profiles` feature
is disabled. This also affects the `profile_targets` tests, which
now have two modes - stable, and nightly with the feature enabled.

4 years agoAuto merge of #7454 - ehuss:version-bump, r=alexcrichton
bors [Fri, 27 Sep 2019 16:27:16 +0000 (16:27 +0000)]
Auto merge of #7454 - ehuss:version-bump, r=alexcrichton

Bump to 0.41.0, Update changelog

4 years agoBump to 0.41.0, Update changelog
Eric Huss [Fri, 27 Sep 2019 16:02:13 +0000 (09:02 -0700)]
Bump to 0.41.0, Update changelog

4 years agoAuto merge of #7452 - pyrrho:bug7346/transitive_patches, r=Eh2406
bors [Fri, 27 Sep 2019 14:44:25 +0000 (14:44 +0000)]
Auto merge of #7452 - pyrrho:bug7346/transitive_patches, r=Eh2406

Bug7346/transitive patches

Fixes #7346.

A cursory comparison between current stable and nightly shows that projects with this topology resolve similarly. If there are other behaviors I should test, I'd be happy to expand that section. This is a pretty focused change, though, so I'm not sure what else there is to break.

Sorry about the delay in putting this PR together. Good news is I know more than I did last week.

4 years agoAuto merge of #7448 - ehuss:gitignore-lockfile, r=alexcrichton
bors [Fri, 27 Sep 2019 14:18:00 +0000 (14:18 +0000)]
Auto merge of #7448 - ehuss:gitignore-lockfile, r=alexcrichton

Allow gitignore of Cargo.lock with explicit `include`.

If a package has an `include` list, but `Cargo.lock` is in `.gitignore`, then Cargo would complain that `Cargo.lock` is "dirty".  This changes it so that ignored `Cargo.lock` is allowed, even though it is still packaged.  This is under the presumption that `Cargo.lock` is machine generated, so it is not critical.  This was also an unexpected regression.

If you don't have an `include` list, then there is no complaint about `Cargo.lock` being dirty because Cargo uses git to deduce the file list, and `Cargo.lock` would be skipped for the dirty check (but still included in the package).

Closes #7319

4 years agoDon't panic on a non-fatal error
Drew Pirrone-Brusse [Thu, 26 Sep 2019 22:32:49 +0000 (18:32 -0400)]
Don't panic on a non-fatal error

4 years agoModify Context::flag_activated to return ActivateResult
Drew Pirrone-Brusse [Thu, 26 Sep 2019 22:32:28 +0000 (18:32 -0400)]
Modify Context::flag_activated to return ActivateResult

4 years agoAdd a test to model the bug found in #7346
Drew Pirrone-Brusse [Tue, 17 Sep 2019 16:55:12 +0000 (12:55 -0400)]
Add a test to model the bug found in #7346

4 years agoAllow gitignore of Cargo.lock with explicit `include`.
Eric Huss [Thu, 26 Sep 2019 21:55:59 +0000 (14:55 -0700)]
Allow gitignore of Cargo.lock with explicit `include`.

4 years agoAuto merge of #7446 - alexcrichton:quiet-output, r=Eh2406
bors [Thu, 26 Sep 2019 19:03:56 +0000 (19:03 +0000)]
Auto merge of #7446 - alexcrichton:quiet-output, r=Eh2406

Improve test output with `--quiet`

We had a few locations where the shell was written to raw instead of
through the test harness or through other captured mechanisms. This
updates the test suite so testing Cargo with `--quiet` provides a nice
and clean report of tests executed.

4 years agoAuto merge of #7445 - alexcrichton:more-stable, r=Eh2406
bors [Thu, 26 Sep 2019 18:35:26 +0000 (18:35 +0000)]
Auto merge of #7445 - alexcrichton:more-stable, r=Eh2406

Allow a number of tests to run on stable

These tests all relied on support which has now ridden to stable at this
point, so let's let them run on stable!

4 years agoImprove test output with `--quiet`
Alex Crichton [Thu, 26 Sep 2019 18:21:54 +0000 (11:21 -0700)]
Improve test output with `--quiet`

We had a few locations where the shell was written to raw instead of
through the test harness or through other captured mechanisms. This
updates the test suite so testing Cargo with `--quiet` provides a nice
and clean report of tests executed.

4 years agoAllow a number of tests to run on stable
Alex Crichton [Thu, 26 Sep 2019 18:18:53 +0000 (11:18 -0700)]
Allow a number of tests to run on stable

These tests all relied on support which has now ridden to stable at this
point, so let's let them run on stable!

4 years agoMerge remote-tracking branch 'origin/master' into custom-profile-pr-rfc
Dan Aloni [Thu, 26 Sep 2019 18:21:55 +0000 (21:21 +0300)]
Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc

4 years agoGo back to not hashing `RUSTFLAGS` in `-Cmetadata`
Alex Crichton [Mon, 23 Sep 2019 19:14:52 +0000 (12:14 -0700)]
Go back to not hashing `RUSTFLAGS` in `-Cmetadata`

This is a moral revert of #6503 but not a literal code revert. This
switches Cargo's behavior to avoid hashing compiler flags into
`-Cmetadata` since we've now had multiple requests of excluding flags
from the `-Cmetadata` hash: usage of `--remap-path-prefix` and PGO
options. These options should only affect how the compiler is
invoked/compiled and not radical changes such as symbol names, but
symbol names are changed based on `-Cmetadata`. Instead Cargo will still
track these flags internally, but only for reinvoking rustc, and not for
caching separately based on rustc flags.

Closes #7416

4 years agoAuto merge of #7425 - alexcrichton:kind-string, r=ehuss
bors [Thu, 26 Sep 2019 17:12:00 +0000 (17:12 +0000)]
Auto merge of #7425 - alexcrichton:kind-string, r=ehuss

Refactor `Kind` to carry target name in `Target`

This commit is an internal refactoring of Cargo's compilation backend to
eventually support compiling multiple target simultaneously. The
original motivation for this came up in discussion of #7297 and this has
long been something I've intended to update Cargo for. Nothing in the
backend currently exposes the ability to actually build multiple target
simultaneously, but this should have no function change with respect to
all current consumers. Eventually we'll need to refactor APIs of how you
enter the compilation backend to compile for multiple targets.

4 years agoAuto merge of #7444 - matthiaskrgr:clippy_v8, r=Eh2406
bors [Thu, 26 Sep 2019 16:17:25 +0000 (16:17 +0000)]
Auto merge of #7444 - matthiaskrgr:clippy_v8, r=Eh2406

 fix a bunch of clippy warnings

4 years agosupport http.ssl-version.min/max to specify min/max respectively
Guanqun Lu [Thu, 26 Sep 2019 15:56:45 +0000 (23:56 +0800)]
support http.ssl-version.min/max to specify min/max respectively

4 years agoadd dependencies for `pkg-config`
guanqun [Thu, 26 Sep 2019 15:54:37 +0000 (23:54 +0800)]
add dependencies for `pkg-config`

Otherwise, it complains:

    run pkg_config fail: "Failed to run `\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"`: No such file or directory (os error 2)"

4 years agofix a bunch of clippy warnings
Matthias Krüger [Thu, 26 Sep 2019 15:51:19 +0000 (17:51 +0200)]
fix a bunch of clippy warnings

4 years agoAddress review about doc blocks
Alex Crichton [Thu, 26 Sep 2019 15:13:32 +0000 (08:13 -0700)]
Address review about doc blocks

4 years agoRefactor how compile targets are handled
Alex Crichton [Wed, 25 Sep 2019 15:14:20 +0000 (08:14 -0700)]
Refactor how compile targets are handled

Rename `Kind` to `CompileKind` to reflect that it's intended for
compilation. Additionally change the `Target` variant to have a newtype
`CompileTarget` instead of just being a raw string. This new
`CompileTarget` type has a fallible constructor and handles custom json
target files internally.

Two accessors are available for `CompileTarget`, one is `rustc_target()`
which goes straight to rustc and everything else uses `short_name()`
which is the raw target or file stem for json files. The `short_name` is
used everywhere in Cargo for all purposes like configuration, env vars,
target directory naming, etc.

4 years agoRefactor `Kind` to carry target name in `Target`
Alex Crichton [Tue, 24 Sep 2019 17:53:32 +0000 (10:53 -0700)]
Refactor `Kind` to carry target name in `Target`

This commit is an internal refactoring of Cargo's compilation backend to
eventually support compiling multiple target simultaneously. The
original motivation for this came up in discussion of #7297 and this has
long been something I've intended to update Cargo for. Nothing in the
backend currently exposes the ability to actually build multiple target
simultaneously, but this should have no function change with respect to
all current consumers. Eventually we'll need to refactor APIs of how you
enter the compilation backend to compile for multiple targets.

4 years agoremove unsafe sslv2 and sslv3 methods
Guanqun Lu [Wed, 4 Sep 2019 15:36:33 +0000 (23:36 +0800)]
remove unsafe sslv2 and sslv3 methods

4 years agoadd an option to specify ssl version
Guanqun Lu [Thu, 15 Aug 2019 15:48:43 +0000 (23:48 +0800)]
add an option to specify ssl version

Fixes #6684

4 years agoAuto merge of #7440 - alexcrichton:always-pipeline, r=ehuss
bors [Thu, 26 Sep 2019 14:55:59 +0000 (14:55 +0000)]
Auto merge of #7440 - alexcrichton:always-pipeline, r=ehuss

Remove dynamic detection of pipelining support

Pipelining has made its way to stable so no need to check that any
more.

4 years agoAuto merge of #7441 - ehuss:fix-zalgo, r=alexcrichton
bors [Thu, 26 Sep 2019 14:33:00 +0000 (14:33 +0000)]
Auto merge of #7441 - ehuss:fix-zalgo, r=alexcrichton

Fix zalgo formatting.

Now that 1.38 has hit stable, we can finally update this rustfmt change.

4 years agoFix zalgo formatting.
Eric Huss [Thu, 26 Sep 2019 14:29:37 +0000 (07:29 -0700)]
Fix zalgo formatting.

4 years agoMerge remote-tracking branch 'origin/master' into custom-profile-pr-rfc
Dan Aloni [Wed, 25 Sep 2019 17:05:51 +0000 (20:05 +0300)]
Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc

4 years agoAuto merge of #7429 - alexcrichton:fix-osx-cpu, r=ehuss
bors [Wed, 25 Sep 2019 17:00:56 +0000 (17:00 +0000)]
Auto merge of #7429 - alexcrichton:fix-osx-cpu, r=ehuss

Fix macOS collection of CPU data

There's very little documentation on `host_processor_info` from what I can tell, so I'm just cribbing examples I've found elsewhere on the internet. Turns out two things were wrong:

* One is that `host_processor_info` returns allocated memory we need to deallocate. Who knew!
* Next is that one of the out parameters, `cpu_info_cnt`, is only somehow related to the size of the return, but all example code appears to just read data regardless of what it is.

In any case this commit reads [libuv's implementation](https://github.com/libuv/libuv/blob/040543eebf4983b1459a1e0e0e26dae68b80cc28/src/unix/darwin.c#L174-L225) which if good enough for node.js is probably good enough for us.

Closes #7427

4 years agoAuto merge of #7428 - alexcrichton:nocapture, r=ehuss
bors [Wed, 25 Sep 2019 16:35:10 +0000 (16:35 +0000)]
Auto merge of #7428 - alexcrichton:nocapture, r=ehuss

Don't ever capture CPU state if timings are disabled

This should initially help with the panic in #7427 but doesn't solve it.

4 years agoAuto merge of #7421 - ehuss:build-std-sysroot, r=alexcrichton
bors [Wed, 25 Sep 2019 15:58:02 +0000 (15:58 +0000)]
Auto merge of #7421 - ehuss:build-std-sysroot, r=alexcrichton

Change build-std to use --sysroot

This transitions build-std to use `--sysroot` instead of `--extern`. This is necessary because existing crates have a certain expectation of how standard library crates are exposed. It was intended that explicit dependencies in `Cargo.toml` would solve this problem, but I didn't really consider this would be a backwards-incompatible change, so using `--sysroot` is probably the best way to go, even though it's not ideal.

Closes rust-lang/wg-cargo-std-aware#31
Closes rust-lang/wg-cargo-std-aware#40

4 years agoFix a panic collecting cpu data on OSX
Alex Crichton [Wed, 25 Sep 2019 15:37:55 +0000 (08:37 -0700)]
Fix a panic collecting cpu data on OSX

There's very little documentation on `host_processor_info` from what I
can tell, so I'm just cribbing examples I've found elsewhere on the
internet. It appears that I've misinterpreted one of the out parameters
of `host_processor_info` as the number of elements of an array, but it
actually is just something forwarded to `vm_deallocate`.

4 years agoCall `vm_deallocate` on OSX for CPU statistics
Alex Crichton [Wed, 25 Sep 2019 15:29:42 +0000 (08:29 -0700)]
Call `vm_deallocate` on OSX for CPU statistics

Apparently StackOverflow doesn't have all the answers. The examples
there I lifted this from didn't account to call `vm_deallocate` because
it looks like we're handed allocated memory! Indeed running the previous
state capture in a loop it infinitely allocated memory, but now it holds
steady when called in a loop.

4 years agoDon't ever capture CPU state if timings are disabled
Alex Crichton [Wed, 25 Sep 2019 15:18:05 +0000 (08:18 -0700)]
Don't ever capture CPU state if timings are disabled

This should initially help with the panic in #7427 but doesn't solve it.

4 years agoAdd comment for unusual placement of add_sysroot_artifact.
Eric Huss [Tue, 24 Sep 2019 22:29:04 +0000 (15:29 -0700)]
Add comment for unusual placement of add_sysroot_artifact.

4 years agoAdd some comments about Layout naming and .sysroot.
Eric Huss [Tue, 24 Sep 2019 21:49:31 +0000 (14:49 -0700)]
Add some comments about Layout naming and .sysroot.

4 years agoAuto merge of #7411 - Eh2406:mtime, r=alexcrichton
bors [Tue, 24 Sep 2019 21:14:49 +0000 (21:14 +0000)]
Auto merge of #7411 - Eh2406:mtime, r=alexcrichton

set -Zmtime_on_use from config or ENV

This lets you set the `-Zmtime_on_use` in config, it worked for me with
```toml
[unstable]
mtime_on_use=true
```
I did not find the ENV that would allow work. Suggestions?
Does this need tests?

Closes: #6978
4 years agoMore docs
Eh2406 [Tue, 24 Sep 2019 21:10:27 +0000 (17:10 -0400)]
More docs

4 years agoAdd warning when mixing -Zbuild-std with --build-plan.
Eric Huss [Tue, 24 Sep 2019 20:51:11 +0000 (13:51 -0700)]
Add warning when mixing -Zbuild-std with --build-plan.

4 years agoDon't add sysroot lib path to dylib path for build-std.
Eric Huss [Tue, 24 Sep 2019 20:50:34 +0000 (13:50 -0700)]
Don't add sysroot lib path to dylib path for build-std.

4 years agouse the newer `.get::<Option<bool>>`
Eh2406 [Tue, 24 Sep 2019 20:43:46 +0000 (16:43 -0400)]
use the newer `.get::<Option<bool>>`

4 years agoSimplify mock rustc wrapper.
Eric Huss [Tue, 24 Sep 2019 19:45:32 +0000 (12:45 -0700)]
Simplify mock rustc wrapper.

4 years agoRemove dynamic detection of pipelining support
Alex Crichton [Tue, 24 Sep 2019 18:57:18 +0000 (11:57 -0700)]
Remove dynamic detection of pipelining support

Pipelining has made its way to stable so no need to check that any
more.

4 years agoAuto merge of #7419 - alexcrichton:fix-features-regression, r=ehuss
bors [Tue, 24 Sep 2019 17:19:12 +0000 (17:19 +0000)]
Auto merge of #7419 - alexcrichton:fix-features-regression, r=ehuss

Fix interpretation of `--features a b` on the CLI

Fixes an accidental regression from #7084 where `--features a b` was
erroneously mistinterpreted as `--features "a b"`.

Closes #7418

4 years agoFix interpretation of `--features a b` on the CLI
Alex Crichton [Mon, 23 Sep 2019 19:49:14 +0000 (12:49 -0700)]
Fix interpretation of `--features a b` on the CLI

Fixes an accidental regression from #7084 where `--features a b` was
erroneously mistinterpreted as `--features "a b"`.

Closes #7418

4 years agoAuto merge of #7422 - rust-lang:dependabot/cargo/env_logger-0.7.0, r=Eh2406
bors [Tue, 24 Sep 2019 13:28:08 +0000 (13:28 +0000)]
Auto merge of #7422 - rust-lang:dependabot/cargo/env_logger-0.7.0, r=Eh2406

Update env_logger requirement from 0.6.0 to 0.7.0

Updates the requirements on [env_logger](https://github.com/sebasmagri/env_logger) to permit the latest version.
<details>
<summary>Release notes</summary>

*Sourced from [env_logger's releases](https://github.com/sebasmagri/env_logger/releases).*

> ## 0.7.0
> # Key Changes
>
> - Indent multiline messages by default
> - Support more timestamp precision
> - Update to the 2018 edition
>
> # Changes to minimum Rust
>
> The minimum version of Rust required has been set at `1.31.0`. We may change this in patch versions, but will always flag it in the release notes here.
>
> You can always check the `.travis.yml` file to see the current minimum supported version.
>
> # Contributions
>
> - [@&#8203;95ulisse](https://github.com/95ulisse) [Indentation for multiline log messages](https://github-redirect.dependabot.com/sebasmagri/env_logger/pull/134)
> - [@&#8203;oherrala](https://github.com/oherrala) [Add more timestamp precisions](https://github-redirect.dependabot.com/sebasmagri/env_logger/pull/140)
> - [Update to 2018 edition](https://github-redirect.dependabot.com/sebasmagri/env_logger/pull/142)
</details>
<details>
<summary>Commits</summary>

- [`424f031`](https://github.com/sebasmagri/env_logger/commit/424f03167401b0cff8f3da8424adc3dc1e7683d0) Merge pull request [#143](https://github-redirect.dependabot.com/sebasmagri/env_logger/issues/143) from KodrAus/cargo/0.7.0
- [`058655e`](https://github.com/sebasmagri/env_logger/commit/058655eb6875414debae568c0346038eca83c1fe) prepare for 0.7.0 release
- [`bfac641`](https://github.com/sebasmagri/env_logger/commit/bfac6411adb05b7587b5de4acea0d5c3044ef029) Merge pull request [#142](https://github-redirect.dependabot.com/sebasmagri/env_logger/issues/142) from KodrAus/feat/2018
- [`ef10fa5`](https://github.com/sebasmagri/env_logger/commit/ef10fa512ab253ca86cbb9f8f95731b64aadf323) use specific log version
- [`dc65e48`](https://github.com/sebasmagri/env_logger/commit/dc65e48bae6e13c302451d58e2002f1354d5db01) bump msrv to 1.31.0 for editions
- [`8209524`](https://github.com/sebasmagri/env_logger/commit/8209524a2898b8367b369437e7de2dd48a14edb4) update to 2018 edition
- [`7105e63`](https://github.com/sebasmagri/env_logger/commit/7105e63885e2e325f3eceddcfe0ae6ae95e1ee0f) make breaking changes to timestamp API
- [`75911d7`](https://github.com/sebasmagri/env_logger/commit/75911d7711477b7efd8d0e6eb0886b2c54a17b6f) Merge pull request [#140](https://github-redirect.dependabot.com/sebasmagri/env_logger/issues/140) from oherrala/timestamp-formats
- [`95cd4ed`](https://github.com/sebasmagri/env_logger/commit/95cd4ed266be75d64bdf05c459c44bba5d759e30) Trick the compiler to think we are using timestamp
- [`92a5b2d`](https://github.com/sebasmagri/env_logger/commit/92a5b2dfa56d6926c97f07919aed857c39ac571e) Add more timestamp precisions
- Additional commits viewable in [compare view](https://github.com/sebasmagri/env_logger/compare/v0.6.0...v0.7.0)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

4 years agoUpdate env_logger requirement from 0.6.0 to 0.7.0
dependabot-preview[bot] [Tue, 24 Sep 2019 05:20:49 +0000 (05:20 +0000)]
Update env_logger requirement from 0.6.0 to 0.7.0

Updates the requirements on [env_logger](https://github.com/sebasmagri/env_logger) to permit the latest version.
- [Release notes](https://github.com/sebasmagri/env_logger/releases)
- [Changelog](https://github.com/sebasmagri/env_logger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sebasmagri/env_logger/compare/v0.6.0...v0.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
4 years agoSome more --sysroot tests.
Eric Huss [Tue, 24 Sep 2019 01:29:49 +0000 (18:29 -0700)]
Some more --sysroot tests.

4 years agoChange how standard_lib tests work
Alex Crichton [Mon, 23 Sep 2019 19:07:24 +0000 (12:07 -0700)]
Change how standard_lib tests work

* Minimize the sysroot crates in play
* Don't use build scripts to inject args
* Use `RUSTC_WRAPPER` to dynamically switch `--sysroot` depending on
  whether we're building sysroot crates or not.
* Minimize dependency graph in sysroot, only have each crate depend on a
  dummy crates.io crate for testing and otherwise don't depend on
  anything to load the desired sysroot crate directly.