bors [Tue, 3 Apr 2018 23:41:50 +0000 (23:41 +0000)]
Auto merge of #5288 - alexcrichton:another-fix, r=matklad
Less aggressively poison sources on builds
Discovered in #5257 the changes in #5215 were slightly too aggressively
poisoning sources to require updates, thinking that a manifest changed when it
actually hadn't.
Non-workspace-member path dependencies with optional/dev-dependencies
don't show up in the lock file, so the previous logic would recognize this and
think that the dependency missing from the lock file was just added and would
require a registry update.
The fix in this commit effectively just skips all of these dependencies in
non-workspace members. This means that this will be slightly buggy if an
optional dependency that's activated is added, but that's hopefully something we
can tackle later.
Closes #5257
bors [Tue, 3 Apr 2018 22:50:12 +0000 (22:50 +0000)]
Auto merge of #5287 - matklad:safer-intern, r=Eh2406
Slightly improve InternedString
* Use `&'static str` instead of (ptr, len) pair to reduce unsafety.
* try make hash calculation O(1) instead of O(n), fail miserably,
document findings.
* Rename `to_inner` -> `as_str()`.
Alex Crichton [Tue, 3 Apr 2018 18:42:44 +0000 (11:42 -0700)]
Less aggressively poison sources on builds
Discovered in #5257 the changes in #5215 were slightly too aggressively
poisoning sources to require updates, thinking that a manifest changed when it
actually hadn't.
Non-workspace-member path dependencies with optional/dev-dependencies
don't show up in the lock file, so the previous logic would recognize this and
think that the dependency missing from the lock file was just added and would
require a registry update.
The fix in this commit effectively just skips all of these dependencies in
non-workspace members. This means that this will be slightly buggy if an
optional dependency that's activated is added, but that's hopefully something we
can tackle later.
Closes #5257
Aleksey Kladov [Tue, 3 Apr 2018 18:42:18 +0000 (21:42 +0300)]
Slightly improve InternedString
* Use `&'static str` instead of (ptr, len) pair to reduce unsafety.
* try make hash calculation O(1) instead of O(n), fail miserably,
document findings.
* Rename `to_inner` -> `as_str()`.
bors [Tue, 3 Apr 2018 18:52:50 +0000 (18:52 +0000)]
Auto merge of #5203 - matklad:out-dir, r=alexcrichton
cargo build --out-dir
This is intended to fix https://github.com/rust-lang/cargo/issues/4875. Very much work in progress, just to figure out how exactly `--out-dir` should work :)
The path of least resistance for implementing `out-dir` would be to just link everything from `target/debug` to the `out-dir`. However, the problem with this approach is that we link *too much* to the `target/debug`. For example, if you run `cargo build --bin foo`, you'll find not only the `foo` itself there, but also rlibs from the same workspace.
I think it's rather important not to copy extra stuff to out-dir, so it is implemented as a completely new parameter, which is threaded through various config structs and applies *only* to the top-level units (i.e, to the stuff user explicitly requested to compile on the command line).
I also plan to add platform specific tests here, to check that we get .pdb on windows and .dSYM on macs for various crate-types.
Because, in general, a single target may produce multiple files, `out-dir` has to be a directory, you can't directly specify the output *file*.
Note that artifacts are still generated to the `target` dir as well.
Also cc @nirbheek, I hope that this might be useful for Meson integration, because `--out-dir` should be more straightforward to use than `--message-format=json`.
The end result, for `cargo build --bin rustraytracer --out-dir out` on windows looks like this:

