Skip to content

Commit

Permalink
Merge branch 'master' into feat/glob-pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Oct 18, 2020
2 parents 3d04268 + af64bd6 commit d613cd6
Show file tree
Hide file tree
Showing 68 changed files with 861 additions and 380 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.3/mdbook-v0.4.3-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo ::add-path::`pwd`/mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Deploy docs
run: |
cd src/doc/contrib
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
- run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.3.7/mdbook-v0.3.7-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo ::add-path::`pwd`/mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- run: cargo doc --no-deps
- run: cd src/doc && mdbook build --dest-dir ../../target/doc
- run: |
Expand Down
58 changes: 55 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,66 @@
# Changelog

## Cargo 1.49 (2020-12-31)
[75615f8e...HEAD](https://github.com/rust-lang/cargo/compare/75615f8e...HEAD)

### Added
- Added `homepage` and `documentation` fields to `cargo metadata`.
[#8744](https://github.com/rust-lang/cargo/pull/8744)

### Changed
- Computed LTO flags are now included in the filename metadata hash so that
changes in LTO settings will independently cache build artifacts instead of
overwriting previous ones. This prevents rebuilds in some situations such as
switching between `cargo build` and `cargo test` in some circumstances.
[#8755](https://github.com/rust-lang/cargo/pull/8755)

### Fixed
- Fixed building a library with both "dylib" and "rlib" crate types with LTO enabled.
[#8754](https://github.com/rust-lang/cargo/pull/8754)

### Nightly only


## Cargo 1.48 (2020-11-19)
[51b66125...HEAD](https://github.com/rust-lang/cargo/compare/51b66125...HEAD)
[51b66125...rust-1.48.0](https://github.com/rust-lang/cargo/compare/51b66125...rust-1.48.0)

### Added
- Added `term.progress` configuration option to control when and how the
progress bar is displayed.
[docs](https://doc.rust-lang.org/nightly/cargo/reference/config.html#termprogresswhen)
[#8165](https://github.com/rust-lang/cargo/pull/8165)
- Added `--message-format plain` option to `cargo locate-project` to display
the project location without JSON to make it easier to use in a script.
[#8707](https://github.com/rust-lang/cargo/pull/8707)
- Added `--workspace` option to `cargo locate-project` to display the path to
the workspace manifest.
[#8712](https://github.com/rust-lang/cargo/pull/8712)
- A new contributor guide has been added for contributing to Cargo itself.
This is published at <https://rust-lang.github.io/cargo/contrib/>.
[#8715](https://github.com/rust-lang/cargo/pull/8715)
- Zsh `--target` completion will now complete with the built-in rustc targets.
[#8740](https://github.com/rust-lang/cargo/pull/8740)

### Changed

### Fixed
- Fixed LTO with doctests.
[#8657](https://github.com/rust-lang/cargo/pull/8657)
- Fixed `cargo new` creating a fossil repository to properly ignore the `target` directory.
[#8671](https://github.com/rust-lang/cargo/pull/8671)
- Don't show warnings about the workspace in the current directory when using `cargo install`
of a remote package.
[#8681](https://github.com/rust-lang/cargo/pull/8681)
- Automatically reinitialize the index when an "Object not found" error is
encountered in the git repository.
[#8735](https://github.com/rust-lang/cargo/pull/8735)

### Nightly only
- Fixed `cargo install` so that it will ignore the `[unstable]` table in local config files.
[#8656](https://github.com/rust-lang/cargo/pull/8656)
- Fixed nondeterministic behavior of the new feature resolver.
[#8701](https://github.com/rust-lang/cargo/pull/8701)
- Fixed running `cargo test` on a proc-macro with the new feature resolver
under a specific combination of circumstances.
[#8742](https://github.com/rust-lang/cargo/pull/8742)

## Cargo 1.47 (2020-10-08)
[4f74d9b2...rust-1.47.0](https://github.com/rust-lang/cargo/compare/4f74d9b2...rust-1.47.0)
Expand Down Expand Up @@ -95,6 +144,9 @@
- The `CARGO_TARGET_{triplet}_RUNNER` environment variable will now correctly
override the config file instead of trying to merge the commands.
[#8629](https://github.com/rust-lang/cargo/pull/8629)
- Fixed LTO with doctests.
[#8657](https://github.com/rust-lang/cargo/pull/8657)
[#8658](https://github.com/rust-lang/cargo/pull/8658)

### Nightly only
- Added support for `-Z terminal-width` which tells `rustc` the width of the
Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo"
version = "0.49.0"
version = "0.50.0"
edition = "2018"
authors = ["Yehuda Katz <wycats@gmail.com>",
"Carl Lerche <me@carllerche.com>",
Expand All @@ -23,7 +23,7 @@ atty = "0.2"
bytesize = "1.0"
cargo-platform = { path = "crates/cargo-platform", version = "0.1.1" }
crates-io = { path = "crates/crates-io", version = "0.31.1" }
crossbeam-utils = "0.7"
crossbeam-utils = "0.8"
crypto-hash = "0.3.1"
curl = { version = "0.4.23", features = ["http2"] }
curl-sys = "0.4.22"
Expand All @@ -32,7 +32,7 @@ pretty_env_logger = { version = "0.4", optional = true }
anyhow = "1.0"
filetime = "0.2.9"
flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] }
git2 = "0.13.5"
git2 = "0.13.12"
git2-curl = "0.14.0"
glob = "0.3.0"
hex = "0.4"
Expand All @@ -44,7 +44,7 @@ jobserver = "0.1.21"
lazycell = "1.2.0"
libc = "0.2"
log = "0.4.6"
libgit2-sys = "0.12.7"
libgit2-sys = "0.12.14"
memchr = "2.1.3"
num_cpus = "1.0"
opener = "0.4"
Expand All @@ -60,7 +60,7 @@ strip-ansi-escapes = "0.1.0"
tar = { version = "0.4.26", default-features = false }
tempfile = "3.0"
termcolor = "1.1"
toml = "0.5.3"
toml = "0.5.7"
unicode-xid = "0.2.0"
url = "2.0"
walkdir = "2.2"
Expand Down
4 changes: 2 additions & 2 deletions ci/validate-man.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e

cd src/doc

changes=$(git status --porcelain .)
changes=$(git status --porcelain)
if [ -n "$changes" ]
then
echo "git directory must be clean before running this script."
Expand All @@ -14,7 +14,7 @@ fi

./build-man.sh

changes=$(git status --porcelain .)
changes=$(git status --porcelain)
if [ -n "$changes" ]
then
echo "Detected changes in man pages:"
Expand Down
1 change: 1 addition & 0 deletions crates/cargo-test-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,7 @@ fn substitute_macros(input: &str) -> String {
("[ERROR]", "error:"),
("[WARNING]", "warning:"),
("[NOTE]", "note:"),
("[HELP]", "help:"),
("[DOCUMENTING]", " Documenting"),
("[FRESH]", " Fresh"),
("[UPDATING]", " Updating"),
Expand Down
10 changes: 4 additions & 6 deletions crates/mdman/src/format/md.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ use crate::util::unwrap;
use crate::ManMap;
use anyhow::{bail, format_err, Error};
use std::fmt::Write;
use url::Url;

pub struct MdFormatter {
url: Option<Url>,
man_map: ManMap,
}

impl MdFormatter {
pub fn new(url: Option<Url>, man_map: ManMap) -> MdFormatter {
MdFormatter { url, man_map }
pub fn new(man_map: ManMap) -> MdFormatter {
MdFormatter { man_map }
}
}

impl MdFormatter {
fn render_html(&self, input: &str) -> Result<String, Error> {
let parser = crate::md_parser(input, self.url.clone());
let parser = crate::md_parser(input, None);
let mut html_output: String = String::with_capacity(input.len() * 3 / 2);
pulldown_cmark::html::push_html(&mut html_output, parser.map(|(e, _r)| e));
Ok(html_output)
Expand Down Expand Up @@ -78,7 +76,7 @@ impl super::Formatter for MdFormatter {
fn linkify_man_to_md(&self, name: &str, section: u8) -> Result<String, Error> {
let s = match self.man_map.get(&(name.to_string(), section)) {
Some(link) => format!("[{}({})]({})", name, section, link),
None => format!("[{}({})]({}.md)", name, section, name),
None => format!("[{}({})]({}.html)", name, section, name),
};
Ok(s)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/mdman/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub fn convert(
) -> Result<String, Error> {
let formatter: Box<dyn Formatter + Send + Sync> = match format {
Format::Man => Box::new(format::man::ManFormatter::new(url)),
Format::Md => Box::new(format::md::MdFormatter::new(url, man_map)),
Format::Md => Box::new(format::md::MdFormatter::new(man_map)),
Format::Text => Box::new(format::text::TextFormatter::new(url)),
};
let expanded = hbs::expand(file, &*formatter)?;
Expand Down
14 changes: 14 additions & 0 deletions crates/mdman/tests/compare/expected/links.1
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,17 @@ Shortcut unknown: [shortcut unknown]
\fBother\-cmd\fR(1)
.sp
\fBlocal\-cmd\fR(1)
.sp
\fISome link\fR <https://example.org/foo.html>
.sp
\fB\-\-include\fR
.RS 4
Testing an \fIincluded link\fR <https://example.org/included_link.html>\&.
.RE
.SH "OPTIONS"
.sp
\fB\-\-foo\-bar\fR
.RS 4
Example \fIlink\fR <https://example.org/bar.html>\&.
See \fBother\-cmd\fR(1), \fBlocal\-cmd\fR(1)
.RE
23 changes: 22 additions & 1 deletion crates/mdman/tests/compare/expected/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,28 @@ Shortcut unknown: [shortcut unknown]

[other-cmd(1)](https://example.org/commands/other-cmd.html)

[local-cmd(1)](local-cmd.md)
[local-cmd(1)](local-cmd.html)

[Some link](foo.html)

<dl>
<dt class="option-term" id="option-links---include"><a class="option-anchor" href="#option-links---include"></a><code>--include</code></dt>
<dd class="option-desc">Testing an <a href="included_link.html">included link</a>.</dd>

</dl>


## OPTIONS

<dl>

<dt class="option-term" id="option-links---foo-bar"><a class="option-anchor" href="#option-links---foo-bar"></a><code>--foo-bar</code></dt>
<dd class="option-desc">Example <a href="bar.html">link</a>.
See <a href="https://example.org/commands/other-cmd.html">other-cmd(1)</a>, <a href="local-cmd.html">local-cmd(1)</a></dd>


</dl>


[bar]: https://example.com/bar
[collapsed]: https://example.com/collapsed
Expand Down
10 changes: 10 additions & 0 deletions crates/mdman/tests/compare/expected/links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ DESCRIPTION

local-cmd(1)

Some link <https://example.org/foo.html>

--include
Testing an included link <https://example.org/included_link.html>.

OPTIONS
--foo-bar
Example link <https://example.org/bar.html>. See other-cmd(1),
local-cmd(1)

2 changes: 1 addition & 1 deletion crates/mdman/tests/compare/expected/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ A description of the command.
my-command --xyz

## SEE ALSO
[other-command(1)](other-command.md) [abc(7)](abc.md)
[other-command(1)](other-command.html) [abc(7)](abc.html)
7 changes: 7 additions & 0 deletions crates/mdman/tests/compare/includes/links-include.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Some link](foo.html)

{{#options}}
{{#option "`--include`"}}
Testing an [included link](included_link.html).
{{/option}}
{{/options}}
14 changes: 14 additions & 0 deletions crates/mdman/tests/compare/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ Shortcut unknown: [shortcut unknown]

{{man "local-cmd" 1}}

{{> links-include}}

## OPTIONS

{{#options}}

{{#option "`--foo-bar`"}}
Example [link](bar.html).
See {{man "other-cmd" 1}}, {{man "local-cmd" 1}}
{{/option}}

{{/options}}


[bar]: https://example.com/bar
[collapsed]: https://example.com/collapsed
[shortcut]: https://example.com/shortcut
3 changes: 2 additions & 1 deletion src/bin/cargo/commands/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ pub fn cli() -> App {
)
.arg_features()
.arg_target_triple(
"Filter dependencies matching the given target-triple (default host platform)",
"Filter dependencies matching the given target-triple (default host platform). \
Pass `all` to include all targets.",
)
.arg(
Arg::with_name("no-dev-dependencies")
Expand Down
1 change: 1 addition & 0 deletions src/cargo/core/compiler/context/compilation_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ fn compute_metadata(
// settings like debuginfo and whatnot.
unit.profile.hash(&mut hasher);
unit.mode.hash(&mut hasher);
cx.lto[unit].hash(&mut hasher);

// Artifacts compiled for the host should have a different metadata
// piece than those compiled for the target, so make sure we throw in
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
let mut queue = JobQueue::new(self.bcx);
let mut plan = BuildPlan::new();
let build_plan = self.bcx.build_config.build_plan;
self.lto = super::lto::generate(&self.bcx)?;
self.prepare_units()?;
self.prepare()?;
custom_build::build_map(&mut self)?;
super::lto::generate(&mut self)?;
self.check_collistions()?;

for unit in &self.bcx.roots {
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
//! -C incremental=… flag | ✓ |
//! mtime of sources | ✓[^3] |
//! RUSTFLAGS/RUSTDOCFLAGS | ✓ |
//! LTO flags | ✓ |
//! LTO flags | ✓ |
//! config settings[^5] | ✓ |
//! is_std | | ✓
//!
Expand Down
Loading

0 comments on commit d613cd6

Please sign in to comment.