Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to 0.48.0, update changelog #8508

Merged
merged 3 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 105 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,95 @@
# Changelog

## Cargo 1.47 (2020-10-08)
[4f74d9b2...HEAD](https://github.com/rust-lang/cargo/compare/4f74d9b2...HEAD)

### Added

### Changed
- The comments added to `.gitignore` when it is modified have been tweaked to
add some spacing.
[#8476](https://github.com/rust-lang/cargo/pull/8476)
- `cargo metadata` output should now be sorted to be deterministic.
[#8489](https://github.com/rust-lang/cargo/pull/8489)
- By default, build scripts and proc-macros are now built with `opt-level=0`
and the default codegen units, even in release mode.
[#8500](https://github.com/rust-lang/cargo/pull/8500)

### Fixed
- Fixed issue where if a project directory was moved, and one of the
build scripts did not use the `rerun-if-changed` directive, then that
build script was being rebuilt when it shouldn't.
[#8497](https://github.com/rust-lang/cargo/pull/8497)

### Nightly only
- Added support for `-Z terminal-width` which tells `rustc` the width of the
terminal so that it can format diagnostics better.
[docs](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#terminal-width)
[#8427](https://github.com/rust-lang/cargo/pull/8427)
- Added ability to configure `-Z` unstable flags in config files via the
`[unstable]` table.
[docs](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html)
[#8393](https://github.com/rust-lang/cargo/pull/8393)
- Added [`-Z build-std-features`] flag to set features for the standard library.
[#8490](https://github.com/rust-lang/cargo/pull/8490)

## Cargo 1.46 (2020-08-27)
[9fcb8c1d...HEAD](https://github.com/rust-lang/cargo/compare/9fcb8c1d...HEAD)
[9fcb8c1d...rust-1.46.0](https://github.com/rust-lang/cargo/compare/9fcb8c1d...rust-1.46.0)

### Added
- The `dl` key in `config.json` of a registry index now supports the
replacement markers `{prefix}` and `{lowerprefix}` to allow spreading crates
across directories similar to how the index itself is structured.
[docs](https://doc.rust-lang.org/nightly/cargo/reference/registries.html#index-format)
[#8267](https://github.com/rust-lang/cargo/pull/8267)
- Added new environment variables that are set during compilation:
- `CARGO_CRATE_NAME`: The name of the crate being built.
- `CARGO_BIN_NAME`: The name of the executable binary (if this is a binary crate).
- `CARGO_PKG_LICENSE`: The `license` field from the manifest.
- `CARGO_PKG_LICENSE_FILE`: The `license-file` field from the manifest.
[#8270](https://github.com/rust-lang/cargo/pull/8270)
[#8325](https://github.com/rust-lang/cargo/pull/8325)
[#8387](https://github.com/rust-lang/cargo/pull/8387)
- If the value for `readme` is not specified in `Cargo.toml`, it is now
automatically inferred from the existence of a file named `README`,
`README.md`, or `README.txt`. This can be suppressed by setting
`readme = false`.
[#8277](https://github.com/rust-lang/cargo/pull/8277)
- `cargo install` now supports the `--index` flag to install directly from an index.
[#8344](https://github.com/rust-lang/cargo/pull/8344)
- Added the `metadata` table to the `workspace` definition in `Cargo.toml`.
This can be used for arbitrary data similar to the `package.metadata` table.
[#8323](https://github.com/rust-lang/cargo/pull/8323)
- Added the `--target-dir` flag to `cargo install` to set the target directory.
[#8391](https://github.com/rust-lang/cargo/pull/8391)
- Changes to environment variables used by the
[`env!`](https://doc.rust-lang.org/std/macro.env.html) or
[`option_env!`](https://doc.rust-lang.org/std/macro.option_env.html) macros
are now automatically detected to trigger a rebuild.
[#8421](https://github.com/rust-lang/cargo/pull/8421)
- The `target` directory now includes the `CACHEDIR.TAG` file which is used by
some tools to exclude the directory from backups.
[#8378](https://github.com/rust-lang/cargo/pull/8378)
- Added docs about rustup's `+toolchain` syntax.
[#8455](https://github.com/rust-lang/cargo/pull/8455)

### Changed
- A warning is now displayed if a git dependency includes a `#` fragment in
the URL. This was potentially confusing because Cargo itself displays git
URLs with this syntax, but it does not have any meaning outside of the
`Cargo.lock` file, and would not work properly.
[#8297](https://github.com/rust-lang/cargo/pull/8297)
- Various optimizations and fixes for bitcode embedding and LTO.
[#8349](https://github.com/rust-lang/cargo/pull/8349)
- Reduced the amount of data fetched for git dependencies. If Cargo knows the
branch or tag to fetch, it will now only fetch that branch or tag instead of
all branches and tags.
[#8363](https://github.com/rust-lang/cargo/pull/8363)
- Enhanced git fetch error messages.
[#8409](https://github.com/rust-lang/cargo/pull/8409)
- `.crate` files are now generated with GNU tar format instead of UStar, which
supports longer file names.
[#8453](https://github.com/rust-lang/cargo/pull/8453)

### Fixed
- Fixed a rare situation where an update to `Cargo.lock` failed once, but then
Expand All @@ -22,6 +101,27 @@
- Updated libgit2, which brings in a fix for zlib errors for some remote
git servers like googlesource.com.
[#8320](https://github.com/rust-lang/cargo/pull/8320)
- Fixed the GitHub fast-path check for up-to-date git dependencies on
non-master branches.
[#8363](https://github.com/rust-lang/cargo/pull/8363)
- Fixed issue when enabling a feature with `pkg/feature` syntax, and `pkg` is
an optional dependency, but also a dev-dependency, and the dev-dependency
appears before the optional normal dependency in the registry summary, then
the optional dependency would not get activated.
[#8395](https://github.com/rust-lang/cargo/pull/8395)
- Fixed `clean -p` deleting the build directory if there is a test named
`build`.
[#8398](https://github.com/rust-lang/cargo/pull/8398)
- Fixed indentation of multi-line Cargo error messages.
[#8409](https://github.com/rust-lang/cargo/pull/8409)
- Fixed issue where the automatic inclusion of the `--document-private-items`
flag for rustdoc would override any flags passed to the `cargo rustdoc`
command.
[#8449](https://github.com/rust-lang/cargo/pull/8449)
- Cargo will now include a version in the hash of the fingerprint directories
to support backwards-incompatible changes to the fingerprint structure.
[#8473](https://github.com/rust-lang/cargo/pull/8473)
[#8488](https://github.com/rust-lang/cargo/pull/8488)

### Nightly only
- Added `-Zrustdoc-map` feature which provides external mappings for rustdoc
Expand All @@ -31,7 +131,10 @@
- Fixed feature calculation when a proc-macro is declared in `Cargo.toml` with
an underscore (like `proc_macro = true`).
[#8319](https://github.com/rust-lang/cargo/pull/8319)

- Added support for setting `-Clinker` with `-Zdoctest-xcompile`.
[#8359](https://github.com/rust-lang/cargo/pull/8359)
- Fixed setting the `strip` profile field in config files.
[#8454](https://github.com/rust-lang/cargo/pull/8454)

## Cargo 1.45 (2020-07-16)
[ebda5065e...rust-1.45.0](https://github.com/rust-lang/cargo/compare/ebda5065...rust-1.45.0)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo"
version = "0.47.0"
version = "0.48.0"
edition = "2018"
authors = ["Yehuda Katz <wycats@gmail.com>",
"Carl Lerche <me@carllerche.com>",
Expand Down
10 changes: 0 additions & 10 deletions src/cargo/core/compiler/build_context/target_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ pub struct TargetInfo {
pub rustflags: Vec<String>,
/// Extra flags to pass to `rustdoc`, see `env_args`.
pub rustdocflags: Vec<String>,
/// Remove this when it hits stable (1.45)
pub supports_embed_bitcode: Option<bool>,
}

/// Kind of each file generated by a Unit, part of `FileType`.
Expand Down Expand Up @@ -143,13 +141,6 @@ impl TargetInfo {
.args(&rustflags)
.env_remove("RUSTC_LOG");

let mut embed_bitcode_test = process.clone();
embed_bitcode_test.arg("-Cembed-bitcode");
let supports_embed_bitcode = match kind {
CompileKind::Host => Some(rustc.cached_output(&embed_bitcode_test).is_ok()),
_ => None,
};

if let CompileKind::Target(target) = kind {
process.arg("--target").arg(target.rustc_target());
}
Expand Down Expand Up @@ -240,7 +231,6 @@ impl TargetInfo {
"RUSTDOCFLAGS",
)?,
cfg,
supports_embed_bitcode,
})
}

Expand Down
25 changes: 2 additions & 23 deletions src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,31 +817,10 @@ fn build_base_args(
}
lto::Lto::ObjectAndBitcode => {} // this is rustc's default
lto::Lto::OnlyBitcode => {
// Note that this compiler flag, like the one below, is just an
// optimization in terms of build time. If we don't pass it then
// both object code and bitcode will show up. This is lagely just
// compat until the feature lands on stable and we can remove the
// conditional branch.
if cx
.bcx
.target_data
.info(CompileKind::Host)
.supports_embed_bitcode
.unwrap()
{
cmd.arg("-Clinker-plugin-lto");
}
cmd.arg("-Clinker-plugin-lto");
}
lto::Lto::OnlyObject => {
if cx
.bcx
.target_data
.info(CompileKind::Host)
.supports_embed_bitcode
.unwrap()
{
cmd.arg("-Cembed-bitcode=no");
}
cmd.arg("-Cembed-bitcode=no");
}
}

Expand Down
44 changes: 0 additions & 44 deletions tests/testsuite/lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ use std::process::Output;

#[cargo_test]
fn with_deps() {
if !cargo_test_support::is_nightly() {
return;
}

Package::new("bar", "0.0.1").publish();

let p = project()
Expand Down Expand Up @@ -36,10 +32,6 @@ fn with_deps() {

#[cargo_test]
fn shared_deps() {
if !cargo_test_support::is_nightly() {
return;
}

Package::new("bar", "0.0.1").publish();

let p = project()
Expand Down Expand Up @@ -70,10 +62,6 @@ fn shared_deps() {

#[cargo_test]
fn build_dep_not_ltod() {
if !cargo_test_support::is_nightly() {
return;
}

Package::new("bar", "0.0.1").publish();

let p = project()
Expand Down Expand Up @@ -102,10 +90,6 @@ fn build_dep_not_ltod() {

#[cargo_test]
fn complicated() {
if !cargo_test_support::is_nightly() {
return;
}

Package::new("dep-shared", "0.0.1")
.file("src/lib.rs", "pub fn foo() {}")
.publish();
Expand Down Expand Up @@ -233,10 +217,6 @@ fn complicated() {

#[cargo_test]
fn off_in_manifest_works() {
if !cargo_test_support::is_nightly() {
return;
}

Package::new("bar", "0.0.1")
.file("src/lib.rs", "pub fn foo() {}")
.publish();
Expand Down Expand Up @@ -284,10 +264,6 @@ fn off_in_manifest_works() {

#[cargo_test]
fn between_builds() {
if !cargo_test_support::is_nightly() {
return;
}

let p = project()
.file(
"Cargo.toml",
Expand Down Expand Up @@ -325,10 +301,6 @@ fn between_builds() {

#[cargo_test]
fn test_all() {
if !cargo_test_support::is_nightly() {
return;
}

let p = project()
.file(
"Cargo.toml",
Expand All @@ -352,10 +324,6 @@ fn test_all() {

#[cargo_test]
fn test_all_and_bench() {
if !cargo_test_support::is_nightly() {
return;
}

let p = project()
.file(
"Cargo.toml",
Expand Down Expand Up @@ -495,9 +463,6 @@ fn verify_lto(output: &Output, krate: &str, krate_info: &str, expected_lto: Lto)

#[cargo_test]
fn cdylib_and_rlib() {
if !cargo_test_support::is_nightly() {
return;
}
let p = project_with_dep("'cdylib', 'rlib'");
let output = p.cargo("build --release -v").exec_with_output().unwrap();
verify_lto(
Expand Down Expand Up @@ -564,9 +529,6 @@ fn cdylib_and_rlib() {

#[cargo_test]
fn dylib() {
if !cargo_test_support::is_nightly() {
return;
}
let p = project_with_dep("'dylib'");
let output = p.cargo("build --release -v").exec_with_output().unwrap();
verify_lto(&output, "registry", "--crate-type lib", Lto::OnlyObject);
Expand Down Expand Up @@ -623,9 +585,6 @@ fn dylib() {

#[cargo_test]
fn test_profile() {
if !cargo_test_support::is_nightly() {
return;
}
Package::new("bar", "0.0.1")
.file("src/lib.rs", "pub fn foo() -> i32 { 123 } ")
.publish();
Expand Down Expand Up @@ -677,9 +636,6 @@ fn test_profile() {

#[cargo_test]
fn dev_profile() {
if !cargo_test_support::is_nightly() {
return;
}
// Mixing dev=LTO with test=not-LTO
Package::new("bar", "0.0.1")
.file("src/lib.rs", "pub fn foo() -> i32 { 123 } ")
Expand Down
6 changes: 0 additions & 6 deletions tests/testsuite/rustc_info_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ use std::env;

#[cargo_test]
fn rustc_info_cache() {
// Needs `-Cbitcode-in-rlib` to ride to stable before this can be enabled
// everywhere.
if !cargo_test_support::is_nightly() {
return;
}

let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.build();
Expand Down