Manish Goregaokar [Mon, 5 Feb 2018 16:29:31 +0000 (11:29 -0500)]
Pass -Zepoch flag when epoch feature exists
Manish Goregaokar [Mon, 5 Feb 2018 15:28:17 +0000 (10:28 -0500)]
Feature gate epoches
Manish Goregaokar [Mon, 5 Feb 2018 15:23:07 +0000 (10:23 -0500)]
Add epoch key to [package]
bors [Mon, 5 Feb 2018 05:11:39 +0000 (05:11 +0000)]
Auto merge of #5008 - matthiaskrgr:codespell, r=alexcrichton
fix a bunch of typos found by codespell
https://github.com/lucasdemarchi/codespell/
Matthias Krüger [Sun, 4 Feb 2018 21:30:22 +0000 (22:30 +0100)]
fix a bunch of typos found by codespell
bors [Sun, 4 Feb 2018 13:21:01 +0000 (13:21 +0000)]
Auto merge of #5004 - BurNiinTRee:pijul-config-key, r=matklad
Added "pijul" as a config key for cargo-new.vcs in .cargo/config
Currently Pijul can only be set as a version control from the command-line but not from the cargo-new.vcs key in .cargo/config
Lars Mühmel [Sun, 4 Feb 2018 13:06:03 +0000 (14:06 +0100)]
Added "pijul" as a config key for cargo-new.vcs in .cargo/config
bors [Thu, 1 Feb 2018 19:12:19 +0000 (19:12 +0000)]
Auto merge of #4995 - alexcrichton:relative-env, r=matklad
Fix `RUSTC=./relative-path` when building
This commit adjusts the compiler location logic to resolve `./relative-path`
before invoking rustc to ensure it's no longer cwd-relative. This is how many
other variables like `CARGO_HOME` work, so it's applying similar logic.
Alex Crichton [Wed, 31 Jan 2018 18:30:01 +0000 (10:30 -0800)]
Fix `RUSTC=./relative-path` when building
This commit adjusts the compiler location logic to resolve `./relative-path`
before invoking rustc to ensure it's no longer cwd-relative. This is how many
other variables like `CARGO_HOME` work, so it's applying similar logic.
bors [Wed, 31 Jan 2018 22:14:53 +0000 (22:14 +0000)]
Auto merge of #4990 - Eh2406:Zno-index-update, r=alexcrichton
add a -Z no-index-update for crater and benchmarking
This is a fix for #3479
Eh2406 [Wed, 31 Jan 2018 21:12:19 +0000 (16:12 -0500)]
add a test
bors [Wed, 31 Jan 2018 20:33:03 +0000 (20:33 +0000)]
Auto merge of #4996 - alexcrichton:document-lto, r=matklad
Document string values for LTO
Alex Crichton [Wed, 31 Jan 2018 19:45:26 +0000 (11:45 -0800)]
Document string values for LTO
bors [Wed, 31 Jan 2018 18:55:53 +0000 (18:55 +0000)]
Auto merge of #4984 - alexcrichton:configure-lto, r=matklad
Allow configuration of LTO in [profile]
This should help give access to ThinLTO when desired!
bors [Wed, 31 Jan 2018 09:20:32 +0000 (09:20 +0000)]
Auto merge of #4991 - bennofs:master, r=matklad
Require at least version 0.1.9 of jobserver crate
There are some important fixes in jobserver >=0.1.8. With earlier
versions, it's possible for cargo to panic with a "failed to acquire
jobserver token" error, which can be very hard to track down.
Requiring the latest version of jobserver makes sure that no such error
can make it into downstream distributions.
Benno Fünfstück [Wed, 31 Jan 2018 09:16:01 +0000 (10:16 +0100)]
Require at least version 0.1.9 of jobserver crate
There are some important fixes in jobserver >=0.1.8. With earlier
versions, it's possible for cargo to panic with a "failed to acquire
jobserver token" error, which can be very hard to track down.
Requiring the latest version of jobserver makes sure that no such error
can make it into downstream distributions.
Eh2406 [Wed, 31 Jan 2018 04:09:13 +0000 (23:09 -0500)]
add a -Z no-index-update for crater and benchmarking
Alex Crichton [Fri, 26 Jan 2018 22:26:13 +0000 (14:26 -0800)]
Allow configuration of LTO in [profile]
This should help give access to ThinLTO when desired!
bors [Fri, 26 Jan 2018 16:45:42 +0000 (16:45 +0000)]
Auto merge of #4980 - Gilnaa:master, r=matklad
Fixed relaxed libtest tests
This fixes tests regarding the upcoming behaviour of libtest's benchmarks.
The previous PR was wrongly tested, this one fixes the problems.
Gilad Naaman [Fri, 26 Jan 2018 16:23:44 +0000 (18:23 +0200)]
Fixed relaxed libtest tests
bors [Thu, 25 Jan 2018 00:37:01 +0000 (00:37 +0000)]
Auto merge of #4957 - sfackler:registry-elaboration, r=alexcrichton
Elaborate registry names to index URLs when publishing
This avoids introducing a dependency on the publisher's name for the
registry.
Closes #4880
bors [Wed, 24 Jan 2018 23:43:20 +0000 (23:43 +0000)]
Auto merge of #4974 - alexcrichton:less-vendor-verify, r=matklad
Be less strict about loading directory sources
Historically Cargo has been pretty strict about loading directory sources by
ensuring that everything inside was a crate. This was intended to protect
against accidental misconfiguration by failing loudly rather than silently
returning fewer crates.
This has caused a number of issues, however:
* #4969
* #4811
* #3899
so it seems like this is too aspirational of Cargo
Closes #4811
Closes #4969
Alex Crichton [Wed, 24 Jan 2018 18:04:47 +0000 (10:04 -0800)]
Be less strict about loading directory sources
Historically Cargo has been pretty strict about loading directory sources by
ensuring that everything inside was a crate. This was intended to protect
against accidental misconfiguration by failing loudly rather than silently
returning fewer crates.
This has caused a number of issues, however:
* #4969
* #4811
* #3899
so it seems like this is too aspirational of Cargo
Closes #4811
Closes #4969
bors [Wed, 24 Jan 2018 22:17:55 +0000 (22:17 +0000)]
Auto merge of #4973 - alexcrichton:dont-require-emscripten, r=matklad
Remove test that requires Emscripten
This seems relatively unlikely to regress in the future and otherwise arranging
Cargo to have a rustc that has Emscripten support will become difficult in the
near future in the Rust repo. All in all it seems like the course of action to
take is to delete this test for now.
Steven Fackler [Wed, 24 Jan 2018 20:54:17 +0000 (12:54 -0800)]
Forbid credentials from registry URLs
Steven Fackler [Thu, 18 Jan 2018 19:53:12 +0000 (11:53 -0800)]
Fixes for feedback
Steven Fackler [Thu, 18 Jan 2018 19:33:26 +0000 (11:33 -0800)]
Elaborate registry names to index URLs when publishing
This avoids introducing a dependency on the publisher's name for the
registry.
Closes #4880
Alex Crichton [Wed, 24 Jan 2018 17:45:01 +0000 (09:45 -0800)]
Remove test that requires Emscripten
This seems relatively unlikely to regress in the future and otherwise arranging
Cargo to have a rustc that has Emscripten support will become difficult in the
near future in the Rust repo. All in all it seems like the course of action to
take is to delete this test for now.
bors [Wed, 24 Jan 2018 15:05:11 +0000 (15:05 +0000)]
Auto merge of #4972 - varkor:lazy-cell-unused-unsafe, r=alexcrichton
Allow unused_unsafe in LazyCell in preparation for lib change
https://github.com/rust-lang/rust/pull/47204 makes `UnsafeCell::into_inner` safe, which means `LazyCell::into_inner` will no longer need an `unsafe` block. `LazyCell` is a blocker for the change in Rust: this fix should allow the change to take place.
varkor [Wed, 24 Jan 2018 09:46:54 +0000 (09:46 +0000)]
Allow unused_unsafe in LazyCell in preparation for lib change
https://github.com/rust-lang/rust/pull/47204 makes `UnsafeCell::into_inner` safe, which means `LazyCell::into_inner` will no longer need an `unsafe` block. `LazyCell` is a blocker for the change in Rust: this fix should allow the change to take place.
bors [Wed, 24 Jan 2018 02:36:53 +0000 (02:36 +0000)]
Auto merge of #4971 - ehuss:overflow-checks-doc, r=alexcrichton
Add overflow-checks to reference documentation.
Fixes #4925.
Eric Huss [Wed, 24 Jan 2018 02:23:58 +0000 (18:23 -0800)]
Add overflow-checks to reference documentation.
Fixes #4925.
bors [Tue, 23 Jan 2018 22:10:46 +0000 (22:10 +0000)]
Auto merge of #4724 - pornel:sortpaths, r=alexcrichton
Sort native library paths for deterministic builds
Fixes #3800 by using a `BTreeSet`, which guarantees a deterministic iteration order.
Since the order was previously arbitrary, a sorted order is just as good. The list is so small, that any performance difference between `BTreeSet` and `HashSet` is negligible.
Kornel [Sat, 20 Jan 2018 17:57:17 +0000 (17:57 +0000)]
Test sorting of native library paths
bors [Mon, 22 Jan 2018 20:55:15 +0000 (20:55 +0000)]
Auto merge of #4970 - Gilnaa:master, r=alexcrichton
Relaxed testing of libtest outputs.
This PR relaxes some checks on libtest due to upcoming changes by this PR:
https://github.com/rust-lang/rust/pull/46450
Summary of expected changes:
- Crashing benchmarks are now caught and handled just like in tests, and should not crash the harness. The old cargo test checked that the panic text was printed in stderr. In the patched behaviour, the text is printed to stdout.
With the advice of @alexcrichton, I changed test to check for the text in either stream in order to account of the transition period.
Gilad Naaman [Mon, 22 Jan 2018 20:27:50 +0000 (22:27 +0200)]
Relaxed testing of libtest outputs.
bors [Mon, 22 Jan 2018 15:33:14 +0000 (15:33 +0000)]
Auto merge of #4968 - edunham:patch-1, r=alexcrichton
Link to crate type docs
This page (served at https://doc.rust-lang.org/cargo/reference/manifest.html) is the first hit I get when searching "cargo crate-type". The doc which actually explains `crate-type`, https://doc.rust-lang.org/reference/linkage.html, does not appear in the first page of results. I hope that linking the reference doc here will make it easier for others to find instead of having to dig into closed GitHub issues like I did to find it.
E. Dunham [Mon, 22 Jan 2018 05:39:27 +0000 (21:39 -0800)]
Link to crate type docs
This page (served at https://doc.rust-lang.org/cargo/reference/manifest.html) is the first hit I get when searching "cargo crate-type". The doc which actually explains `crate-type`, https://doc.rust-lang.org/reference/linkage.html, does not appear in the first page of results. I hope that linking the reference doc here will make it easier for others to find instead of having to dig into closed GitHub issues like I did to find it.
bors [Sun, 21 Jan 2018 18:09:41 +0000 (18:09 +0000)]
Auto merge of #4965 - sfackler:patch-2, r=alexcrichton
Remove outdated stability note
Closes #4964
Steven Fackler [Sun, 21 Jan 2018 06:16:49 +0000 (22:16 -0800)]
Remove outdated stability note
Closes #4964
bors [Sat, 20 Jan 2018 07:17:37 +0000 (07:17 +0000)]
Auto merge of #4844 - sfackler:path-registry-okay, r=alexcrichton
Allow path + registry dependencies
Closes #4843
Do we have any infrastructure for testing what metadata a publish actually sends to the registry?
r? @withoutboats
Steven Fackler [Sat, 20 Jan 2018 06:31:11 +0000 (22:31 -0800)]
Allow path + registry dependencies
Closes #4843
bors [Thu, 18 Jan 2018 19:54:51 +0000 (19:54 +0000)]
Auto merge of #4958 - luser:fix-book-link, r=alexcrichton
Add a missing link in the book for `jobserver`
I don't know what the original intended link destination was, so I chose to link to the GNU Make documentation.
Ted Mielczarek [Thu, 18 Jan 2018 19:51:40 +0000 (14:51 -0500)]
Add a missing link in the book for `jobserver`. I don't know what the original
intended link destination was, so I chose to link to the GNU Make documentation.
bors [Thu, 18 Jan 2018 19:02:11 +0000 (19:02 +0000)]
Auto merge of #4955 - sfackler:allow-package, r=alexcrichton
Allow packaging of crates with unstable features
We don't want them to land on crates.io, but it's fine to make a .crate
file.
Closes #4954
Steven Fackler [Thu, 18 Jan 2018 18:35:40 +0000 (10:35 -0800)]
Allow packaging of crates with unstable features
We don't want them to land on crates.io, but it's fine to make a .crate
file.
Closes #4954
bors [Thu, 18 Jan 2018 06:19:55 +0000 (06:19 +0000)]
Auto merge of #4951 - sfackler:log-bump, r=alexcrichton
Upgrade env_logger
0.4 depends on log 0.3 and so misses out on module names.
Steven Fackler [Tue, 16 Jan 2018 20:43:04 +0000 (12:43 -0800)]
Upgrade env_logger
0.4 depends on log 0.3 and so misses out on module names.
bors [Wed, 17 Jan 2018 16:22:07 +0000 (16:22 +0000)]
Auto merge of #4950 - alexcrichton:rustflags-orderd, r=matklad
Ensure `[target]` rustflags are deterministically passed
The usage of `HashMap` in the `Config` tables introduced some nondeterminism, so
reverse that with a sort right before we pass it down to rustc. One day we'll
probably want to sort by the position where these keys were defined, but for now
a blanket sort should do the trick.
Closes #4935
bors [Wed, 17 Jan 2018 15:39:58 +0000 (15:39 +0000)]
Auto merge of #4949 - alexcrichton:fix-patch-network, r=matklad
Fix `[patch]` sections depending on one another
This commit fixes a bug in `[patch]` where the original source is updated too
often (for example `Updating ...` being printed too much). This bug occurred
when patches depended on each other (for example the dependencies of a resolved
`[patch]` would actually resolve to a `[patch]` that hadn't been resolved yet).
The ordering of resolution/locking wasn't happening correctly and wasn't ready
to break these cycles!
The process of adding `[patch]` sections to a registry has been updated to
account for this bug. Instead of add-and-lock all in one go this commit instead
splits the addition of `[patch]` into two phases. In the first we collect a
bunch of unlocked patch summaries but record all the `PackageId` instances for
each url we've scraped. After all `[patch]` sections have been processed in this
manner we go back and lock all the summaries that were previously unlocked. The
`lock` function was updated to *only* need the map of patches from URL to
`PackageId` as it doesn't actually have access to the full `Summary` of patches
during the `lock_patches` method.
All in all this should correctly resolve dependencies here which means that
processing of patches should proceed as usual, avoiding updating the registry
too much!
Closes #4941
bors [Wed, 17 Jan 2018 15:04:54 +0000 (15:04 +0000)]
Auto merge of #4952 - rust-lang:matklad-patch-1, r=alexcrichton
Fix link in a doc comment
Aleksey Kladov [Wed, 17 Jan 2018 07:27:37 +0000 (10:27 +0300)]
Fix link in a doc comment
Alex Crichton [Tue, 16 Jan 2018 19:22:40 +0000 (11:22 -0800)]
Ensure `[target]` rustflags are deterministically passed
The usage of `HashMap` in the `Config` tables introduced some nondeterminism, so
reverse that with a sort right before we pass it down to rustc. One day we'll
probably want to sort by the position where these keys were defined, but for now
a blanket sort should do the trick.
Closes #4935
Alex Crichton [Tue, 16 Jan 2018 15:33:59 +0000 (07:33 -0800)]
Fix `[patch]` sections depending on one another
This commit fixes a bug in `[patch]` where the original source is updated too
often (for example `Updating ...` being printed too much). This bug occurred
when patches depended on each other (for example the dependencies of a resolved
`[patch]` would actually resolve to a `[patch]` that hadn't been resolved yet).
The ordering of resolution/locking wasn't happening correctly and wasn't ready
to break these cycles!
The process of adding `[patch]` sections to a registry has been updated to
account for this bug. Instead of add-and-lock all in one go this commit instead
splits the addition of `[patch]` into two phases. In the first we collect a
bunch of unlocked patch summaries but record all the `PackageId` instances for
each url we've scraped. After all `[patch]` sections have been processed in this
manner we go back and lock all the summaries that were previously unlocked. The
`lock` function was updated to *only* need the map of patches from URL to
`PackageId` as it doesn't actually have access to the full `Summary` of patches
during the `lock_patches` method.
All in all this should correctly resolve dependencies here which means that
processing of patches should proceed as usual, avoiding updating the registry
too much!
Closes #4941
bors [Tue, 16 Jan 2018 06:11:46 +0000 (06:11 +0000)]
Auto merge of #4944 - mathstuf:better-gitignore-template, r=alexcrichton
cargo_new: drop the trailing slash for target exclusion in Git
When `target` is a symlink (e.g., to keep build outputs on a separate
partition), Git will not match the `/target/` ignore to the symlink
since it is not a directory. Drop the trailing slash to support ignoring
`target` as a symlink.
bors [Tue, 16 Jan 2018 05:37:39 +0000 (05:37 +0000)]
Auto merge of #4945 - mathstuf:avoid-unused-import, r=alexcrichton
tests/git: avoid an unused import
bors [Tue, 16 Jan 2018 00:18:10 +0000 (00:18 +0000)]
Auto merge of #4946 - segevfiner:patch-1, r=Mark-Simulacrum
Remove a stray character from the Zsh completion script
That's not a command that people normally use, found it by accident...
Segev Finer [Mon, 15 Jan 2018 23:47:40 +0000 (01:47 +0200)]
Remove a stray character from the Zsh completion script
That's not a command that people normally use, found it by accident...
Ben Boeckel [Mon, 15 Jan 2018 22:06:38 +0000 (17:06 -0500)]
tests/git: avoid an unused import
Ben Boeckel [Mon, 15 Jan 2018 22:07:56 +0000 (17:07 -0500)]
cargo_new: drop the trailing slash for target exclusion in Git
When `target` is a symlink (e.g., to keep build outputs on a separate
partition), Git will not match the `/target/` ignore to the symlink
since it is not a directory. Drop the trailing slash to support ignoring
`target` as a symlink.
bors [Sat, 13 Jan 2018 23:59:50 +0000 (23:59 +0000)]
Auto merge of #4938 - ehuss:ws-meta, r=alexcrichton
Add workspace root to metadata command.
Fixes #4933
@alexcrichton, you mentioned using `"workspace_manifest"`, but the `Workspace.root` function already strips off `Cargo.toml`. It would be easy to append it back, though I'm uncertain if that's really necessary since I think for most use cases it will just need to be stripped off again. Also, I feel like it might be confusing for non-workspace packages since `workspace_manifest` would be the same as the package `manifest_path` (and in that case it isn't really a workspace manifest). I can easily change it, just let me know.
bors [Sat, 13 Jan 2018 23:31:57 +0000 (23:31 +0000)]
Auto merge of #4939 - ignatenkobrain:license, r=alexcrichton
crates-io: include LICENSE-*
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Igor Gnatenko [Sat, 13 Jan 2018 21:07:44 +0000 (22:07 +0100)]
crates-io: include LICENSE-*
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Eric Huss [Sat, 13 Jan 2018 19:51:36 +0000 (11:51 -0800)]
Add workspace root to metadata command.
Fixes #4933
bors [Thu, 11 Jan 2018 09:18:22 +0000 (09:18 +0000)]
Auto merge of #4931 - Manishearth:testname, r=matklad
Explicitly mention testname argument for cargo test/bench
The fact that `cargo test foo` works is totally non obvious. I suspect that 99% of the time
folks running `cargo help test` are looking for a way to only run a specific test, and
the current help message makes it seem like the way to do that is `cargo test --test foo`,
which is incorrect (it runs a specific test target).
This PR mentions it explicitly in the help message, first and foremost.
Manish Goregaokar [Thu, 11 Jan 2018 07:26:43 +0000 (12:56 +0530)]
Explicitly mention testname argument for cargo test/bench
bors [Tue, 9 Jan 2018 17:01:30 +0000 (17:01 +0000)]
Auto merge of #4926 - alexcrichton:fix-links, r=alexcrichton
Fix links in the guide
Add a link to a missing page so it's rendered
bors [Tue, 9 Jan 2018 15:39:47 +0000 (15:39 +0000)]
Auto merge of #4770 - chabapok:master, r=alexcrichton
Add an "-Z offline" flag to Cargo, altering it's dependency resolution behavior
This PR is implementation of the #4686 (without "Populating the global cache" feature)
Alex Crichton [Tue, 9 Jan 2018 15:11:52 +0000 (07:11 -0800)]
Fix links in the guide
Add a link to a missing page so it's rendered
bors [Tue, 9 Jan 2018 15:08:32 +0000 (15:08 +0000)]
Auto merge of #4924 - daschl:name-help, r=alexcrichton
Do not suggest --name as a fix if its already used.
This changeset partially fixes #4903 in that it doesn't suggest
using --name if its already being used (but the name is still
wrong).
Michael Nitschinger [Tue, 9 Jan 2018 13:50:45 +0000 (14:50 +0100)]
Do not suggest --name as a fix if its already used.
This changeset partially fixes #4903 in that it doesn't suggest
using --name if its already being used (but the name is still
wrong).
bors [Tue, 9 Jan 2018 03:27:46 +0000 (03:27 +0000)]
Auto merge of #4923 - wking:console-markup, r=alexcrichton
doc: Replace 'shell' language labels (generally with 'console')
#GitHub [uses Linguist][1] for syntax highlighting. Linguist's [`shell` language][2] is for the *language* (e.g. the contents of a `.sh` file). The proper language for a shell session is [`ShellSession`][3], although in this commit I've used the [alias `console`][4].
The Cargo book [uses mdBook][4.5], mdBook [uses Highlight.js][5], and Highlight.js [also supports `console` as an alias for shell sessions][6].
A handful of places where we had been using `shell` were just command output, not shell sessions (e.g. they lacked a prompt and command). In this commit, I've left those without a language label.
[1]: https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
[2]: https://github.com/github/linguist/blob/v5.3.3/lib/linguist/languages.yml#L4208
[3]: https://github.com/github/linguist/blob/v5.3.3/lib/linguist/languages.yml#L4249
[4]: https://github.com/github/linguist/blob/v5.3.3/lib/linguist/languages.yml#L4255
[4.5]: https://github.com/rust-lang/cargo/tree/
f60ece98c10aa3716d037524da4ee989e212fe19/src/doc#requirements
[5]: https://rust-lang-nursery.github.io/mdBook/format/theme/syntax-highlighting.html#syntax-highlighting
[6]: https://github.com/isagalaev/highlight.js/blob/9.12.0/src/languages/shell.js#L10
bors [Tue, 9 Jan 2018 02:27:48 +0000 (02:27 +0000)]
Auto merge of #4921 - wking:doc/guide-rust, r=alexcrichton
doc/guide/dependencies: Add a 'rust' language marker
This had been added to the non-book docs in
2ad45a56 (#4455), despite the fact that the book didn't actually have that marker:
$ git cat-file -p
2ad45a56:src/doc/book/src/guide/dependencies.md | grep -A2 'You can now use the'
You can now use the `regex` library using `extern crate` in `main.rs`.
```
This is (along with the already-landed #4916), part of recovering from #4904.
bors [Tue, 9 Jan 2018 01:26:46 +0000 (01:26 +0000)]
Auto merge of #4839 - sfackler:consistent-config, r=withoutboats
Make .cargo/credentials a subset of .cargo/config
Previously, .cargo/credentials looked like
```toml
token = "..."
[my-registry]
token = "..."
```
And was simply merged into the `registry` block of .cargo/config. This
meant that custom registry tokens were under
`registry.my-registry.token` rather than `registries.my-registry.token`
which is where the index was located, and that you couldn't have a
custom registry named `token` or it'd conflict with the token for the
default registry.
This commit changes things such that .cargo/credentials has the same
layout as .cargo/config, but only contains token values. For backwards
compatibility, we move `token` to `registry.token` when parsing.
bors [Mon, 8 Jan 2018 23:41:12 +0000 (23:41 +0000)]
Auto merge of #4798 - GuillaumeGomez:patch-1, r=alexcrichton
Fix issues
Fixes #4786.
Steven Fackler [Wed, 20 Dec 2017 03:37:14 +0000 (19:37 -0800)]
Make .cargo/credentials a subset of .cargo/config
Previously, .cargo/credentials looked like
```toml
token = "..."
[my-registry]
token = "..."
```
And was simply merged into the `registry` block of .cargo/config. This
meant that custom registry tokens were under
`registry.my-registry.token` rather than `registries.my-registry.token`
which is where the index was located, and that you couldn't have a
custom registry named `token` or it'd conflict with the token for the
default registry.
This commit changes things such that .cargo/credentials has the same
layout as .cargo/config, but only contains token values. For backwards
compatibility, we move `token` to `registry.token` when parsing.
W. Trevor King [Mon, 8 Jan 2018 22:42:48 +0000 (14:42 -0800)]
doc: Replace 'shell' language labels (generally with 'console')
GitHub uses Linguist for syntax highlighting [1]. Linguist's 'shell'
language is for the *language* [2] (e.g. the contents of a `.sh`
file). The proper language for a shell session is ShellSession [3],
although in this commit I've used the alias 'console' [4].
The Cargo book uses mdBook (src/doc/README.md), mdBook uses
Highlight.js [5], and Highlight.js also supports 'console' as an alias
for shell sessions [6].
A handful of places where we had been using 'shell' were just command
output, not shell sessions (e.g. they lacked a prompt and command).
In this commit, I've left those without a language label.
[1]: https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
[2]: https://github.com/github/linguist/blob/v5.3.3/lib/linguist/languages.yml#L4208
[3]: https://github.com/github/linguist/blob/v5.3.3/lib/linguist/languages.yml#L4249
[4]: https://github.com/github/linguist/blob/v5.3.3/lib/linguist/languages.yml#L4255
[5]: https://rust-lang-nursery.github.io/mdBook/format/theme/syntax-highlighting.html#syntax-highlighting
[6]: https://github.com/isagalaev/highlight.js/blob/9.12.0/src/languages/shell.js#L10
bors [Mon, 8 Jan 2018 22:31:25 +0000 (22:31 +0000)]
Auto merge of #4922 - wking:reference-wording-from-guide-trailer, r=alexcrichton
doc/reference/index: Remove "Now that you have an overview" paragraph
This wording was originally from
58a1804f (#2688), which added it to the end of the guide (where telling readers what they know makes some sense). It was moved to a "Cargo in Depth" section with
01aa9e3c (#4453), where it makes a bit less sense. When that section became the reference index in
3f2d93e3 (#4455) the context assumed by the paragraph was completely missing.
This commit removes the paragraph, which doesn't reduce the usefulness of the reference index. And the removal avoids confusing readers who start with the reference docs and may now have the assumed overview.
W. Trevor King [Mon, 8 Jan 2018 22:06:55 +0000 (14:06 -0800)]
doc/reference/index: Remove "Now that you have an overview" paragraph
This wording was originally from
58a1804f (At the end, point to docs
that might be interesting next, 2016-05-17, #2688), which added it to
the end of the guide (where telling readers what they know makes some
sense). It was moved to a "Cargo in Depth" section with
01aa9e3c
([src/doc/book] Move a paragraph to cargo-in-depth.md, 2017-08-31,
#4453), where it makes a bit less sense. When that section became the
reference index in
3f2d93e3 ([doc/book] Create dir for book sections,
2017-08-31, #4455) the context assumed by the paragraph was completely
missing.
This commit removes the paragraph, which doesn't reduce the usefulness
of the reference index. And the removal avoids confusing readers who
start with the reference docs and may now have the assumed overview.
W. Trevor King [Mon, 8 Jan 2018 21:56:54 +0000 (13:56 -0800)]
doc/guide/dependencies: Add a 'rust' language marker
This had been added to the non-book docs in
2ad45a56 ([doc] Sync back
doc/book changes into old docs, 2017-08-31, #4455), despite the fact
that the book didn't actually have that marker:
$ git cat-file -p
2ad45a56:src/doc/book/src/guide/dependencies.md | grep -A2 'You can now use the'
You can now use the `regex` library using `extern crate` in `main.rs`.
```
Pelepeichenko Alexander [Mon, 8 Jan 2018 18:22:12 +0000 (20:22 +0200)]
Updating based on code review
Guillaume Gomez [Sat, 9 Dec 2017 15:34:48 +0000 (16:34 +0100)]
Fix incoherence
Pelepeichenko Alexander [Sun, 24 Dec 2017 23:32:29 +0000 (01:32 +0200)]
add offline mode (-Z offline) with tests
bors [Mon, 8 Jan 2018 19:11:39 +0000 (19:11 +0000)]
Auto merge of #4920 - wking:license-expression, r=matklad
Cargo.toml: Replace '/' with 'OR' in 'license'
Catch up with our recommendations from
7dee65fe (#4898), which deprecated `/` in favor of vanilla SPDX license expressions.
I've gone with the disjunctive `OR`, because the README has:
> Cargo is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
W. Trevor King [Mon, 8 Jan 2018 18:39:13 +0000 (10:39 -0800)]
Cargo.toml: Replace '/' with 'OR' in 'license'
Catch up with our recommendations from
7dee65fe (src/doc/manifest: Pin
'license' to SPDX 2.1 expressions and the 2.4 list, 2018-01-04,
#4898), which deprecated '/' in favor of vanilla SPDX license
expressions.
I've gone with the disjunctive OR, because the README has:
> Cargo is primarily distributed under the terms of both the MIT
> license and the Apache License (Version 2.0).
bors [Mon, 8 Jan 2018 18:04:53 +0000 (18:04 +0000)]
Auto merge of #4919 - alexcrichton:faster-git-clone, r=matklad
Leverage local links on git checkouts
This commit updates the handling of git checkouts from the database to use
hardlinks if possible, speeding up this operation for large repositories
significantly.
As a refresher, Cargo caches git repositories in a few locations to speed up
local usage of git repositories. Cargo has a "database" folder which is a bare
checkout of any git repository Cargo has cached historically. This database
folder contains effectively a bunch of databases for remote repos that are
updated periodically.
When actually building a crate Cargo will clone this database into a different
location, the checkouts folder. Each rev we build (ever) is cached in the
checkouts folder. This means that once a checkout directory is created it's
frozen for all of time.
This latter step is what this commit is optimizing. When checking out the
database onto the local filesystem at a particular revision. Previously we were
instructing libgit2 to fall back to a "git aware" transport which was
exceedingly slow on some systems for filesystem-to-filesystem transfers. This
optimization (we just forgot to turn it on in libgit2) is a longstanding one and
should speed this up significantly!
Closes #4604
Alex Crichton [Mon, 8 Jan 2018 17:38:40 +0000 (09:38 -0800)]
Leverage local links on git checkouts
This commit updates the handling of git checkouts from the database to use
hardlinks if possible, speeding up this operation for large repositories
significantly.
As a refresher, Cargo caches git repositories in a few locations to speed up
local usage of git repositories. Cargo has a "database" folder which is a bare
checkout of any git repository Cargo has cached historically. This database
folder contains effectively a bunch of databases for remote repos that are
updated periodically.
When actually building a crate Cargo will clone this database into a different
location, the checkouts folder. Each rev we build (ever) is cached in the
checkouts folder. This means that once a checkout directory is created it's
frozen for all of time.
This latter step is what this commit is optimizing. When checking out the
database onto the local filesystem at a particular revision. Previously we were
instructing libgit2 to fall back to a "git aware" transport which was
exceedingly slow on some systems for filesystem-to-filesystem transfers. This
optimization (we just forgot to turn it on in libgit2) is a longstanding one and
should speed this up significantly!
Closes #4604
bors [Mon, 8 Jan 2018 16:37:05 +0000 (16:37 +0000)]
Auto merge of #4916 - tari:doc-recovery, r=alexcrichton
Recover doc changes lost in #4904
Fixes #4906.
bors [Mon, 8 Jan 2018 15:49:18 +0000 (15:49 +0000)]
Auto merge of #4914 - xftroxgpx:doc_profile_section_in_workspace_only, r=alexcrichton
doc: [profile.*] sections are for root crate only
ie.
warning: profiles for the non root package will be ignored, specify profiles at the workspace root
rendered:

bors [Mon, 8 Jan 2018 15:08:56 +0000 (15:08 +0000)]
Auto merge of #4915 - xftroxgpx:typo2, r=alexcrichton
doc: typo "worksapce" -> "workspace"
occurs twice
Peter Marheine [Mon, 8 Jan 2018 05:31:45 +0000 (16:31 +1100)]
Recover caveat about -vv and cleaning
First added in
72c924230c3df67261642f74ba415cb34086935f which failed
to update the book and was replaced in
1271bb4de0c0e0a085be239c2418af9c673ffc87.
Peter Marheine [Mon, 8 Jan 2018 05:29:07 +0000 (16:29 +1100)]
Recover non-virtual default-members doc
First changed in
f9a27fc1f7ef0e4360c878a0209370a86b310b5e which failed
to update the book and was replaced in
1271bb4de0c0e0a085be239c2418af9c673ffc87.
Peter Marheine [Mon, 8 Jan 2018 05:26:19 +0000 (16:26 +1100)]
Recover docs for workspace.default-members
First added in
82d563b71bf697f3d989cc1fdc2455c59679c309 which failed
to update the book and was replaced in
1271bb4de0c0e0a085be239c2418af9c673ffc87.
Peter Marheine [Mon, 8 Jan 2018 05:24:23 +0000 (16:24 +1100)]
Recover implied --all for virtual workspace docs
First changed in
1240f42c899fbba8bf85e493c3beb9f82227a09a which failed
to update the book and was replaced in
1271bb4de0c0e0a085be239c2418af9c673ffc87.
Peter Marheine [Mon, 8 Jan 2018 05:22:15 +0000 (16:22 +1100)]
Recover 'Add missing spaces around = sign'
First changed in
e8a1ba6f63a93430b1de6fc772e3f950d5bd63f2 which failed
to update the book and was replaced in
1271bb4de0c0e0a085be239c2418af9c673ffc87.
Peter Marheine [Mon, 8 Jan 2018 05:21:09 +0000 (16:21 +1100)]
Recover [patch] doc clarifications
First added in
1700346a9e9fe36b6e5b6858fc9a03d63f4fa37e which failed
to update the book and was replaced in
1271bb4de0c0e0a085be239c2418af9c673ffc87.
Peter Marheine [Mon, 8 Jan 2018 05:17:15 +0000 (16:17 +1100)]
Recover gcc -> cc in build docs
First changed in
209513d8991e05049c1e78c6cdf14c0865f2dd16 which failed
to update the book and was replaced in
1271bb4de0c0e0a085be239c2418af9c673ffc87.
Peter Marheine [Mon, 8 Jan 2018 05:14:54 +0000 (16:14 +1100)]
Recover spelling correction for 'otherwsie'
First fixed in
7b65667d5912e46ab2a39a7914a0ade869acc258 which failed
to update the book and was replaced in
1271bb4de0c0e0a085be239c2418af9c673ffc87.
Peter Marheine [Mon, 8 Jan 2018 05:13:34 +0000 (16:13 +1100)]
Recover discussion of -vv for build output
First added in
723945cb0eae7d642caa88812c6ecee3ed5895a1 which failed
to update the book and was replaced in
1271bb4de0c0e0a085be239c2418af9c673ffc87.
Peter Marheine [Mon, 8 Jan 2018 05:11:26 +0000 (16:11 +1100)]
Re-fix spelling of 'workspace'
First fixed in
4848c30414c6ed6b7afbe6067703ccfe0510d0ec which failed
to update the book and was replaced in
1271bb4de0c0e0a085be239c2418af9c673ffc87.