Note how we have fewer files in the `out` :)
r? @alexcrichton
Aleksey Kladov [Tue, 3 Apr 2018 15:23:02 +0000 (18:23 +0300)]
Fix tests for mac
bors [Tue, 3 Apr 2018 14:40:15 +0000 (14:40 +0000)]
Auto merge of #5285 - matklad:create-all-the-dirs, r=alexcrichton
Replace home-grown create_dir_all with std::fs::create_dir_all
The old one is just the historical artifact, right?
Aleksey Kladov [Tue, 3 Apr 2018 13:14:14 +0000 (16:14 +0300)]
Replace home-grown create_dir_all with std::fs::create_dir_all
Aleksey Kladov [Tue, 3 Apr 2018 13:06:56 +0000 (16:06 +0300)]
Test out-dir edge cases
Aleksey Kladov [Tue, 3 Apr 2018 12:43:45 +0000 (15:43 +0300)]
Feature gate `--out-dir`
Aleksey Kladov [Tue, 3 Apr 2018 06:51:52 +0000 (09:51 +0300)]
Implement `--out-dir` option
bors [Tue, 3 Apr 2018 08:19:41 +0000 (08:19 +0000)]
Auto merge of #5283 - matklad:better-assertion, r=matklad
Make assertion more informative
This assertion triggers when I try to build Cargo simultaneosly on
linux host and windows VM via a shared folder, but it's not clear
what is going on.
Aleksey Kladov [Tue, 3 Apr 2018 08:17:21 +0000 (11:17 +0300)]
Make assertion more informative
This assertion triggers when I try to build Cargo simultaneosly on
linux host and windows VM via a shared folder, but it's not clear
what is going on.
bors [Mon, 2 Apr 2018 21:50:59 +0000 (21:50 +0000)]
Auto merge of #5281 - matklad:cleanup, r=alexcrichton
Cleanup
Hopefully the last round of `conext` refactoring :-)
r? @alexcrichton
Aleksey Kladov [Mon, 2 Apr 2018 21:36:30 +0000 (00:36 +0300)]
Replace triple with struct
Aleksey Kladov [Mon, 2 Apr 2018 21:11:38 +0000 (00:11 +0300)]
Move filename logic to FileType
Aleksey Kladov [Mon, 2 Apr 2018 20:55:57 +0000 (23:55 +0300)]
Rename TargetFileType -> FileFlavor
Aleksey Kladov [Mon, 2 Apr 2018 20:51:48 +0000 (23:51 +0300)]
Make TargetInfo.cfg private
Aleksey Kladov [Mon, 2 Apr 2018 20:39:42 +0000 (23:39 +0300)]
Extract target info
bors [Mon, 2 Apr 2018 17:53:03 +0000 (17:53 +0000)]
Auto merge of #5274 - klnusbaum:epoch_5214, r=alexcrichton
rename epoch to edition
Per issue #5214 let's rename all instances of epoch to Edition
bors [Mon, 2 Apr 2018 17:05:00 +0000 (17:05 +0000)]
Auto merge of #5259 - Mark-Simulacrum:seed-deserialize, r=alexcrichton
Remove thread local, replacing with DeserializeSeed
@dtolnay -- is this the right way to implement this? It seems *very* verbose, but I suppose that's to be expected...
r? @alexcrichton
Aleksey Kladov [Mon, 2 Apr 2018 16:30:13 +0000 (19:30 +0300)]
Replace a triple with a struct for readability
bors [Mon, 2 Apr 2018 15:49:52 +0000 (15:49 +0000)]
Auto merge of #5278 - alexcrichton:no-rustfmt-ci, r=alexcrichton
Remove rustfmt from Travis
As discussed at the recent work week this is probably a bit too zealous at this
time, so let's hold off on it until it's either more stable or we figure out a
better way to deal with changes in rustfmt.
For now though it'll hopefully be easy to continue running rustfmt every so
often!
Alex Crichton [Mon, 2 Apr 2018 15:48:53 +0000 (08:48 -0700)]
Remove rustfmt from Travis
As discussed at the recent work week this is probably a bit too zealous at this
time, so let's hold off on it until it's either more stable or we figure out a
better way to deal with changes in rustfmt.
For now though it'll hopefully be easy to continue running rustfmt every so
often!
Aleksey Kladov [Mon, 2 Apr 2018 14:24:44 +0000 (17:24 +0300)]
Slightly better variable names
bors [Sun, 1 Apr 2018 22:36:45 +0000 (22:36 +0000)]
Auto merge of #5276 - klausi:main-dead-code, r=matklad
chore(cli): Remove dead code in main()
I think that if() has been left behind by accident and can be removed?
Klaus Purer [Sun, 1 Apr 2018 19:35:23 +0000 (21:35 +0200)]
chore(cli): Remove dead code in main()
Kurtis Nusbaum [Wed, 21 Mar 2018 16:41:22 +0000 (09:41 -0700)]
rename epoch to edition
Mark Simulacrum [Thu, 29 Mar 2018 10:19:19 +0000 (12:19 +0200)]
Remove thread local, replacing with DeserializeSeed
bors [Sat, 31 Mar 2018 20:56:23 +0000 (20:56 +0000)]
Auto merge of #5271 - djc:interning-spelling, r=alexcrichton
Fix spelling errors in interning module
Dirkjan Ochtman [Sat, 31 Mar 2018 20:48:32 +0000 (22:48 +0200)]
Fix spelling errors in interning module
bors [Sat, 31 Mar 2018 14:51:14 +0000 (14:51 +0000)]
Auto merge of #5269 - orestisf1993:issue-5265, r=matklad
cargo_new: remove redundant leading new lines from ignore files
Only add a leading new line in `.gitignore`/`.hgignore`/`.ignore` files when
the file existed before `cargo new`.
Fixes #5265.
Orestis Floros [Sat, 31 Mar 2018 14:26:58 +0000 (17:26 +0300)]
cargo_new: remove redundant leading new lines from ignore files
Only add a leading new line in .gitignore/.hgignore/.ignore files when
the file existed before 'cargo new'.
Fixes #5265.
bors [Sat, 31 Mar 2018 13:28:20 +0000 (13:28 +0000)]
Auto merge of #5235 - klausi:Z-flag-docs, r=matklad
docs(Z-flags): Add description for each -Z flag in cargo help
Fixes #5155
There might be a more elaborate way of adding descriptions to available options and generating help text automatically. For now I think some static text is a good start.
Klaus Purer [Sat, 31 Mar 2018 09:33:14 +0000 (11:33 +0200)]
tests(help): Fix assertion by using the full line text
Klaus Purer [Sat, 31 Mar 2018 09:19:28 +0000 (11:19 +0200)]
tests(help): Add test for -Z help output
Klaus Purer [Fri, 30 Mar 2018 15:21:13 +0000 (17:21 +0200)]
docs(Z-flags): Add description for each -Z flag in cargo -Z help
bors [Fri, 30 Mar 2018 03:07:39 +0000 (03:07 +0000)]
Auto merge of #5258 - djc:split-resolver, r=Eh2406
Split resolver module to make it more manageable
The `core::resolver` module is currently the largest in Cargo, at some 2000 lines. Here's an attempt at splitting it into more reasonable parts and reordering the code in it for better comprehensibility.
Splitting is done in three major steps:
* Move the `Resolve` type and its dependencies into a separate module (~220 lines)
* Move utility data types into a separate module (~400 lines)
* Move the `Context` type and its dependencies into a separate module (~400 lines)
This halves the size of the root module, which is then reordered to make it more readable.
(This is a yak-shaving expedition of sorts, in preparation for #1286.)
Dirkjan Ochtman [Thu, 29 Mar 2018 09:11:17 +0000 (11:11 +0200)]
Reorder code in resolver module for better readability
Dirkjan Ochtman [Thu, 29 Mar 2018 09:07:49 +0000 (11:07 +0200)]
Move resolver Context initialization into a method
Dirkjan Ochtman [Thu, 29 Mar 2018 08:49:01 +0000 (10:49 +0200)]
Move resolver::Context into new resolver::context module
Dirkjan Ochtman [Thu, 29 Mar 2018 08:18:58 +0000 (10:18 +0200)]
Move utility types from resolver into resolver::types
Dirkjan Ochtman [Wed, 28 Mar 2018 13:51:09 +0000 (15:51 +0200)]
Move resolver::Resolve into a new resolver::resolve module
bors [Thu, 29 Mar 2018 19:34:06 +0000 (19:34 +0000)]
Auto merge of #5261 - djc:reformat, r=matklad
Fix formatting issues with cargo fmt
Noticed these unrelated formatting problems while working on #5258.
Dirkjan Ochtman [Thu, 29 Mar 2018 17:40:02 +0000 (19:40 +0200)]
Fix formatting issues with cargo fmt
bors [Wed, 28 Mar 2018 23:05:50 +0000 (23:05 +0000)]
Auto merge of #5253 - matklad:unit-meta-2, r=alexcrichton
Introduce compilation files
Just another context refactoring
bors [Wed, 28 Mar 2018 14:21:26 +0000 (14:21 +0000)]
Auto merge of #5255 - matklad:rustdoc-features, r=alexcrichton
Restore --features args for cargo rustdoc
Closes https://github.com/rust-lang/cargo/issues/5254
Aleksey Kladov [Tue, 27 Mar 2018 22:56:46 +0000 (01:56 +0300)]
Restore --features args for cargo rustdoc
It was accidentally omited when migrating to clap
Aleksey Kladov [Fri, 23 Mar 2018 13:57:39 +0000 (16:57 +0300)]
Introduce compilation files
bors [Tue, 27 Mar 2018 18:14:32 +0000 (18:14 +0000)]
Auto merge of #5252 - matklad:new-context-new, r=alexcrichton
Supply units to the context at the point of creation
This slightly reshuffles `Context` creation. The main benefit is that we know the set of units when we do `Context::new`, so we could use it to precalculate more things.
Aleksey Kladov [Tue, 27 Mar 2018 16:03:22 +0000 (19:03 +0300)]
Supply units to the context at the point of creation
bors [Tue, 27 Mar 2018 13:58:26 +0000 (13:58 +0000)]
Auto merge of #5249 - alexcrichton:run-rustc-less, r=matklad
Run `rustc` for information fewer times
Currently if you pass `--target` the same as rustc's host Cargo will run `rustc`
on extra time to learn information, but we only need to run it once to learn
such information!
Alex Crichton [Tue, 27 Mar 2018 11:55:23 +0000 (04:55 -0700)]
Run `rustc` for information fewer times
Currently if you pass `--target` the same as rustc's host Cargo will run `rustc`
on extra time to learn information, but we only need to run it once to learn
such information!
bors [Tue, 27 Mar 2018 13:16:48 +0000 (13:16 +0000)]
Auto merge of #5250 - rleungx:tweak-error-message, r=matklad
tweak error message
Closes #5238.
rleungx [Tue, 27 Mar 2018 12:54:18 +0000 (20:54 +0800)]
address comment
rleungx [Tue, 27 Mar 2018 12:34:18 +0000 (20:34 +0800)]
tweak error message
bors [Tue, 27 Mar 2018 12:19:45 +0000 (12:19 +0000)]
Auto merge of #5205 - gibix:i2773, r=alexcrichton
fix #2773 with new precise encode
Changed the precise encode from <pkg>=<precise> to <pkg>=<present_version>-><future_version> in order to check the correct requirements.
cc @lu-zero
bors [Mon, 26 Mar 2018 13:00:26 +0000 (13:00 +0000)]
Auto merge of #5228 - phil-opp:target-spec, r=alexcrichton
Add support for absolute target.json paths
Builds upon https://github.com/rust-lang/rust/pull/49019 with the goal to provide a solution to https://github.com/rust-lang/cargo/issues/4905.
This PR does two things:
~~1. It appends a hash of the target path to the target folder name if a `*.json` path is passed as `--target`, like it's done in https://github.com/rust-lang/rust/pull/49019. This helps differentiating targets with the same JSON file name and avoids sysroot clashes in `xargo`.~~ See https://github.com/rust-lang/cargo/pull/5228#discussion_r176827531
2. It canonicalizes the passed target path (if it's a `*.json` path), so that the path stays valid when building dependencies and setting the `RUST_TARGET_PATH` environment variable is no longer necessary.
bors [Mon, 26 Mar 2018 12:37:09 +0000 (12:37 +0000)]
Auto merge of #5244 - Eijebong:tempfile, r=alexcrichton
Replace tempdir by tempfile
The former has been deprecated in favor of the latter
Bastien Orivel [Mon, 26 Mar 2018 10:42:30 +0000 (12:42 +0200)]
Replace tempdir by tempfile
The former has been deprecated in favor of the latter
bors [Mon, 26 Mar 2018 06:53:49 +0000 (06:53 +0000)]
Auto merge of #5243 - alexcrichton:more-feature-sync, r=alexcrichton
More effort to only compile Cargo once
Hopefully one final change necessary for rust-lang/rust#49053
Alex Crichton [Mon, 26 Mar 2018 06:52:55 +0000 (23:52 -0700)]
More effort to only compile Cargo once
Hopefully one final change necessary for rust-lang/rust#49053
Philipp Oppermann [Sat, 24 Mar 2018 20:38:48 +0000 (21:38 +0100)]
Add custom target tests
Philipp Oppermann [Thu, 22 Mar 2018 17:53:19 +0000 (18:53 +0100)]
Canonicalize paths passed as `--target`
bors [Sun, 25 Mar 2018 07:25:30 +0000 (07:25 +0000)]
Auto merge of #5232 - matklad:unit-map, r=alexcrichton
Refactor context to extract dependencies calculation to a separate mod
This makes unit dependency graph construction eager and moves it to a separate file.
Hopefully, this makes `Context` slightly easier to understand :)
Aleksey Kladov [Fri, 23 Mar 2018 11:51:32 +0000 (14:51 +0300)]
Refactor context to extract dependencies calculation to a separate mod
bors [Sat, 24 Mar 2018 19:54:49 +0000 (19:54 +0000)]
Auto merge of #5239 - alexcrichton:remove-scoped-tls, r=matklad
Remove scoped_tls dependency
This is causing [conflicts] with rebuilding upstream in rust-lang/rust, so
remove this for now until we figure out a better solution.
[conflicts]: https://github.com/rust-lang/rust/pull/49053#issuecomment-
375906970
Alex Crichton [Sat, 24 Mar 2018 16:51:33 +0000 (09:51 -0700)]
Remove scoped_tls dependency
This is causing [conflicts] with rebuilding upstream in rust-lang/rust, so
remove this for now until we figure out a better solution.
[conflicts]: https://github.com/rust-lang/rust/pull/49053#issuecomment-
375906970
gibix [Sat, 24 Mar 2018 19:04:19 +0000 (20:04 +0100)]
add precise test
gibix [Sat, 24 Mar 2018 19:04:02 +0000 (20:04 +0100)]
cargo fmt
gibix [Tue, 20 Mar 2018 10:02:29 +0000 (11:02 +0100)]
fix typo , drop return and intermediate vector
gibix [Tue, 20 Mar 2018 08:58:51 +0000 (09:58 +0100)]
cargo fmt
gibix [Mon, 19 Mar 2018 17:43:02 +0000 (18:43 +0100)]
fix #2773 with new precise encode
bors [Sat, 24 Mar 2018 16:59:59 +0000 (16:59 +0000)]
Auto merge of #5213 - Eh2406:faster_resolver, r=alexcrichton
Faster resolver: use a inverse-index to not activate the causes of conflict
This adds a test for https://github.com/rust-lang/cargo/issues/4810#issuecomment-
357553286 with two extensions that make it harder. It is the last reproducible and in the wild exponentially slow resolution (that I have found).
The problem in the test is `backtrack_trap0 = "*"` is a lot of ways of saying `constrained = ">=1.1.0, <=2.0.0"` but `constrained= "2.0.1"` is already picked. Only then to try and solve `constrained= "~1.0.0"` which is incompatible. Our parent knows that we have been poisoned, and wont try to activate us again. Because of the order we evaluate deps we end up backtracking to where `constrained: 1.1.0` is set instead of our parent. And so the poisoning does not help. This is harder then https://github.com/rust-lang/cargo/issues/4810#issuecomment-
357553286 because:
1. Having multiple semver compatible versions of constrained in play makes for a lot more bookkeeping. Specifically bookkeeping I forgot when I first submitted this PR.
2. The problematic dependencies are added deep in a combinatorial explosion of possibilities. So if we don't correctly handle caching that `backtrack_trap0 = "*"` is doomed then we will never finish looking thru the different possibilities for `level0 = "*"`
This PR also includes a proof of concept solution for the test, which proves that it does solve https://github.com/rust-lang/cargo/issues/4810#issuecomment-
357553286. The added code is tricky to read. It also adds a `O(remaining_deps)` job to every activation on the happy path, slower if the `past_conflicting_activations` is not empty.
I'd like some brainstorming on better solutions.
Eh2406 [Fri, 23 Mar 2018 20:40:51 +0000 (16:40 -0400)]
address suggestions
Eh2406 [Fri, 23 Mar 2018 15:39:12 +0000 (11:39 -0400)]
Move caching to a support struct and file
Eh2406 [Thu, 22 Mar 2018 21:33:56 +0000 (17:33 -0400)]
add comments
Eh2406 [Thu, 22 Mar 2018 20:18:58 +0000 (16:18 -0400)]
remove some loops
Eh2406 [Wed, 21 Mar 2018 21:05:55 +0000 (17:05 -0400)]
test the new backtracking does all of its bookkeeping
Eh2406 [Wed, 21 Mar 2018 17:09:08 +0000 (13:09 -0400)]
maintain an inverse-index
Eh2406 [Sun, 18 Mar 2018 03:05:08 +0000 (23:05 -0400)]
problematic extension and solution
Eh2406 [Sun, 18 Mar 2018 02:44:30 +0000 (22:44 -0400)]
A slow and ugly solution, but it works.
Eh2406 [Sun, 18 Mar 2018 02:31:04 +0000 (22:31 -0400)]
Add a test for https://github.com/rust-lang/cargo/issues/4810#issuecomment-
357553286
bors [Fri, 23 Mar 2018 19:20:10 +0000 (19:20 +0000)]
Auto merge of #5200 - klausi:minimal_versions, r=Eh2406
feat(resolver): Add CLI option to resolve minimal version dependencies
Fixes #4100
Test cases are still missing. We need to come up with a plan what cases we want to cover.
Thanks a lot to @Eh2406 for very helpful instructions to kick this off.
Klaus Purer [Fri, 23 Mar 2018 19:06:49 +0000 (20:06 +0100)]
tests(resolver): Group integration test with other minimal version test
Klaus Purer [Fri, 23 Mar 2018 18:58:56 +0000 (19:58 +0100)]
tests(resolver): Add integration test for -Z minimal-versions
Klaus Purer [Fri, 23 Mar 2018 17:28:51 +0000 (18:28 +0100)]
fix(resolver): Preserve lock file when sorting for minimal versions, document tests
bors [Fri, 23 Mar 2018 15:28:44 +0000 (15:28 +0000)]
Auto merge of #5233 - lukaslueg:issue5229, r=matklad
Assert Dependency::name is never empty, prevent 'install ""' from crashing
An explicit `cargo install ""` would cause clap to pass an empty crate-name,
leading to a panic(). We now assert() that Dependency::name is never the
empty string and prevent the situation in the first place by not allowing
the crate-name to be empty for `install`.
Fixes #5229
Lukas Lueg [Fri, 23 Mar 2018 14:26:50 +0000 (15:26 +0100)]
Assert that Dependency::name is never empty, prevent 'install ""' from crashing
An explicit `cargo install ""` would cause clap to pass an empty crate-name,
leading to a panic(). We now assert() that Dependency::name is never the
empty string and prevent the situation in the first place by not allowing
the crate-name to be empty for `install`.
Fixes #5229
bors [Fri, 23 Mar 2018 14:33:49 +0000 (14:33 +0000)]
Auto merge of #5231 - matklad:simplify, r=alexcrichton
Simplify `build_map`
This doesn't change semantics, but helps us not to rebuild BuildScripts
twice, and makes sure that we fail with assert if somehow we get cyclic
deps.
r? @alexcrichton
Aleksey Kladov [Fri, 23 Mar 2018 09:20:01 +0000 (12:20 +0300)]
Simplify `build_map`
This doesn't change semantics, but helps us not to rebuild BuildScripts
twice, and makes sure that we fail with assert if somehow we get cyclic
deps
bors [Fri, 23 Mar 2018 02:25:08 +0000 (02:25 +0000)]
Auto merge of #5230 - matthiaskrgr:newline, r=alexcrichton
add final linebreak to cargo default help message.
before:

patch:

I assume this is some kind of leftover from the clap transition. cc @matklad
Matthias Krüger [Fri, 23 Mar 2018 01:33:50 +0000 (02:33 +0100)]
add final linebreak to cargo default help message.
bors [Thu, 22 Mar 2018 18:48:48 +0000 (18:48 +0000)]
Auto merge of #5226 - jeehoonkang:doc-caret, r=alexcrichton
doc: Clarify the meaning of caret requirements
Closes #4910 (which is already closed, though 😄)
r? @alexcrichton
Jeehoon Kang [Thu, 22 Mar 2018 18:25:28 +0000 (03:25 +0900)]
doc: Clarify the meaning of caret requirements
Closes #4910
bors [Thu, 22 Mar 2018 16:32:43 +0000 (16:32 +0000)]
Auto merge of #5225 - matthiaskrgr:revert_pr5223, r=alexcrichton
Revert "manifest: update default lto for release and bench to 'thin'."
This reverts commit
e74ff4db13f2ae00245902cb5b496b3b39128653.
Turns out I was wrong, sorry for the noise.
Matthias Krüger [Thu, 22 Mar 2018 15:26:13 +0000 (16:26 +0100)]
Revert "manifest: update default lto for release and bench to 'thin'."
This reverts commit
e74ff4db13f2ae00245902cb5b496b3b39128653.
Turns out I was wrong, sorry for the noise.
bors [Thu, 22 Mar 2018 14:07:49 +0000 (14:07 +0000)]
Auto merge of #5217 - matklad:known-crate-types, r=alexcrichton
Preprobe info for known crate type
Previously, we've calculated the set of crate types to learn about by
recursively walking the graph of units. However, to actually know
dependencies of a unit exactly, we must know target specific info, and
we don't know it at this moment (in fact, we are trying calculating it).
Note that crate-type calculation is already lazy, we don't have to calc
all crate-types upfront. So, let's just scrape this info once for
well-known crate types, and fill whatever is left lazily.
@alexcrichton would this approach work at all? I think it would, if `KNOWN_CRATE_TYPES` are all available for all target-tripples we support. Is it a valid assumption?
The larger picture is that I am trying to make unit dependency resolution eager and move it into the separate file. I even got something working, but I have to run dependency resolution three times, because it is not exactly idempotent for various reasons, including this target-info stuff :)
```
cx.prepare()?;
cx.build_unit_map(units.clone())?; // resolve dependencies
cx.probe_target_info(&units)?;
cx.build_unit_map(units.clone())?; // resolve again
cx.build_used_in_plugin_map(&units)?;
custom_build::build_map(&mut cx, &units)?;
cx.build_unit_map(units.clone())?; // and resolve one final time :)
```
bors [Thu, 22 Mar 2018 11:50:27 +0000 (11:50 +0000)]
Auto merge of #5223 - matthiaskrgr:manifest_update, r=matklad
manifest: update default lto for release and bench to "thin"
[redacted]
Matthias Krüger [Thu, 22 Mar 2018 11:36:37 +0000 (12:36 +0100)]
manifest: update default lto for release and bench to 'thin'.