169 KiB
Changelog
Cargo 1.69 (2023-04-20)
Added
- Cargo now suggests
cargo fix
orcargo clippy --fix
when compilation warnings/errors can be auto-fixed. #11558
Changed
- ❗ When
default-features
is set to false of a workspace dependency, and an inherited dependency of a member hasdefault-features = true
, Cargo will enable default features of that dependency. #11409 cargo add
now checks only the order of[dependencies]
without considering[dependencies.*]
. #11612- Several documentation improvements. #11576 #11604 #11620 #11603
Fixed
- Fixed build scripts triggering recompiles when a
rerun-if-changed
points to a directory whose mtime is not preserved by the filesystem. #11613 - Fixed panics when using dependencies from
[workspace.dependencies]
for[patch]
. This usage is not supposed to be supported. #11565
Nightly only
Cargo 1.68 (2023-03-09)
Added
- 🎉 The new "sparse" protocol has been stabilized. It should provide a significant performance improvement when accessing crates.io. (RFC 2789) (docs) #11224 #11480
- 🎉
home
crate is now a subcrate inrust-lang/cargo
repository. Welcome! #11359 #11481 - Long diagnostic messages now can be truncated to be more readable. #11494
- Shows the progress of crates.io index update even when
net.git-fetch-with-cli
enabled. #11579 cargo build --verbose
tells you more about why it recompiles. #11407- Cargo's file locking mechanism now supports Solaris by using
fcntl
. #11439 #11474 - Added a new SemVer compatibility rule explaining the expectations around diagnostic lints #11596
cargo vendor
generates a different source replacement entry for each revision from the same git repository. #10690- Cargo contributors can relabel issues via triagebot. doc #11498
- Cargo contributors can write tests in containers. #11583
Changed
- Cargo now by default saves credentials to
.cargo/credentials.toml
. If.cargo/credentials
exists, writes to it for backward compatibility reasons. #11533 - To prevent sensitive data from being logged, Cargo introduces a new wrapper type internally. #11545
- Several documentation improvements. #11475 #11504 #11516 #11517 #11568 #11586 #11592
Fixed
- ❗
cargo package
andcargo publish
now respects workspace'sCargo.lock
. This is an expected behavior but previously got overlooked. #11477 - Fixed
cargo vendor
failing on resolving git dependencies inherited from a workspace. #11414 cargo install
can now correctly install root package whenworkspace.default-members
is specified. #11067- Fixed panic on target specific dependency errors. #11541
- Shows
--help
if there is no man page for a subcommand. #11473 - Setting
target.cfg(…).rustflags
shouldn't erasebuild.rustdocflags
. #11323 - Unsupported
profile.split-debuginfo
options are now ignored, which previously made Cargo fail to compile on certain platforms. #11347 #11633
Nightly only
- Implemented a inital support of asymmetric token authentication for registries. (RFC 3231) (docs) #10771
- Do not error for
auth-required: true
without-Z sparse-registry
#11661 - Supports
codegen-backend
andrustflags
in profiles in config file. #11562 - Suggests
cargo clippy --fix
when warnings/errors could be fixed with clippy. #11399 - Fixed artifact deps not working when target field specified coexists with
optional = true
. #11434 - Make Cargo distinguish
Unit
s with and without artifact targets. #11478 cargo metadata
supports artifact dependencies. #11550- Allows builds of some crate to fail during optional doc-scraping. #11450
- Add warning if potentially-scrapable examples are skipped due to dev-dependencies. #11503
- Don't scrape examples from library targets by default. #11499
- Fixed examples of proc-macro crates being scraped for examples. #11497
Cargo 1.67 (2023-01-26)
Added
cargo remove
now cleans up the referenced dependency of the root workspace manifest,profile
,patch
, andreplace
sections after a successful removal of a dependency. #11194 #11242 #11351cargo package
andcargo publish
now report total and compressed crate size after packaging. #11270
Changed
- ❗ Cargo now reuses the value of
$CARGO
if it's already set in the environment, and forwards the value when executing external subcommands and build scripts. #11285 - ❗ Cargo now emits an error when running
cargo update --precise
without a-p
flag. #11349 - ❗ Cargo now emits an error if there are multiple registries in the configuration with the same index URL. #10592
- Cargo now is aware of compression ratio when extracting crate files. This relaxes the hard size limit introduced in 1.64.0 to mitigate zip bomb attack. #11337
- Cargo now errors out when
cargo fix
on a git repo with uncommitted changes. #11400 - Cargo now warns when
cargo tree -i <spec>
cannot find any package. #11377 - Cargo now warns when running
cargo new/init
andPATH
env separator is in the project path. #11318 - Better error messages when multiple packages were found and
cargo add/remove
gets confused. #11186 #11375 - A better error message when
cargo init
but existing ignore files aren't UTF-8. #11321 - A better error message for
cargo install .
. #11401 - A better warning when the same file path found in multiple build targets. #11299
- Updated the internal HTTP library libcurl with various fixes and updates. #11307 #11326
Fixed
- Fixed
cargo clean
for removing fingerprints and build script artifacts of only the requested package #10621 - Fixed
cargo install --index
not working when configregistry.default
is set. #11302 - Fixed git2 safe-directory accidentally disabled when no network configuration was found. #11366
- Migrate from crate
atty
to resolve potential soundness issue. #11420 - Cleans stale git temp files left when libgit2 indexing is interrupted. #11308
Nightly only
- Suggests
cargo fix
when some compilation warnings/errors can be auto-fixed. #10989 #11368 - Changed
rustdoc-scrape-examples
to be a target-level configuration. #10343 #11425 #11430 #11445 - Propagates change of artifact bin dependency to its parent fingerprint. #11353
- Fixed
wait-for-publish
to work with sparse registry. #11356 #11327 #11388 - Stores the
sparse+
prefix in theSourceId
for sparse registries #11387 #11403 - Implemented alternative registry authentication support. (RFC 3139) (docs) #10592
- Added documentation of config option
registries.crates-io.protocol
. #11350
Cargo 1.66.1 (2023-01-10)
Fixed
- CVE-2022-46176: Added validation of SSH host keys for git URLs. See the docs for more information on how to configure the known host keys.
Cargo 1.66 (2022-12-15)
Added
- 🎉 Added
cargo remove
command for removing dependencies fromCargo.toml
. docs #11059 #11099 #11193 #11204 #11227 - Added support for git dependencies having git submodules with relative paths. #11106
- Cargo now sends requests with a
Accept-Encoding
header to registries. #11292 - Cargo now forwards non-UTF8 arguments to external subcommands. #11118
Changed
- ❗ Disambiguate source replacements from various angles.
RFC-3289
#10907
- When the crates-io source is replaced, the user is required to specify which registry to use with
--registry <NAME>
when performing an API operation. - Publishing to source-replaced crates.io is no longer permitted using the crates.io token (
registry.token
). - In source replacement, the
replace-with
key can reference the name of an alternative registry in the[registries]
table.
- When the crates-io source is replaced, the user is required to specify which registry to use with
- ❗
cargo publish
now blocks until it sees the published package in the index. #11062 #11210 #11216 #11255 - Cargo now uses the clap v4 library for command-line argument parsing. #11116 #11119 #11159 #11190 #11239 #11280
- Cargo now only warns on a user-defined alias shadowing an external command. #11170
- Several documentation improvements. #10770 #10938 #11082 #11093 #11157 #11185 #11207 #11219 #11240 #11241 #11282
Fixed
- ❗ Config file loaded via
cargo --config <file>
now takes priority over environment variables. This is a documented behaviour but the old implementation accidentally got it wrong. #11077 - ❗ Cargo collects rustflags in
target.cfg(…).rustflags
more correctly and warns if that's not enough for convergence. #11114 - Final artifacts not removed by linker should be removed before a compilation gets started. #11122
cargo add
now reports unknown features in a more discoverable manner. #11098- Cargo now reports command aliasing failure with more error contexts. #11087
- A better error message when
cargo login
prompt receives empty input. #11145 - A better error message for fields with wrong types where workspace inheritance is supported. #11113
- A better error message when mixing feature syntax
dep:
with/
. #11172 - A better error message when publishing but
package.publish
isfalse
in the manifest. #11280
Nightly only
- Added new config option
publish.timeout
behind-Zpublish-timeout
. docs #11230 - Added retry support to sparse registries. #11069
- Fixed sparse registry lockfile urls containing
registry+sparse+
. #11177 - Add new config option
registries.crates-io.protocol
for controlling crates.io protocol. #11215 - Removed
sparse+
prefix for index.crates.io. #11247 - Fixed publishing with a dependency on a sparse registry. #11268
- Fixed confusing error messages when using
-Zsparse-registry
. #11283 - Fixed 410 gone response handling for sparse registries. #11286
Cargo 1.65 (2022-11-03)
Added
- External subcommands can now inherit jobserver file descriptors from Cargo. #10511
- Added an API documentation for private items in cargo-the-library. See https://doc.rust-lang.org/nightly/nightly-rustc/cargo. #11019
Changed
- Cargo now stops adding its bin path to
PATH
if it's already there. #11023 - Improved the performance of Cargo build scheduling by sorting the queue of pending jobs. #11032
- Improved the performance fetching git dependencies from GitHub even
when using a partial hash in the
rev
field. #10807 - Cargo now uses git2 v0.15 and libgit2-sys v0.14, which bring several compatibility fixes with git's new behaviors. #11004
- Registry index files are cached in a more granular way based on content hash. #11044
- Cargo now uses the standard library's
std::thread::scope
instead of thecrossbeam
crate for spawning scoped threads. #10977 - Cargo now uses the standard library's
available_parallelism
instead of thenum_cpus
crate for determining the default parallelism. #10969 - Cargo now guides you how to solve it when seeing an error message of
rust-version
requirement not satisfied. #10891 - Cargo now tells you more about possible causes and how to fix it when a subcommand cannot be found. #10924
- Cargo now lists available target names when a given Cargo target cannot be found. #10999
cargo update
now warns if--precise
is given without--package
flag. This will become a hard error after a transition period. #10988 #11011cargo bench
andcargo test
now report a more precise test execution error right after a test fails. #11028cargo add
now tells you for which version the features are added. #11075- Call out that non-ASCII crate names are not supported by Rust anymore. #11017
- Enhanced the error message when in the manifest a field is expected to be an array but a string is used. #10944
Fixed
- Removed the restriction on file locking supports on platforms other than Linux. #10975
- Fixed incorrect OS detection by bumping os_info to 3.5.0. #10943
- Scanning the package directory now ignores errors from broken but excluded symlink files. #11008
- Fixed deadlock when build scripts are waiting for input on stdin. #11257
Nightly
- Progress indicator for sparse registries becomes more straightforward. #11068
Cargo 1.64 (2022-09-22)
Added
- 🎉 Packages can now inherit settings from the workspace so that the settings
can be centralized in one place. See
workspace.package
andworkspace.dependencies
for more details on how to define these common settings. #10859 - Added the
--crate-type
flag tocargo rustc
to override the crate type. #10838 - Cargo commands can now accept multiple
--target
flags to build for multiple targets at once, and thebuild.target
config option may now take an array of multiple targets. #10766 - The
--jobs
argument can now take a negative number to count backwards from the max CPUs. #10844
Changed
- Bash completion of
cargo install --path
now supports path completion. #10798 - Significantly improved the performance fetching git dependencies from GitHub
when using a hash in the
rev
field. #10079 - Published packages will now include the resolver setting from the workspace to ensure that they use the same resolver when used in isolation. #10911 #10961 #10970
cargo add
will now updateCargo.lock
. #10902- The path in the config output of
cargo vendor
now translates backslashes to forward slashes so that the settings should work across platforms. #10668 - The
workspace.default-members
setting now allows a value of"."
in a non-virtual workspace to refer to the root package. #10784
Fixed
- CVE-2022-36113: Extracting malicious crates can corrupt arbitrary files. #11089 #11088
- CVE-2022-36114: Extracting malicious crates can fill the file system. #11089 #11088
- The
os
output incargo --version --verbose
now supports more platforms. #10802 - Cached git checkouts will now be rebuilt if they are corrupted. This may
happen when using
net.git-fetch-with-cli
and interrupting the clone process. #10829 - Fixed panic in
cargo add --offline
. #10817
Nightly only
- Fixed deserialization of unstable
check-cfg
inconfig.toml
. #10799
Cargo 1.63 (2022-08-11)
Added
- 🎉 Added the
--config
CLI option to pass config options directly on the CLI. #10755 - The
CARGO_PKG_RUST_VERSION
environment variable is now set when compiling a crate if the manifest has therust-version
field set. #10713
Changed
- A warning is emitted when encountering multiple packages with the same name
in a git dependency. This will ignore packages with
publish=false
. #10701 #10767 - Change tracking now uses the contents of a
.json
target spec file instead of its path. This should help avoid rebuilds if the path changes. #10746 - Git dependencies with a submodule configured with the
update=none
strategy in.gitmodules
is now honored, and the submodule will not be fetched. #10717 - Crate files now use a more recent date (Jul 23, 2006 instead of Nov 29, 1973) for deterministic behavior. #10720
- The initial template used for
cargo new
now includes a slightly more realistic test structure that hasuse super::*;
in the test module. #10706 - Updated the internal HTTP library libcurl with various small fixes and updates. #10696
Fixed
- Fix zsh completions for
cargo add
andcargo locate-project
#10810 #10811 - Fixed
-p
being ignored withcargo publish
in the root of a virtual workspace. Some additional checks were also added to generate an error if multiple packages were selected (previously it would pick the first one). #10677 - The human-readable executable name is no longer displayed for
cargo test
when using JSON output. #10691
Nightly only
- Added
-Zcheck-cfg=output
to support build-scripts declaring their supported set ofcfg
values withcargo:rustc-check-cfg
. #10539 -Z sparse-registry
now uses https://index.crates.io/ when accessing crates-io. #10725- Fixed formatting of
.workspace
key incargo add
for workspace inheritance. #10705 - Sparse HTTP registry URLs must now end with a
/
. #10698 - Fixed issue with
cargo add
and workspace inheritance of thedefault-features
key. #10685
Cargo 1.62 (2022-06-30)
Added
- 🎉 Added the
cargo add
command for adding dependencies toCargo.toml
from the command-line. docs #10472 #10577 #10578 - Package ID specs now support
name@version
syntax in addition to the previousname:version
to align with the behavior incargo add
and other tools.cargo install
andcargo yank
also now support this syntax so the version does not need to passed as a separate flag. #10582 #10650 #10597 - Added the CLI option
-F
as an alias of--features
. #10576 - The
git
andregistry
directories in Cargo's home directory (usually~/.cargo
) are now marked as cache directories so that they are not included in backups or content indexing (on Windows). #10553 - Added the
--version
flag tocargo yank
to replace the--vers
flag to be consistent withcargo install
. #10575 - Added automatic
@
argfile support, which will use "response files" if the command-line torustc
exceeds the operating system's limit. #10546 cargo clean
now has a progress bar (if it takes longer than half a second). #10236
Changed
cargo install
no longer generates an error if no binaries were found to install (such as missing required features). #10508cargo test
now passes--target
torustdoc
if the specified target is the same as the host target. #10594cargo doc
now automatically passes-Arustdoc::private-intra-doc-links
when documenting a binary (which automatically includes--document-private-items
). Theprivate-intra-doc-links
lint is only relevant when not documenting private items, which doesn't apply to binaries. #10142- The length of the short git hash in the
cargo --version
output is now fixed to 9 characters. Previously the length was inconsistent between different platforms. #10579 - Attempting to publish a package with a
Cargo.toml.orig
file will now result in an error. The filename would otherwise conflict with the automatically-generated file. #10551
Fixed
- The
build.dep-info-basedir
configuration setting now properly supports the use of..
in the path to refer to a parent directory. #10281 - Fixed regression in automatic detection of the default number of CPUs to use on systems using cgroups v1. #10737 #10739
Nightly only
cargo fetch
now works with-Zbuild-std
to fetch the standard library's dependencies. #10129- Added support for workspace inheritance. docs #10584 #10568 #10565 #10564 #10563 #10606 #10548 #10538
- Added
-Zcheck-cfg
which adds various forms of validatingcfg
expressions for unknown names and values. docs #10486 #10566 - The
--config
CLI option no longer allows setting a registry token. #10580 - Fixed issues with proc-macros and
-Z rustdoc-scrape-examples
. #10549 #10533
Cargo 1.61 (2022-05-19)
Added
Changed
cargo test --no-run
will now display the path to the test executables. #10346cargo tree --duplicates
no longer reports dependencies that are shared between the host and the target as duplicates. #10466- Updated to the 1.4.2 release of libgit2 which brings in several fixes #10442 #10479
cargo vendor
no longer allows multiple values for--sync
, you must pass multiple--sync
flags instead. #10448- Warnings are now issued for manifest keys that have mixed both underscore
and dash variants (such as specifying both
proc_macro
andproc-macro
) #10316 - Cargo now uses the standard library's
available_parallelism
instead of thenum_cpus
crate for determining the default parallelism. #10427 cargo search
terms are now highlighted. #10425
Fixed
- Paths passed to VCS tools like
hg
are now added after--
to avoid conflict with VCS flags. #10483 - Fixed the
http.timeout
configuration value to actually work. #10456 - Fixed issues with
cargo rustc --crate-type
not working in some situations. #10388
Nightly only
- Added
-Z check-cfg-features
to enable compile-time checking of features #10408 - Added
-Z bindeps
to support binary artifact dependencies (RFC-3028) #9992 -Z multitarget
is now supported in thebuild.target
config value with an array. #10473- Added
--keep-going
flag which will continue compilation even if one crate fails to compile. #10383 - Start work on inheriting manifest values in a workspace. #10497 #10517
- Added support for sparse HTTP registries. #10470 #10064
- Fixed panic when artifact target is used for
[target.'cfg(<target>)'.dependencies]
#10433 - Fixed host flags to pass to build scripts (
-Z target-applies-to-host
) #10395 - Added
-Z check-cfg-features
support for rustdoc #10428
Cargo 1.60 (2022-04-07)
Added
- 🎉 Added the
dep:
prefix in the[features]
table to refer to an optional dependency. This allows creating feature names with the same name as a dependency, and allows for "hiding" optional dependencies so that they do not implicitly expose a feature name. docs #10269 - 🎉 Added the
dep-name?/feature-name
syntax to the[features]
table to only enable the featurefeature-name
if the optional dependencydep-name
is already enabled by some other feature. docs #10269 - 🎉 Added
--timings
option to generate an HTML report about build timing, concurrency, and CPU use. docs #10245 - Added the
"v"
and"features2"
fields to the registry index. The"v"
field provides a method for compatibility with future changes to the index. docs #10269 - Added bash completion for
cargo clippy
#10347 - Added bash completion for
cargo report
#10295 - Added support to build scripts for
rustc-link-arg-tests
,rustc-link-arg-examples
, andrustc-link-arg-benches
. docs #10274
Changed
- Cargo now uses the clap 3 library for command-line argument parsing. #10265
- The
build.pipelining
config option is now deprecated, pipelining will now always be enabled. #10258 cargo new
will now generate a.gitignore
which only ignoresCargo.lock
in the root of the repo, instead of any directory. #10379- Improved startup time of bash completion. #10365
- The
--features
flag is now honored when used with the--all-features
flag, which allows enabling features from other packages. #10337 - Cargo now uses a different TOML parser. This should not introduce any
user-visible changes. This paves the way to support format-preserving
programmatic modification of TOML files for supporting
cargo add
and other future enhancements. #10086 - Setting a library to emit both a
dylib
andcdylib
is now an error, as this combination is not supported. #10243 cargo --list
now includes thehelp
command. #10300
Fixed
- Fixed running
cargo doc
on examples with dev-dependencies. #10341 - Fixed
cargo install --path
for a path that is relative to a directory outside of the workspace in the current directory. #10335 cargo test TEST_FILTER
should no longer build binaries that are explicitly disabled withtest = false
. #10305- Fixed regression with
term.verbose
withoutterm.quiet
, and vice versa. #10429 #10436
Nightly only
- Added
rustflags
option to a profile definition. #10217 - Changed
--config
to only support dotted keys. #10176 - Fixed profile
rustflags
not being gated in profile overrides. #10411 #10413
Cargo 1.59 (2022-02-24)
Added
- 🎉 The
strip
option can now be specified in a profile to specify the behavior for removing symbols and debug information from binaries. docs #10088 #10376 - 🎉 Added future incompatible reporting.
This provides reporting for when a future change in
rustc
may cause a package or any of its dependencies to stop building. docs #10165 - SSH authentication on Windows now supports ssh-agent. docs #10248
- Added
term.quiet
configuration option to enable the--quiet
behavior from a config file. docs #10152 - Added
-r
CLI option as an alias for--release
. #10133
Changed
- Scanning the package directory should now be resilient to errors, such as filesystem loops or access issues. #10188 #10214 #10286
cargo help <alias>
will now show the target of the alias. #10193- Removed the deprecated
--host
CLI option. #10145 #10327 - Cargo should now report its version to always be in sync with
rustc
. #10178 - Added EOPNOTSUPP to ignored file locking errors, which is relevant to BSD operating systems. #10157
Fixed
- macOS: Fixed an issue where running an executable would sporadically be killed by the kernel (likely starting in macOS 12). #10196
- Fixed so that the
doc=false
setting is honored in the[lib]
definition of a dependency. #10201 #10324 - The
"executable"
field in the JSON option was incorrectly including the path toindex.html
when documenting a binary. It is now null. #10171 - Documenting a binary now waits for the package library to finish documenting before starting. This fixes some race conditions if the binary has intra-doc links to the library. #10172
- Fixed panic when displaying help text to a closed pipe. #10164
Nightly only
- Added the
--crate-type
flag tocargo rustc
. #10093
Cargo 1.58 (2022-01-13)
Added
- Added
rust_version
field to package data incargo metadata
. #9967 - Added
--message-format
option tocargo install
. #10107
Changed
- A warning is now shown when an alias shadows an external command. #10082
- Updated curl to 7.80.0. #10040 #10106
Fixed
- Doctests now include rustc-link-args from build scripts. #9916
- Fixed
cargo tree
entering an infinite loop with cyclical dev-dependencies. Fixed an edge case where the resolver would fail to handle a cyclical dev-dependency with a feature. #10103 - Fixed
cargo clean -p
when the directory path contains glob characters. #10072 - Fixed debug builds of
cargo
which could panic when downloading a crate when the server has a redirect with a non-empty body. #10048
Nightly only
- Make future-incompat-report output more user-friendly. #9953
- Added support to scrape code examples from the
examples
directory to be included in the documentation. docs #9525 #10037 #10017 - Fixed
cargo report future-incompatibilities
to check stdout if it supports color. #10024
Cargo 1.57 (2021-12-02)
Added
- 🎉 Added custom named profiles. This also changes the
test
andbench
profiles to inherit their settings fromdev
andrelease
, and Cargo will now only use a single profile during a given command instead of using different profiles for dependencies and cargo-targets. docs #9943 - The
rev
option for a git dependency now supports git references that start withrefs/
. An example where this can be used is to depend on a pull request from a service like GitHub before it is merged. #9859 - Added
path_in_vcs
field to the.cargo_vcs_info.json
file. docs #9866
Changed
- ❗
RUSTFLAGS
is no longer set for build scripts. This change was made in 1.55, but the release notes did not highlight this change. Build scripts should useCARGO_ENCODED_RUSTFLAGS
instead. See the documentation for more details. - The
cargo version
command now includes some extra information. #9968 - Updated libgit2 to 1.3 which brings in a number of fixes and changes to git handling. #9963 #9988
- Shell completions now include shorthand b/r/c/d subcommands. #9951
cargo update --precise
now allows specifying a version without semver metadata (stuff after+
in the version number). #9945- zsh completions now complete
--example
names. #9939 - The progress bar now differentiates when building unittests. #9934
- Some backwards-compatibility support for invalid TOML syntax has been removed. #9932
- Reverted the change from 1.55 that triggered an error for dependency specifications that did not include any fields. #9911
Fixed
- Removed a log message (from
CARGO_LOG
) that may leak tokens. #9873 cargo fix
will now avoid writing fixes to the global registry cache. #9938- Fixed
-Z help
CLI option when used with a shorthand alias (b/c/r/d). #9933
Nightly only
Cargo 1.56 (2021-10-21)
Added
- 🎉 Cargo now supports the 2021 edition. More information may be found in the edition guide. #9800
- 🎉 Added the
rust-version
field toCargo.toml
to specify the minimum supported Rust version, and the--ignore-rust-version
command line option to override it. #9732 - Added the
[env]
table to config files to specify environment variables to set. docs #9411 [patch]
tables may now be specified in config files. docs #9839cargo doc
now supports the--example
and--examples
flags. #9808- 🎉 Build scripts can now pass additional linker arguments for binaries or all linkable targets. docs #9557
- Added support for the
-p
flag forcargo publish
to publish a specific package in a workspace.cargo package
also now supports-p
and--workspace
. #9559 - Added documentation about third-party registries. #9830
- Added the
{sha256-checksum}
placeholder for URLs in a registryconfig.json
. docs #9801 - Added a warning when a dependency does not have a library. #9771
Changed
- Doc tests now support the
-q
flag to show terse test output. #9730 features
used in a[replace]
table now issues a warning, as they are ignored. #9681- Changed so that only
wasm32-unknown-emscripten
executables are built without a hash in the filename. Previously it was allwasm32
targets. Additionally, allapple
binaries are now built with a hash in the filename. This allows multiple copies to be cached at once, and matches the behavior on other platforms (exceptmsvc
). #9653 cargo new
now generates an example that doesn't generate a warning with clippy. #9796cargo fix --edition
now only applies edition-specific lints. #9846- Improve resolver message to include dependency requirements. #9827
cargo fix
now has more debug logging available with theCARGO_LOG
environment variable. #9831- Changed
cargo fix --edition
to emit a warning when on the latest stable edition when running on stable instead of generating an error. #9792 cargo install
will now determine all of the packages to install before starting the installation, which should help with reporting errors without partially installing. #9793- The resolver report for
cargo fix --edition
now includes differences for dev-dependencies. #9803 cargo fix
will now show better diagnostics for abnormal errors fromrustc
. #9799- Entries in
cargo --list
are now deduplicated. #9773 - Aliases are now included in
cargo --list
. #9764
Fixed
- Fixed panic with build-std of a proc-macro. #9834
- Fixed running
cargo
recursively from proc-macros while runningcargo fix
. #9818 - Return an error instead of a stack overflow for command alias loops. #9791
- Updated to curl 7.79.1, which will hopefully fix intermittent http2 errors. #9937
Nightly only
- Added
[future-incompat-report]
config section. #9774 - Fixed value-after-table error with custom named profiles. #9789
- Added the
different-binary-name
feature to support specifying a non-rust-identifier for a binary name. docs #9627 - Added a profile option to select the codegen backend. docs #9118
Cargo 1.55 (2021-09-09)
Added
- The package definition in
cargo metadata
now includes the"default_run"
field from the manifest. #9550 - ❗ Build scripts now have access to the following environment variables:
RUSTC_WRAPPER
,RUSTC_WORKSPACE_WRAPPER
,CARGO_ENCODED_RUSTFLAGS
.RUSTFLAGS
is no longer set for build scripts; they should useCARGO_ENCODED_RUSTFLAGS
instead. docs #9601 - Added
cargo d
as an alias forcargo doc
. #9680 - Added
{lib}
to thecargo tree --format
option to display the library name of a package. #9663 - Added
members_mut
method to theWorkspace
API. #9547
Changed
- If a build command does not match any targets when using the
--all-targets
,--bins
,--tests
,--examples
, or--benches
flags, a warning is now displayed to inform you that there were no matching targets. #9549 - The way
cargo init
detects whether or not existing source files represent a binary or library has been changed to respect the command-line flags instead of trying to guess which type it is. #9522 - Registry names are now displayed instead of registry URLs when possible. #9632
- Duplicate compiler diagnostics are no longer shown. This can often happen
with
cargo test
which builds multiple copies of the same code in parallel. This also updates the warning summary to provide more context. #9675 - The output for warnings or errors is now improved to be leaner, cleaner, and show more context. #9655
- Network send errors are now treated as "spurious" which means they will be retried. #9695
- Git keys (
branch
,tag
,rev
) on a non-git dependency are now an error. Additionally, specifying bothgit
andpath
is now an error. #9689 - Specifying a dependency without any keys is now an error. #9686
- The resolver now prefers to use
[patch]
table entries of dependencies when possible. #9639 - Package name typo errors in dependencies are now displayed aligned with the original to help make it easier to see the difference. #9665
- Windows platforms may now warn on environment variables that have the wrong case. #9654
features
used in a[patch]
table now issues a warning, as they are ignored. #9666- The
target
directory is now excluded from content indexing on Windows. #9635 - When
Cargo.toml
is not found, the error message now detects if it was misnamed with a lowercasec
to suggest the correct form. #9607 - Building
diesel
with the new resolver displays a compatibility notice. #9602 - Updated the
opener
dependency, which handles opening a web browser, which includes several changes, such as new behavior when run on WSL, and using the systemxdg-open
on Linux. #9583 - Updated to libcurl 7.78. #9809 #9810
Fixed
- Fixed dep-info files including non-local build script paths. #9596
- Handle "jobs = 0" case in cargo config files #9584
- Implement warning for ignored trailing arguments after
--
#9561 - Fixed rustc/rustdoc config values to be config-relative. #9566
cargo fix
now supports rustc's suggestions with multiple spans. #9567cargo fix
now fixes each target serially instead of in parallel to avoid problems with fixing the same file concurrently. #9677- Changes to the target
linker
config value now trigger a rebuild. #9647 - Git unstaged deleted files are now ignored when using the
--allow-dirty
flag withcargo publish
orcargo package
. #9645
Nightly only
- Enabled support for
cargo fix --edition
for 2021. #9588 - Several changes to named profiles. #9685
- Extended instructions on what to do when running
cargo fix --edition
on the 2021 edition. #9694 - Multiple updates to error messages using nightly features to help better explain the situation. #9657
- Adjusted the edition 2021 resolver diff report. #9649
- Fixed error using
cargo doc --open
withdoc.extern-map
. #9531 - Unified weak and namespaced features. #9574
- Various updates to future-incompatible reporting. #9606
[env]
environment variables are not allowed to set vars set by Cargo. #9579
Cargo 1.54 (2021-07-29)
Added
- Fetching from a git repository (such as the crates.io index) now displays the network transfer rate. #9395
- Added
--prune
option forcargo tree
to limit what is displayed. #9520 - Added
--depth
option forcargo tree
to limit what is displayed. #9499 - Added
cargo tree -e no-proc-macro
to hide procedural macro dependencies. #9488 - Added
doc.browser
config option to set which browser to open withcargo doc --open
. #9473 - Added
CARGO_TARGET_TMPDIR
environment variable set for integration tests & benches. This provides a temporary or "scratch" directory in thetarget
directory for tests and benches to use. #9375
Changed
--features
CLI flags now provide typo suggestions with the new feature resolver. #9420- Cargo now uses a new parser for SemVer versions. This should behave mostly the same as before with some minor exceptions where invalid syntax for version requirements is now rejected. #9508
- Mtime handling of
.crate
published packages has changed slightly to avoid mtime values of 0. This was causing problems with lldb which refused to read those files. #9517 - Improved performance of git status check in
cargo package
. #9478 cargo new
with fossil now places the ignore settings in the new repository instead of usingfossil settings
to set them globally. This also includes several other cleanups to make it more consistent with other VCS configurations. #9469rustc-cdylib-link-arg
applying transitively displays a warning that this was not intended, and may be an error in the future. #9563
Fixed
- Fixed
package.exclude
inCargo.toml
using inverted exclusions (!somefile
) when not in a git repository or when vendoring a dependency. #9186 - Dep-info files now adjust build script
rerun-if-changed
paths to be absolute paths. #9421 - Fixed a bug when with resolver = "1" non-virtual package was allowing unknown features. #9437
- Fixed an issue with the index cache mishandling versions that only
differed in build metadata (such as
110.0.0
and110.0.0+1.1.0f
). #9476 - Fixed
cargo install
with a semver metadata version. #9467
Nightly only
- Added
report
subcommand, and changedcargo describe-future-incompatibilitie
tocargo report future-incompatibilities
. #9438 - Added a
[host]
table to the config files to be able to set build flags for host target. Also addedtarget-applies-to-host
to control how the[target]
tables behave. #9322 - Added some validation to build script
rustc-link-arg-*
instructions to return an error if the target doesn't exist. #9523 - Added
cargo:rustc-link-arg-bin
instruction for build scripts. #9486
Cargo 1.53 (2021-06-17)
Added
Changed
- 🔥 Cargo now supports git repositories where the default
HEAD
branch is not "master". This also includes a switch to the version 3Cargo.lock
format which can handle default branches correctly. #9133 #9397 #9384 #9392 - 🔥 macOS targets now default to
unpacked
split-debuginfo. #9298 - ❗ The
authors
field is no longer included inCargo.toml
for new projects. #9282 cargo update
may now work with the--offline
flag. #9279cargo doc
will now erase thedoc
directory when switching between different toolchain versions. There are shared, unversioned files (such as the search index) that can become broken when using different versions. #8640 #9404- Improved error messages when path dependency/workspace member is missing. #9368
Fixed
- Fixed
cargo doc
detecting if the documentation needs to be rebuilt when changing some settings such as features. #9419 cargo doc
now deletes the output directory for the package before running rustdoc to clear out any stale files. #9419- Fixed the
-C metadata
value to always include all information for all builds. Previously, in some situations, the hash only included the package name and version. This fixes some issues, such as incremental builds with split-debuginfo on macOS corrupting the incremental cache in some cases. #9418 - Fixed man pages not working on Windows if
man
is inPATH
. #9378 - The
rustc
cache is now aware ofRUSTC_WRAPPER
andRUSTC_WORKSPACE_WRAPPER
. #9348 - Track the
CARGO
environment variable in the rebuild fingerprint if the code usesenv!("CARGO")
. #9363
Nightly only
- Fixed config includes not working. #9299
- Emit note when
--future-incompat-report
had nothing to report. #9263 - Error messages for nightly features flags (like
-Z
andcargo-features
) now provides more information. #9290 - Added the ability to set the target for an individual package in
Cargo.toml
. docs #9030 - Fixed build-std updating the index on every build. #9393
-Z help
now displays all the-Z
options. #9369- Added
-Zallow-features
to specify which nightly features are allowed to be used. #9283 - Added
cargo config
subcommand. #9302
Cargo 1.52 (2021-05-06)
Added
Changed
- Build scripts are now forbidden from setting
RUSTC_BOOTSTRAP
on stable. #9181 #9385 - crates.io now supports SPDX 3.11 licenses. #9209
- An error is now reported if
CARGO_TARGET_DIR
is an empty string. #8939 - Doc tests now pass the
--message-format
flag into the test so that the "short" format can now be used for doc tests. #9128 cargo test
now prints a clearer indicator of which target is currently running. #9195- The
CARGO_TARGET_<TRIPLE>
environment variable will now issue a warning if it is using lowercase letters. #9169
Fixed
- Fixed publication of packages with metadata and resolver fields in
Cargo.toml
. #9300 #9304 - Fixed logic for determining prefer-dynamic for a dylib which differed in a workspace vs a single package. #9252
- Fixed an issue where exclusive target-specific dependencies that overlapped across dependency kinds (like regular and build-dependencies) would incorrectly include the dependencies in both. #9255
- Fixed panic with certain styles of Package IDs when passed to the
-p
flag. #9188 - When running cargo with output not going to a TTY, and with the progress bar and color force-enabled, the output will now correctly clear the progress line. #9231
- Error instead of panic when JSON may contain non-utf8 paths. #9226
- Fixed a hang that can happen on broken stderr. #9201
- Fixed thin-local LTO not being disabled correctly when
lto=off
is set. #9182
Nightly only
- The
strip
profile option now supportstrue
andfalse
values. #9153 cargo fix --edition
now displays a report when switching to 2021 if the new resolver changes features. #9268- Added
[patch]
table support in.cargo/config
files. #9204 - Added
cargo describe-future-incompatibilities
for generating a report on dependencies that contain future-incompatible warnings. #8825 - Added easier support for testing the 2021 edition. #9184
- Switch the default resolver to "2" in the 2021 edition. #9184
cargo fix --edition
now supports 2021. #9184- Added
--print
flag tocargo rustc
to pass along torustc
to display information from rustc. #9002 - Added
-Zdoctest-in-workspace
for changing the directory where doctests are run versus where they are compiled. #9105 - Added support for an
[env]
section in.cargo/config.toml
to set environment variables when running cargo. #9175 - Added a schema field and
features2
field to the index. #9161 - Changes to JSON spec targets will now trigger a rebuild. #9223
Cargo 1.51 (2021-03-25)
Added
- 🔥 Added the
split-debuginfo
profile option. docs #9112 - Added the
path
field tocargo metadata
for the package dependencies list to show the path for "path" dependencies. #8994 - 🔥 Added a new feature resolver, and new CLI feature flag behavior. See the
new features
and resolver
documentation for the
resolver = "2"
option. See the CLI and resolver 2 CLI options for the new CLI behavior. And, finally, see RFC 2957 for a detailed look at what has changed. #8997
Changed
cargo install --locked
now emits a warning ifCargo.lock
is not found. #9108- Unknown or ambiguous package IDs passed on the command-line now display suggestions for the correct package ID. #9095
- Slightly optimize
cargo vendor
#8937 #9131 #9132
Fixed
- Fixed environment variables and cfg settings emitted by a build script that
are set for
cargo test
andcargo run
when the build script runs multiple times during the same build session. #9122 - Fixed a panic with
cargo doc
and the new feature resolver. This also introduces some heuristics to try to avoid path collisions withrustdoc
by only documenting one variant of a package if there are multiple (such as multiple versions, or the same package shared for host and target platforms). #9077 - Fixed a bug in Cargo's cyclic dep graph detection that caused a stack overflow. #9075
- Fixed build script
links
environment variables (DEP_*
) not showing up for testing packages in some cases. #9065 - Fixed features being selected in a nondeterministic way for a specific
scenario when building an entire workspace with all targets with a
proc-macro in the workspace with
resolver="2"
. #9059 - Fixed to use
http.proxy
setting in~/.gitconfig
. #8986 - Fixed --feature pkg/feat for V1 resolver for non-member. #9275 #9277
- Fixed panic in
cargo doc
when there are colliding output filenames in a workspace. #9276 #9277 - Fixed
cargo install
from exiting with success if one of several packages did not install successfully. #9185 #9196 - Fix panic with doc collision orphan. #9142 #9196
Nightly only
- Removed the
publish-lockfile
unstable feature, it was stabilized without the need for an explicit flag 1.5 years ago. #9092 - Added better diagnostics, help messages, and documentation for nightly
features (such as those passed with the
-Z
flag, or specified withcargo-features
inCargo.toml
). #9092 - Added support for Rust edition 2021. #8922
- Added support for the
rust-version
field in project metadata. #8037 - Added a schema field to the index. #9161 #9196
Cargo 1.50 (2021-02-11)
Added
- Added the
doc
field tocargo metadata
, which indicates if a target is documented. #8869 - Added
RUSTC_WORKSPACE_WRAPPER
, an alternate RUSTC wrapper that only runs for the local workspace packages, and caches its artifacts independently of non-wrapped builds. #8976 - Added
--workspace
tocargo update
to update only the workspace members, and not their dependencies. This is particularly useful if you update the version inCargo.toml
and want to updateCargo.lock
without running any other commands. #8725
Changed
.crate
files uploaded to a registry are now built with reproducible settings, so that the same.crate
file created on different machines should be identical. #8864- Git dependencies that specify more than one of
branch
,tag
, orrev
are now rejected. #8984 - The
rerun-if-changed
build script directive can now point to a directory, in which case Cargo will check if any file in that directory changes. #8973 - If Cargo cannot determine the username or email address,
cargo new
will no longer fail, and instead create an empty authors list. #8912 - The progress bar width has been reduced to provide more room to display the crates currently being built. #8892
cargo new
will now supportincludeIf
directives in.gitconfig
to match the correct directory when determining the username and email address. #8886
Fixed
- Fixed
cargo metadata
andcargo tree
to only download packages for the requested target. #8987 - Updated libgit2, which brings in many fixes, particularly fixing a zlib error that occasionally appeared on 32-bit systems. #8998
- Fixed stack overflow with a circular dev-dependency that uses the
links
field. #8969 - Fixed
cargo publish
failing on some filesystems, particularly 9p on WSL2. #8950
Nightly only
- Allow
resolver="1"
to specify the original feature resolution behavior. #8857 - Added
-Z extra-link-arg
which adds thecargo:rustc-link-arg-bins
andcargo:rustc-link-arg
build script options. docs #8441 - Implemented external credential process support, and added
cargo logout
. (RFC 2730) (docs) #8934 - Fix panic with
-Zbuild-std
and no roots. #8942 - Set docs.rs as the default extern-map for crates.io #8877
Cargo 1.49 (2020-12-31)
Added
- Added
homepage
anddocumentation
fields tocargo metadata
. #8744 - Added the
CARGO_PRIMARY_PACKAGE
environment variable which is set when runningrustc
if the package is one of the "root" packages selected on the command line. #8758 - Added support for Unix-style glob patterns for package and target selection
flags on the command-line (such as
-p 'serde*'
or--test '*'
). #8752
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
andcargo test
in some circumstances. #8755 cargo tree
now displays(proc-macro)
next to proc-macro packages. #8765- Added a warning that the allowed characters for a feature name have been
restricted to letters, digits,
_
,-
, and+
to accommodate future syntax changes. This is still a superset of the allowed syntax on crates.io, which requires ASCII. This is intended to be changed to an error in the future. #8814 -p
without a value will now print a list of workspace package names. #8808- Add period to allowed feature name characters. #8932 #8943
Fixed
- Fixed building a library with both "dylib" and "rlib" crate types with LTO enabled. #8754
- Fixed paths in Cargo's dep-info files. #8819
- Fixed inconsistent source IDs in
cargo metadata
for git dependencies that explicitly specifybranch="master"
. #8824 - Fixed re-extracting dependencies which contained a
.cargo-ok
file. #8835
Nightly only
- Fixed a panic with
cargo doc -Zfeatures=itarget
in some situations. #8777 - New implementation for namespaced features, using the syntax
dep:serde
. docs #8799 - Added support for "weak" dependency features, using the syntax
dep_name?/feat_name
, which will enable a feature for a dependency without also enabling the dependency. #8818 - Fixed the new feature resolver downloading extra dependencies that weren't strictly necessary. #8823
Cargo 1.48 (2020-11-19)
Added
- Added
term.progress
configuration option to control when and how the progress bar is displayed. docs #8165 - Added
--message-format plain
option tocargo locate-project
to display the project location without JSON to make it easier to use in a script. #8707 - Added
--workspace
option tocargo locate-project
to display the path to the workspace manifest. #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
- Zsh
--target
completion will now complete with the built-in rustc targets. #8740
Changed
Fixed
- Fixed
cargo new
creating a fossil repository to properly ignore thetarget
directory. #8671 - Don't show warnings about the workspace in the current directory when using
cargo install
of a remote package. #8681 - Automatically reinitialize the index when an "Object not found" error is encountered in the git repository. #8735
- Updated libgit2, which brings in several fixes for git repository handling. #8778 #8780
Nightly only
- Fixed
cargo install
so that it will ignore the[unstable]
table in local config files. #8656 - Fixed nondeterministic behavior of the new feature resolver. #8701
- Fixed running
cargo test
on a proc-macro with the new feature resolver under a specific combination of circumstances. #8742
Cargo 1.47 (2020-10-08)
Added
cargo doc
will now include the package's version in the left sidebar. #8509- Added the
test
field tocargo metadata
targets. #8478 - Cargo's man pages are now displayed via the
cargo help
command (such ascargo help build
). #8456 #8577 - Added new documentation chapters on how dependency resolution works and SemVer compatibility, along with suggestions on how to version your project and work with dependencies. #8609
Changed
- The comments added to
.gitignore
when it is modified have been tweaked to add some spacing. #8476 cargo metadata
output should now be sorted to be deterministic. #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 workspace.default-members
is now filtered byworkspace.exclude
. #8485workspace.members
globs now ignore non-directory paths. #8511- git zlib errors now trigger a retry. #8520
- "http" class git errors now trigger a retry. #8553
- git dependencies now override the
core.autocrlf
git configuration value to ensure they behave consistently across platforms, particularly when vendoring git dependencies on Windows. #8523 - If
Cargo.lock
needs to be updated, then it will be automatically transitioned to the new V2 format. This format removes the[metadata]
table, and should be easier to merge changes in source control systems. This format was introduced in 1.38, and made the default for new projects in 1.41. #8554 - Added preparation for support of git repositories with a non-"master"
default branch. Actual support will arrive in a future version. This
introduces some warnings:
- Warn if a git dependency does not specify a branch, and the default branch on the repository is not "master". In the future, Cargo will fetch the default branch. In this scenario, the branch should be explicitly specified.
- Warn if a workspace has multiple dependencies to the same git repository,
one without a
branch
and one withbranch="master"
. Dependencies should all use one form or the other. #8522
- Warnings are now issued if a
required-features
entry lists a feature that does not exist. #7950 - Built-in aliases are now included in
cargo --list
. #8542 cargo install
with a specific version that has been yanked will now display an error message that it has been yanked, instead of "could not find". #8565cargo publish
with a package that has thepublish
field set to a single registry, and no--registry
flag has been given, will now publish to that registry instead of generating an error. #8571
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 - Console colors should now work on Windows 7 and 8. #8540
- The
CARGO_TARGET_{triplet}_RUNNER
environment variable will now correctly override the config file instead of trying to merge the commands. #8629 - Fixed LTO with doctests. #8657 #8658
Nightly only
- Added support for
-Z terminal-width
which tellsrustc
the width of the terminal so that it can format diagnostics better. docs #8427 - Added ability to configure
-Z
unstable flags in config files via the[unstable]
table. docs #8393 - Added
-Z build-std-features
flag to set features for the standard library. docs #8490
Cargo 1.46 (2020-08-27)
Added
- The
dl
key inconfig.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 #8267 - Added new environment variables that are set during compilation:
- If the value for
readme
is not specified inCargo.toml
, it is now automatically inferred from the existence of a file namedREADME
,README.md
, orREADME.txt
. This can be suppressed by settingreadme = false
. #8277 cargo install
now supports the--index
flag to install directly from an index. #8344- Added the
metadata
table to theworkspace
definition inCargo.toml
. This can be used for arbitrary data similar to thepackage.metadata
table. #8323 - Added the
--target-dir
flag tocargo install
to set the target directory. #8391 - Changes to environment variables used by the
env!
oroption_env!
macros are now automatically detected to trigger a rebuild. #8421 - The
target
directory now includes theCACHEDIR.TAG
file which is used by some tools to exclude the directory from backups. #8378 - Added docs about rustup's
+toolchain
syntax. #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 theCargo.lock
file, and would not work properly. #8297 - Various optimizations and fixes for bitcode embedding and LTO. #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
- Enhanced git fetch error messages. #8409
.crate
files are now generated with GNU tar format instead of UStar, which supports longer file names. #8453
Fixed
- Fixed a rare situation where an update to
Cargo.lock
failed once, but then subsequent runs allowed it proceed. #8274 - Removed assertion that Windows dylibs must have a
.dll
extension. Some custom JSON spec targets may change the extension. #8310 - Updated libgit2, which brings in a fix for zlib errors for some remote git servers like googlesource.com. #8320
- Fixed the GitHub fast-path check for up-to-date git dependencies on non-master branches. #8363
- Fixed issue when enabling a feature with
pkg/feature
syntax, andpkg
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 - Fixed
clean -p
deleting the build directory if there is a test namedbuild
. #8398 - Fixed indentation of multi-line Cargo error messages. #8409
- Fixed issue where the automatic inclusion of the
--document-private-items
flag for rustdoc would override any flags passed to thecargo rustdoc
command. #8449 - Cargo will now include a version in the hash of the fingerprint directories to support backwards-incompatible changes to the fingerprint structure. #8473 #8488
Nightly only
- Added
-Zrustdoc-map
feature which provides external mappings for rustdoc (such as https://docs.rs/ links). docs #8287 - Fixed feature calculation when a proc-macro is declared in
Cargo.toml
with an underscore (likeproc_macro = true
). #8319 - Added support for setting
-Clinker
with-Zdoctest-xcompile
. #8359 - Fixed setting the
strip
profile field in config files. #8454
Cargo 1.45 (2020-07-16)
Added
Changed
-
Changed official documentation to recommend
.cargo/config.toml
filenames (with the.toml
extension)..toml
extension support was added in 1.39. #8121 -
The
registry.index
config value is no longer allowed (it has been deprecated for 4 years). #7973 -
An error is generated if both
--index
and--registry
are passed (previously--index
was silently ignored). #7973 -
The
registry.token
config value is no longer used with the--index
flag. This is intended to avoid potentially leaking the crates.io token to another registry. #7973 -
Added a warning if
registry.token
is used with source replacement. It is intended this will be an error in future versions. #7973 -
Windows GNU targets now copy
.dll.a
import library files for DLL crate types to the output directory. #8141 -
Dylibs for all dependencies are now unconditionally copied to the output directory. Some obscure scenarios can cause an old dylib to be referenced between builds, and this ensures that all the latest copies are used. #8139
-
package.exclude
can now match directory names. If a directory is specified, the entire directory will be excluded, and Cargo will not attempt to inspect it further. Previously Cargo would try to check every file in the directory which could cause problems if the directory contained unreadable files. #8095 -
When packaging with
cargo publish
orcargo package
, Cargo can use git to guide its decision on which files to include. Previously this git-based logic required aCargo.toml
file to exist at the root of the repository. This is no longer required, so Cargo will now use git-based guidance even if there is not aCargo.toml
in the root of the repository. #8095 -
While unpacking a crate on Windows, if it fails to write a file because the file is a reserved Windows filename (like "aux.rs"), Cargo will display an extra message to explain why it failed. #8136
-
Failures to set mtime on files are now ignored. Some filesystems did not support this. #8185
-
Certain classes of git errors will now recommend enabling
net.git-fetch-with-cli
. #8166 -
When doing an LTO build, Cargo will now instruct rustc not to perform codegen when possible. This may result in a faster build and use less disk space. Additionally, for non-LTO builds, Cargo will instruct rustc to not embed LLVM bitcode in libraries, which should decrease their size. #8192 #8226 #8254
-
The implementation for
cargo clean -p
has been rewritten so that it can more accurately remove the files for a specific package. #8210 -
The way Cargo computes the outputs from a build has been rewritten to be more complete and accurate. Newly tracked files will be displayed in JSON messages, and may be uplifted to the output directory in some cases. Some of the changes from this are:
.exp
export files on Windows MSVC dynamic libraries are now tracked.- Proc-macros on Windows track import/export files.
- All targets (like tests, etc.) that generate separate debug files (pdb/dSYM) are tracked.
- Added .map files for wasm32-unknown-emscripten.
- macOS dSYM directories are tracked for all dynamic libraries (dylib/cdylib/proc-macro) and for build scripts.
There are a variety of other changes as a consequence of this:
- Binary examples on Windows MSVC with a hyphen will now show up twice in
the examples directory (
foo_bar.exe
andfoo-bar.exe
). Previously Cargo just renamed the file instead of hard-linking it. - Example libraries now follow the same rules for hyphen/underscore translation as normal libs (they will now use underscores).
-
Cargo attempts to scrub any secrets from the debug log for HTTP debugging. #8222
-
Context has been added to many of Cargo's filesystem operations, so that error messages now provide more information, such as the path that caused the problem. #8232
-
Several commands now ignore the error if stdout or stderr is closed while it is running. For example
cargo install --list | grep -q cargo-fuzz
would previously sometimes panic becausegrep -q
may close stdout before the command finishes. Regular builds continue to fail if stdout or stderr is closed, matching the behavior of many other build systems. #8236 -
If
cargo install
is given an exact version, like--version=1.2.3
, it will now avoid updating the index if that version is already installed, and exit quickly indicating it is already installed. #8022 -
Changes to the
[patch]
section will now attempt to automatically updateCargo.lock
to the new version. It should now also provide better error messages for the rare cases where it is unable to automatically update. #8248
Fixed
- Fixed copying Windows
.pdb
files to the output directory when the filename contained dashes. #8123 - Fixed error where Cargo would fail when scanning if a package is inside a git repository when any of its ancestor paths is a symlink. #8186
- Fixed
cargo update
with an unused[patch]
so that it does not get stuck and refuse to update. #8243 - Fixed a situation where Cargo would hang if stderr is closed, and the compiler generated a large number of messages. #8247
- Fixed backtraces on macOS not showing filenames or line numbers. As a consequence of this, binary executables on apple targets do not include a hash in the filename in Cargo's cache. This means Cargo can only track one copy, so if you switch features or rustc versions, Cargo will need to rebuild the executable. #8329 #8335
- Fixed fingerprinting when using lld on Windows with a dylib. Cargo was erroneously thinking the dylib was never fresh. #8290 #8335
Nightly only
- Fixed passing the full path for
--target
torustdoc
when using JSON spec targets. #8094 -Cembed-bitcode=no
renamed to-Cbitcode-in-rlib=no
#8134- Added new
resolver
field toCargo.toml
to opt-in to the new feature resolver. #8129 -Zbuild-std
no longer treats std dependencies as "local". This means that it won't use incremental compilation for those dependencies, removes them from dep-info files, and caps lints at "allow". #8177- Added
-Zmultitarget
which allows multiple--target
flags to build the same thing for multiple targets at once. docs #8167 - Added
strip
option to the profile to remove symbols and debug information. docs #8246 - Fixed panic with
cargo tree --target=all -Zfeatures=all
. #8269
Cargo 1.44 (2020-06-04)
Added
- 🔥 Added the
cargo tree
command. docs #8062 - Added warnings if a package has Windows-restricted filenames (like
nul
,con
,aux
,prn
, etc.). #7959 - Added a
"build-finished"
JSON message when compilation is complete so that tools can detect when they can stop listening for JSON messages with commands likecargo run
orcargo test
. #8069
Changed
- Valid package names are now restricted to Unicode XID identifiers. This is
mostly the same as before, except package names cannot start with a number
or
-
. #7959 cargo new
andinit
will warn or reject additional package names (reserved Windows names, reserved Cargo directories, non-ASCII names, conflicting std names likecore
, etc.). #7959- Tests are no longer hard-linked into the output directory (
target/debug/
). This ensures tools will have access to debug symbols and execute tests in the same way as Cargo. Tools should use JSON messages to discover the path to the executable. #7965 - Updating git submodules now displays an "Updating" message for each submodule. #7989
- File modification times are now preserved when extracting a
.crate
file. This reverses the change made in 1.40 where the mtime was not preserved. #7935 - Build script warnings are now displayed separately when the build script fails. #8017
- Removed the
git-checkout
subcommand. #8040 - The progress bar is now enabled for all unix platforms. Previously it was only Linux, macOS, and FreeBSD. #8054
- Artifacts generated by pre-release versions of
rustc
now share the same filenames. This means that changing nightly versions will not leave stale files in the build directory. #8073 - Invalid package names are rejected when using renamed dependencies. #8090
- Added a certain class of HTTP2 errors as "spurious" that will get retried. #8102
- Allow
cargo package --list
to succeed, even if there are other validation errors (such asCargo.lock
generation problem, or missing dependencies). #8175 #8215
Fixed
- Cargo no longer buffers excessive amounts of compiler output in memory. #7838
- Symbolic links in git repositories now work on Windows. #7996
- Fixed an issue where
profile.dev
was not loaded from a config file withcargo test
when thedev
profile was not defined inCargo.toml
. #8012 - When a binary is built as an implicit dependency of an integration test,
it now checks
dep_name/feature_name
syntax inrequired-features
correctly. #8020 - Fixed an issue where Cargo would not detect that an executable (such as an integration test) needs to be rebuilt when the previous build was interrupted with Ctrl-C. #8087
- Protect against some (unknown) situations where Cargo could panic when the system monotonic clock doesn't appear to be monotonic. #8114
- Fixed panic with
cargo clean -p
if the package has a build script. #8216
Nightly only
- Fixed panic with new feature resolver and required-features. #7962
- Added
RUSTC_WORKSPACE_WRAPPER
environment variable, which provides a way to wraprustc
for workspace members only, and affects the filename hash so that artifacts produced by the wrapper are cached separately. This usage can be seen on nightly clippy withcargo clippy -Zunstable-options
. #7533 - Added
--unit-graph
CLI option to display Cargo's internal dependency graph as JSON. #7977 - Changed
-Zbuild_dep
to-Zhost_dep
, and added proc-macros to the feature decoupling logic. #8003 #8028 - Fixed so that
--crate-version
is not automatically passed when the flag is found inRUSTDOCFLAGS
. #8014 - Fixed panic with
-Zfeatures=dev_dep
andcheck --profile=test
. #8027 - Fixed panic with
-Zfeatures=itarget
with certain host dependencies. #8048 - Added support for
-Cembed-bitcode=no
, which provides a performance boost and disk-space usage reduction for non-LTO builds. #8066 -Zpackage-features
has been extended with several changes intended to make it easier to select features on the command-line in a workspace. #8074
Cargo 1.43 (2020-04-23)
Added
- 🔥 Profiles may now be specified in config files (and environment variables). docs #7823
- ❗ Added
CARGO_BIN_EXE_<name>
environment variable when building integration tests. This variable contains the path to any[[bin]]
targets in the package. Integration tests should use theenv!
macro to determine the path to a binary to execute. docs #7697
Changed
cargo install --git
now honors workspaces in a git repository. This allows workspace settings, like[patch]
,[replace]
, or[profile]
to be used. #7768cargo new
will now runrustfmt
on the new files to pick up rustfmt settings liketab_spaces
so that the new file matches the user's preferred indentation settings. #7827- Environment variables printed with "very verbose" output (
-vv
) are now consistently sorted. #7877 - Debug logging for fingerprint rebuild-detection now includes more information. #7888 #7890 #7952
- Added warning during publish if the license-file doesn't exist. #7905
- The
license-file
file is automatically included during publish, even if it is not explicitly listed in theinclude
list or is in a location outside of the root of the package. #7905 CARGO_CFG_DEBUG_ASSERTIONS
andCARGO_CFG_PROC_MACRO
are no longer set when running a build script. These were inadvertently set in the past, but had no meaning as they were always true. Additionally,cfg(proc-macro)
is no longer supported in atarget
expression. #7943 #7970
Fixed
- Global command-line flags now work with aliases (like
cargo -v b
). #7837 - Required-features using dependency syntax (like
renamed_dep/feat_name
) now handle renamed dependencies correctly. #7855 - Fixed a rare situation where if a build script is run multiple times during the same build, Cargo will now keep the results separate instead of losing the output of the first execution. #7857
- Fixed incorrect interpretation of environment variable
CARGO_TARGET_*_RUNNER=true
as a boolean. Also improved related env var error messages. #7891 - Updated internal libgit2 library, bringing various fixes to git support. #7939
cargo package
/cargo publish
should no longer buffer the entire contents of each file in memory. #7946- Ignore more invalid
Cargo.toml
files in a git dependency. Cargo currently walks the entire repo to find the requested package. Certain invalid manifests were already skipped, and now it should skip all of them. #7947
Nightly only
- Added
build.out-dir
config variable to set the output directory. #7810 - Added
-Zjobserver-per-rustc
feature to support improved performance for parallel rustc. #7731 - Fixed filename collision with
build-std
and crates likecc
. #7860 -Ztimings
will now save its report even if there is an error. #7872- Updated
--config
command-line flag to support taking a path to a config file to load. #7901 - Added new feature resolver. #7820
- Rustdoc docs now automatically include the version of the package in the
side bar (requires
-Z crate-versions
flag). #7903
Cargo 1.42 (2020-03-12)
Added
- Added documentation on git authentication. #7658
- Bitbucket Pipeline badges are now supported on crates.io. #7663
cargo vendor
now accepts the--versioned-dirs
option to force it to always include the version number in each package's directory name. #7631- The
proc_macro
crate is now automatically added to the extern prelude for proc-macro packages. This means thatextern crate proc_macro;
is no longer necessary for proc-macros. #7700
Changed
- Emit a warning if
debug_assertions
,test
,proc_macro
, orfeature=
is used in acfg()
expression. #7660 - Large update to the Cargo documentation, adding new chapters on Cargo targets, workspaces, and features. #7733
- Windows:
.lib
DLL import libraries are now copied next to the dll for all Windows MSVC targets. Previously it was only supported forpc-windows-msvc
. This adds DLL support foruwp-windows-msvc
targets. #7758 - The
ar
field in the[target]
configuration is no longer read. It has been ignored for over 4 years. #7763 - Bash completion file simplified and updated for latest changes. #7789
- Credentials are only loaded when needed, instead of every Cargo command. #7774
Fixed
- Removed
--offline
empty index check, which was a false positive in some cases. #7655 - Files and directories starting with a
.
can now be included in a package by adding it to theinclude
list. #7680 - Fixed
cargo login
removing alternative registry tokens when previous entries existed in the credentials file. #7708 - Fixed
cargo vendor
from panicking when used with alternative registries. #7718 - Fixed incorrect explanation in the fingerprint debug log message. #7749
- A
[source]
that is defined multiple times will now result in an error. Previously it was randomly picking a source, which could cause non-deterministic behavior. #7751 dep_kinds
incargo metadata
are now de-duplicated. #7756- Fixed packaging where
Cargo.lock
was listed in.gitignore
in a subdirectory inside a git repository. Previously it was assumingCargo.lock
was at the root of the repo. #7779 - Partial file transfer errors will now cause an automatic retry. #7788
- Linux: Fixed panic if CPU iowait stat decreases. #7803
- Fixed using the wrong sysroot for detecting host compiler settings when
--sysroot
is passed in viaRUSTFLAGS
. #7798
Nightly only
build-std
now uses--extern
instead of--sysroot
to find sysroot packages. #7699- Added
--config
command-line option to set config settings. #7649 - Added
include
config setting which allows including another config file. #7649 - Profiles in config files now support any named profile. Previously it was limited to dev/release. #7750
Cargo 1.41 (2020-01-30)
Added
- 🔥 Cargo now uses a new
Cargo.lock
file format. This new format should support easier merges in source control systems. Projects using the old format will continue to use the old format, only newCargo.lock
files will use the new format. #7579 - 🔥
cargo install
will now upgrade already installed packages instead of failing. #7560 - 🔥 Profile overrides have been added. This allows overriding profiles for individual dependencies or build scripts. See the documentation for more. #7591
- Added new documentation for build scripts. #7565
- Added documentation for Cargo's JSON output. #7595
- Significant expansion of config and environment variable documentation. #7650
- Add back support for
BROWSER
environment variable forcargo doc --open
. #7576 - Added
kind
andplatform
for dependencies incargo metadata
. #7132 - The
OUT_DIR
value is now included in thebuild-script-executed
JSON message. #7622
Changed
cargo doc
will now document private items in binaries by default. #7593- Subcommand typo suggestions now include aliases. #7486
- Tweak how the "already existing..." comment is added to
.gitignore
. #7570 - Ignore
cargo login
text from copy/paste in token. #7588 - Windows: Ignore errors for locking files when not supported by the filesystem. #7602
- Remove
**/*.rs.bk
from.gitignore
. #7647
Fixed
- Fix unused warnings for some keys in the
build
config section. #7575 - Linux: Don't panic when parsing
/proc/stat
. #7580 - Don't show canonical path in
cargo vendor
. #7629
Nightly only
Cargo 1.40 (2019-12-19)
Added
- Added
http.ssl-version
config option to control the version of TLS, along with min/max versions. #7308 - 🔥 Compiler warnings are now cached on disk. If a build generates warnings, re-running the build will now re-display the warnings. #7450
- Added
--filter-platform
option tocargo metadata
to narrow the nodes shown in the resolver graph to only packages included for the given target triple. #7376
Changed
- Cargo's "platform"
cfg
parsing has been extracted into a separate crate namedcargo-platform
. #7375 - Dependencies extracted into Cargo's cache no longer preserve mtimes to reduce syscall overhead. #7465
- Windows: EXE files no longer include a metadata hash in the filename. This helps with debuggers correlating the filename with the PDB file. #7400
- Wasm32:
.wasm
files are no longer treated as an "executable", allowingcargo test
andcargo run
to work properly with the generated.js
file. #7476 - crates.io now supports SPDX 3.6 licenses. #7481
- Improved cyclic dependency error message. #7470
- Bare
cargo clean
no longer locks the package cache. #7502 cargo publish
now allows dev-dependencies without a version key to be published. A git or path-only dev-dependency will be removed from the package manifest before uploading. #7333--features
and--no-default-features
in the root of a virtual workspace will now generate an error instead of being ignored. #7507- Generated files (like
Cargo.toml
andCargo.lock
) in a package archive now have their timestamp set to the current time instead of the epoch. #7523 - The
-Z
flag parser is now more strict, rejecting more invalid syntax. #7531
Fixed
- Fixed an issue where if a package had an
include
field, andCargo.lock
in.gitignore
, and a binary or example target, and theCargo.lock
exists in the current project, it would fail to publish complaining theCargo.lock
was dirty. #7448 - Fixed a panic in a particular combination of
[patch]
entries. #7452 - Windows: Better error message when
cargo test
orrustc
crashes in an abnormal way, such as a signal or seg fault. #7535
Nightly only
- The
mtime-on-use
feature may now be enabled via theunstable.mtime_on_use
config option. #7411 - Added support for named profiles. #6989
- Added
-Zpanic-abort-tests
to allow building and running tests with the "abort" panic strategy. #7460 - Changed
build-std
to use--sysroot
. #7421 - Various fixes and enhancements to
-Ztimings
. #7395 #7398 #7397 #7403 #7428 #7429 - Profile overrides have renamed the syntax to be
[profile.dev.package.NAME]
. #7504 - Fixed warnings for unused profile overrides in a workspace. #7536
Cargo 1.39 (2019-11-07)
Added
- Config files may now use the
.toml
filename extension. #7295 - The
--workspace
flag has been added as an alias for--all
to help avoid confusion about the meaning of "all". #7241 - The
publish
field has been added tocargo metadata
. #7354
Changed
- Display more information if parsing the output from
rustc
fails. #7236 - TOML errors now show the column number. #7248
cargo vendor
no longer deletes files in thevendor
directory that starts with a.
. #7242cargo fetch
will now show manifest warnings. #7243cargo publish
will now check git submodules if they contain any uncommitted changes. #7245- In a build script,
cargo:rustc-flags
now allows-l
and-L
flags without spaces. #7257 - When
cargo install
replaces an older version of a package it will now delete any installed binaries that are no longer present in the newly installed version. #7246 - A git dependency may now also specify a
version
key when published. Thegit
value will be stripped from the uploaded crate, matching the behavior ofpath
dependencies. #7237 - The behavior of workspace default-members has changed. The default-members now only applies when running Cargo in the root of the workspace. Previously it would always apply regardless of which directory Cargo is running in. #7270
- libgit2 updated pulling in all upstream changes. #7275
- Bump
home
dependency for locating home directories. #7277 - zsh completions have been updated. #7296
- SSL connect errors are now retried. #7318
- The jobserver has been changed to acquire N tokens (instead of N-1), and
then immediately acquires the extra token. This was changed to accommodate
the
cc
crate on Windows to allow it to release its implicit token. #7344 - The scheduling algorithm for choosing which crate to build next has been changed. It now chooses the crate with the greatest number of transitive crates waiting on it. Previously it used a maximum topological depth. #7390
- RUSTFLAGS are no longer incorporated in the metadata and filename hash, reversing the change from 1.33 that added it. This means that any change to RUSTFLAGS will cause a recompile, and will not affect symbol munging. #7459
Fixed
- Git dependencies with submodules with shorthand SSH URLs (like
git@github.com/user/repo.git
) should now work. #7238 - Handle broken symlinks when creating
.dSYM
symlinks on macOS. #7268 - Fixed issues with multiple versions of the same crate in a
[patch]
table. #7303 - Fixed issue with custom target
.json
files where a substring of the name matches an unsupported crate type (like "bin"). #7363 - Fixed issues with generating documentation for proc-macro crate types. #7159
- Fixed hang if Cargo panics within a build thread. #7366
- Fixed rebuild detection if a
build.rs
script issues differentrerun-if
directives between builds. Cargo was erroneously causing a rebuild after the change. #7373 - Properly handle canonical URLs for
[patch]
table entries, preventing the patch from working after the first time it is used. #7368 - Fixed an issue where integration tests were waiting for the package binary to finish building before starting their own build. They now may build concurrently. #7394
- Fixed accidental change in the previous release on how
--features a b
flag is interpreted, restoring the original behavior where this is interpreted as--features a
along with the argumentb
passed to the command. To pass multiple features, use quotes around the features to pass multiple features like--features "a b"
, or use commas, or use multiple--features
flags. #7419
Nightly only
- Basic support for building the standard library directly from Cargo has been added. (docs) #7216
- Added
-Ztimings
feature to generate an HTML report on the time spent on individual compilation steps. This also may output completion steps on the console and JSON data. (docs) #7311 - Added ability to cross-compile doctests. (docs) #6892
Cargo 1.38 (2019-09-26)
Added
- 🔥 Cargo build pipelining has been enabled by default to leverage more idle CPU parallelism during builds. #7143
- The
--message-format
option to Cargo can now be specified multiple times and accepts a comma-separated list of values. In addition to the previous values it also now acceptsjson-diagnostic-short
andjson-diagnostic-rendered-ansi
which configures the output coming from rustc injson
message mode. #7214 - Cirrus CI badges are now supported on crates.io. #7119
- A new format for
Cargo.lock
has been introduced. This new format is intended to avoid source-control merge conflicts more often, and to generally make it safer to merge changes. This new format is not enabled at this time, though Cargo will use it if it sees it. At some point in the future, it is intended that this will become the default. #7070 - Progress bar support added for FreeBSD. #7222
Changed
- The
-q
flag will no longer suppress the root error message for an error from Cargo itself. #7116 - The Cargo Book is now published with mdbook 0.3 providing a number of formatting fixes and improvements. #7140
- The
--features
command-line flag can now be specified multiple times. The list of features from all the flags are joined together. #7084 - Package include/exclude glob-vs-gitignore warnings have been removed. Packages may now use gitignore-style matching without producing any warnings. #7170
- Cargo now shows the command and output when parsing
rustc
output fails when queryingrustc
for information likecfg
values. #7185 cargo package
/cargo publish
now allows a symbolic link to a git submodule to include that submodule. #6817- Improved the error message when a version requirement does not match any versions, but there are pre-release versions available. #7191
Fixed
- Fixed using the wrong directory when updating git repositories when using
the
git-fetch-with-cli
config option, and theGIT_DIR
environment variable is set. This may happen when running cargo from git callbacks. #7082 - Fixed dep-info files being overwritten for targets that have separate debug
outputs. For example, binaries on
-apple-
targets with.dSYM
directories would overwrite the.d
file. #7057 - Fix
[patch]
table not preserving "one major version per source" rule. #7118 - Ignore
--remap-path-prefix
flags for the metadata hash in thecargo rustc
command. This was causing the remap settings to inadvertently affect symbol names. #7134 - Fixed cycle detection in
[patch]
dependencies. #7174 - Fixed
cargo new
leaving behind a symlink on Windows whencore.symlinks
git config is true. Also adds a number of fixes and updates from upstream libgit2. #7176 - macOS: Fixed setting the flag to mark the
target
directory to be excluded from backups. #7192 - Fixed
cargo fix
panicking under some situations involving multi-byte characters. #7221
Nightly only
- Added
cargo fix --clippy
which will apply machine-applicable fixes from Clippy. #7069 - Added
-Z binary-dep-depinfo
flag to add change tracking for binary dependencies like the standard library. #7137 #7219 cargo clippy-preview
will always run, even if no changes have been made. #7157- Fixed exponential blowup when using
CARGO_BUILD_PIPELINING
. #7062 - Fixed passing args to clippy in
cargo clippy-preview
. #7162
Cargo 1.37 (2019-08-15)
Added
- Added
doctest
field tocargo metadata
to determine if a target's documentation is tested. #6953 #6965 - 🔥 The
cargo vendor
command is now built-in to Cargo. This command may be used to create a local copy of the sources of all dependencies. #6869 - 🔥 The "publish lockfile" feature is now stable. This feature will
automatically include the
Cargo.lock
file when a package is published if it contains a binary executable target. By default, Cargo will ignoreCargo.lock
when installing a package. To force Cargo to use theCargo.lock
file included in the published package, usecargo install --locked
. This may be useful to ensure thatcargo install
consistently reproduces the same result. It may also be useful when a semver-incompatible change is accidentally published to a dependency, providing a way to fall back to a version that is known to work. #7026 - 🔥 The
default-run
feature has been stabilized. This feature allows you to specify which binary executable to run by default withcargo run
when a package includes multiple binaries. Set thedefault-run
key in the[package]
table inCargo.toml
to the name of the binary to use by default. #7056
Changed
cargo package
now verifies that build scripts do not create empty directories. #6973- A warning is now issued if
cargo doc
generates duplicate outputs, which causes files to be randomly stomped on. This may happen for a variety of reasons (renamed dependencies, multiple versions of the same package, packages with renamed libraries, etc.). This is a known bug, which needs more work to handle correctly. #6998 - Enabling a dependency's feature with
--features foo/bar
will no longer compile the current crate with thefoo
feature iffoo
is not an optional dependency. #7010 - If
--remap-path-prefix
is passed via RUSTFLAGS, it will no longer affect the filename metadata hash. #6966 - libgit2 has been updated to 0.28.2, which Cargo uses to access git repositories. This brings in hundreds of changes and fixes since it was last updated in November. #7018
- Cargo now supports absolute paths in the dep-info files generated by rustc. This is laying the groundwork for tracking binaries, such as libstd, for rebuild detection. (Note: this contains a known bug.) #7030
Fixed
- Fixed how zsh completions fetch the list of commands. #6956
- "+ debuginfo" is no longer printed in the build summary when
debug
is set to 0. #6971 - Fixed
cargo doc
with an example configured withdoc = true
to document correctly. #7023 - Don't fail if a read-only lock cannot be acquired in CARGO_HOME. This helps
when CARGO_HOME doesn't exist, but
--locked
is used which means CARGO_HOME is not needed. #7149 - Reverted a change in 1.35 which released jobserver tokens when Cargo blocked on a lock file. It caused a deadlock in some situations. #7204
Nightly only
- Added compiler message
caching.
The
-Z cache-messages
flag makes cargo cache the compiler output so that future runs can redisplay previous warnings. #6933 -Z mtime-on-use
no longer touches intermediate artifacts. #7050
Cargo 1.36 (2019-07-04)
Added
- Added more detailed documentation on target auto-discovery. #6898
- 🔥 Stabilize the
--offline
flag which allows using cargo without a network connection. #6934 #6871
Changed
publish = ["crates-io"]
may be added to the manifest to restrict publishing to crates.io only. #6838- macOS: Only include the default paths if
DYLD_FALLBACK_LIBRARY_PATH
is not set. Also, remove/lib
from the default set. #6856 cargo publish
will now exit early if the login token is not available. #6854- HTTP/2 stream errors are now considered "spurious" and will cause a retry. #6861
- Setting a feature on a dependency where that feature points to a required dependency is now an error. Previously it was a warning. #6860
- The
registry.index
config value now supports relativefile:
URLs. #6873 - macOS: The
.dSYM
directory is now symbolically linked next to example binaries without the metadata hash so that debuggers can find it. #6891 - The default
Cargo.toml
template for now projects now includes a comment providing a link to the documentation. #6881 - Some improvements to the wording of the crate download summary. #6916 #6920
- ✨ Changed
RUST_LOG
environment variable toCARGO_LOG
so that user code that uses thelog
crate will not display cargo's debug output. #6918 Cargo.toml
is now always included when packaging, even if it is not listed inpackage.include
. #6925- Package include/exclude values now use gitignore patterns instead of glob patterns. #6924
- Provide a better error message when crates.io times out. Also improve error messages with other HTTP response codes. #6936
Performance
- Resolver performance improvements for some cases. #6853
- Optimized how cargo reads the index JSON files by caching the results. #6880 #6912 #6940
- Various performance improvements. #6867
Fixed
- More carefully track the on-disk fingerprint information for dependencies. This can help in some rare cases where the build is interrupted and restarted. #6832
cargo run
now correctly passes non-UTF8 arguments to the child process. #6849- Fixed bash completion to run on bash 3.2, the stock version in macOS. #6905
- Various fixes and improvements to zsh completion. #6926 #6929
- Fix
cargo update
ignoring-p
arguments if theCargo.lock
file was missing. #6904
Nightly only
- Added
-Z install-upgrade
feature to track details about installed crates and to update them if they are out-of-date. #6798 - Added the
public-dependency
feature which allows tracking public versus private dependencies. #6772 - Added build pipelining via the
build.pipelining
config option (CARGO_BUILD_PIPELINING
env var). #6883 - The
publish-lockfile
feature has had some significant changes. The default is nowtrue
, theCargo.lock
will always be published for binary crates. TheCargo.lock
is now regenerated during publishing.cargo install
now ignores theCargo.lock
file by default, and requires--locked
to use the lock file. Warnings have been added if yanked dependencies are detected. #6840
Cargo 1.35 (2019-05-23)
Added
- Added the
rustc-cdylib-link-arg
key for build scripts to specify linker arguments for cdylib crates. #6298
Changed
- When passing a test filter, such as
cargo test foo
, don't build examples (unless they settest = true
). #6683 - Forward the
--quiet
flag fromcargo test
to the libtest harness so that tests are actually quiet. #6358 - The verification step in
cargo package
that checks if any files are modified is now stricter. It uses a hash of the contents instead of checking filesystem mtimes. It also checks all files in the package. #6740 - Jobserver tokens are now released whenever Cargo blocks on a file lock. #6748
- Issue a warning for a previous bug in the TOML parser that allowed multiple table headers with the same name. #6761
- Removed the
CARGO_PKG_*
environment variables from the metadata hash and added them to the fingerprint instead. This means that when these values change, stale artifacts are not left behind. Also added the "repository" value to the fingerprint. #6785 cargo metadata
no longer shows anull
field for a dependency without a library inresolve.nodes.deps
. The dependency is no longer shown. #6534cargo new
will no longer include an email address in theauthors
field if it is set to the empty string. #6802cargo doc --open
now works when documenting multiple packages. #6803cargo install --path P
now loads the.cargo/config
file from the directory P. #6805- Using semver metadata in a version requirement (such as
1.0.0+1234
) now issues a warning that it is ignored. #6806 cargo install
now rejects certain combinations of flags where some flags would have been ignored. #6801- Resolver performance improvements for some cases. #6776
Fixed
- Fixed running separate commands (such as
cargo build
thencargo test
) where the second command could use stale results from a build script. #6720 - Fixed
cargo fix
not working properly if a.gitignore
file that matched the root package directory. #6767 - Fixed accidentally compiling a lib multiple times if
panic=unwind
was set in a profile. #6781 - Paths to JSON files in
build.target
config value are now canonicalized to fix building dependencies. #6778 - Fixed re-running a build script if its compilation was interrupted (such as if it is killed). #6782
- Fixed
cargo new
initializing a fossil repo. #6792 - Fixed supporting updating a git repo that has a force push when using the
git-fetch-with-cli
feature.git-fetch-with-cli
also shows more error information now when it fails. #6800 --example
binaries built for the WASM target are fixed to no longer include a metadata hash in the filename, and are correctly emitted in thecompiler-artifact
JSON message. #6812
Nightly only
cargo clippy-preview
is now a built-in cargo command. #6759- The
build-override
profile setting now includes proc-macros and their dependencies. #6811 - Optional and target dependencies now work better with
-Z offline
. #6814
Cargo 1.34 (2019-04-11)
Added
- 🔥 Stabilized support for alternate registries. #6654
- Added documentation on using builds.sr.ht Continuous Integration with Cargo. #6565
Cargo.lock
now includes a comment at the top that it is@generated
. #6548- Azure DevOps badges are now supported. #6264
- Added a warning if
--exclude
flag specifies an unknown package. #6679
Changed
cargo test --doc --no-run
doesn't do anything, so it now displays an error to that effect. #6628- Various updates to bash completion: add missing options and commands,
support libtest completions, use rustup for
--target
completion, fallback to filename completion, fix editing the command line. #6644 - Publishing a crate with a
[patch]
section no longer generates an error. The[patch]
section is removed from the manifest before publishing. #6535 build.incremental = true
config value is now treated the same asCARGO_INCREMENTAL=1
, previously it was ignored. #6688- Errors from a registry are now always displayed regardless of the HTTP response code. #6771
Fixed
- Fixed bash completion for
cargo run --example
. #6578 - Fixed a race condition when using a local registry and running multiple cargo commands at the same time that build the same crate. #6591
- Fixed some flickering and excessive updates of the progress bar. #6615
- Fixed a hang when using a git credential helper that returns incorrect credentials. #6681
- Fixed resolving yanked crates with a local registry. #6750
Nightly only
- Added
-Z mtime-on-use
flag to cause the mtime to be updated on the filesystem when a crate is used. This is intended to be able to track stale artifacts in the future for cleaning up unused files. #6477 #6573 - Added experimental
-Z dual-proc-macros
to build proc macros for both the host and the target. #6547
Cargo 1.33 (2019-02-28)
Added
compiler-artifact
JSON messages now include an"executable"
key which includes the path to the executable that was built. #6363- The man pages have been rewritten, and are now published with the web documentation. #6405
cargo login
now displays a confirmation after saving the token. #6466- A warning is now emitted if a
[patch]
entry does not match any package. #6470 cargo metadata
now includes thelinks
key for a package. #6480- "Very verbose" output with
-vv
now displays the environment variables that cargo sets when it runs a process. #6492 --example
,--bin
,--bench
, or--test
without an argument now lists the available targets for those options. #6505- Windows: If a process fails with an extended status exit code, a human-readable name for the code is now displayed. #6532
- Added
--features
,--no-default-features
, and--all-features
flags to thecargo package
andcargo publish
commands to use the given features when verifying the package. #6453
Changed
- If
cargo fix
fails to compile the fixed code, the rustc errors are now displayed on the console. #6419 - Hide the
--host
flag fromcargo login
, it is unused. #6466 - Build script fingerprints now include the rustc version. #6473
- macOS: Switched to setting
DYLD_FALLBACK_LIBRARY_PATH
instead ofDYLD_LIBRARY_PATH
. #6355 RUSTFLAGS
is now included in the metadata hash, meaning that changing the flags will not overwrite previously built files. #6503- When updating the crate graph, unrelated yanked crates were erroneously
removed. They are now kept at their original version if possible. This was
causing unrelated packages to be downgraded during
cargo update -p somecrate
. #5702 - TOML files now support the 0.5 TOML syntax.
Fixed
cargo fix
will now ignore suggestions that modify multiple files. #6402cargo fix
will now only fix one target at a time, to deal with targets which share the same source files. #6434- Fixed bash completion showing the list of cargo commands. #6461
cargo init
will now avoid creating duplicate entries in.gitignore
files. #6521- Builds now attempt to detect if a file is modified in the middle of a compilation, allowing you to build again and pick up the new changes. This is done by keeping track of when the compilation starts not when it finishes. Also, #5919 was reverted, meaning that cargo does not treat equal filesystem mtimes as requiring a rebuild. #6484
Nightly only
- Allow using registry names in
[patch]
tables instead of just URLs. #6456 cargo metadata
added theregistry
key for dependencies. #6500- Registry names are now restricted to the same style as
package names (alphanumeric,
-
and_
characters). #6469 cargo login
now displays the/me
URL from the registry config. #6466cargo login --registry=NAME
now supports interactive input for the token. #6466- Registries may now elide the
api
key fromconfig.json
to indicate they do not support API access. #6466 - Fixed panic when using
--message-format=json
with metabuild. #6432 - Fixed detection of publishing to crates.io when using alternate registries. #6525
Cargo 1.32 (2019-01-17)
Added
- Registries may now display warnings after a successful publish. #6303
- Added a glossary to the documentation. #6321
- Added the alias
c
forcargo check
. #6218
Changed
- 🔥 HTTP/2 multiplexing is now enabled by default. The
http.multiplexing
config value may be used to disable it. #6271 - Use ANSI escape sequences to clear lines instead of spaces. #6233
- Disable git templates when checking out git dependencies, which can cause problems. #6252
- Include the
--update-head-ok
git flag when using thenet.git-fetch-with-cli
option. This can help prevent failures when fetching some repositories. #6250 - When extracting a crate during the verification step of
cargo package
, the filesystem mtimes are no longer set, which was failing on some rare filesystems. #6257 crate-type = ["proc-macro"]
is now treated the same asproc-macro = true
inCargo.toml
. #6256- An error is raised if
dependencies
,features
,target
, orbadges
is set in a virtual workspace. Warnings are displayed ifreplace
orpatch
is used in a workspace member. #6276 - Improved performance of the resolver in some cases. #6283 #6366
.rmeta
files are no longer hard-linked into the base target directory (target/debug
). #6292- A warning is issued if multiple targets are built with the same output filenames. #6308
- When using
cargo build
(without--release
) benchmarks are now built using the "test" profile instead of "bench". This makes it easier to debug benchmarks, and avoids confusing behavior. #6309 - User aliases may now override built-in aliases (
b
,r
,t
, andc
). #6259 - Setting
autobins=false
now disables auto-discovery of inferred targets. #6329 cargo verify-project
will now fail on stable if the project uses unstable features. #6326- Platform targets with an internal
.
within the name are now allowed. #6255 cargo clean --release
now only deletes the release directory. #6349
Fixed
- Avoid adding extra angle brackets in email address for
cargo new
. #6243 - The progress bar is disabled if the CI environment variable is set. #6281
- Avoid retaining all rustc output in memory. #6289
- If JSON parsing fails, and rustc exits nonzero, don't lose the parse failure message. #6290
- Fixed renaming a project directory with build scripts. #6328
- Fixed
cargo run --example NAME
to work correctly if the example setscrate_type = ["bin"]
. #6330 - Fixed issue with
cargo package
git discovery being too aggressive. The--allow-dirty
now completely disables the git repo checks. #6280 - Fixed build change tracking for
[patch]
deps which resulted incargo build
rebuilding when it shouldn't. #6493
Nightly only
- Allow usernames in registry URLs. #6242
- Added
"compile_mode"
key to the build-plan JSON structure to be able to distinguish running a custom build script versus compiling the build script. #6331 --out-dir
no longer copies over build scripts. #6300
Cargo 1.31 (2018-12-06)
Added
- 🔥 Stabilized support for the 2018 edition. #5984 #5989
- 🔥 Added the ability to rename dependencies in Cargo.toml. #6319
- 🔥 Added support for HTTP/2 pipelining and multiplexing. Set the
http.multiplexing
config value to enable. #6005 - Added
http.debug
configuration value to debug HTTP connections. UseCARGO_HTTP_DEBUG=true RUST_LOG=cargo::ops::registry cargo build
to display the debug information. #6166 CARGO_PKG_REPOSITORY
environment variable is set with the repository value fromCargo.toml
when building . #6096
Changed
cargo test --doc
now rejects other flags instead of ignoring them. #6037cargo install
ignores~/.cargo/config
. #6026cargo version --verbose
is now the same ascargo -vV
. #6076- Comments at the top of
Cargo.lock
are now preserved. #6181 - When building in "very verbose" mode (
cargo build -vv
), build script output is prefixed with the package name and version, such as[foo 0.0.1]
. #6164 - If
cargo fix --broken-code
fails to compile after fixes have been applied, the files are no longer reverted and are left in their broken state. #6316
Fixed
- Windows: Pass Ctrl-C to the process with
cargo run
. #6004 - macOS: Fix bash completion. #6038
- Support arbitrary toolchain names when completing
+toolchain
in bash completion. #6038 - Fixed edge cases in the resolver, when backtracking on failed dependencies. #5988
- Fixed
cargo test --all-targets
running lib tests three times. #6039 - Fixed publishing renamed dependencies to crates.io. #5993
- Fixed
cargo install
on a git repo with multiple binaries. #6060 - Fixed deeply nested JSON emitted by rustc being lost. #6081
- Windows: Fix locking msys terminals to 60 characters. #6122
- Fixed renamed dependencies with dashes. #6140
- Fixed linking against the wrong dylib when the dylib existed in both
target/debug
andtarget/debug/deps
. #6167 - Fixed some unnecessary recompiles when
panic=abort
is used. #6170
Nightly only
- Added
--registry
flag tocargo install
. #6128 - Added
registry.default
configuration value to specify the default registry to use if--registry
flag is not passed. #6135 - Added
--registry
flag tocargo new
andcargo init
. #6135
Cargo 1.30 (2018-10-25)
Added
- 🔥 Added an animated progress bar shows progress during building. #5995
- Added
resolve.nodes.deps
key tocargo metadata
, which includes more information about resolved dependencies, and properly handles renamed dependencies. #5871 - When creating a package, provide more detail with
-v
when failing to discover if files are dirty in a git repository. Also fix a problem with discovery on Windows. #5858 - Filters like
--bin
,--test
,--example
,--bench
, or--lib
can be used in a workspace without selecting a specific package. #5873 cargo run
can be used in a workspace without selecting a specific package. #5877cargo doc --message-format=json
now outputs JSON messages from rustdoc. #5878- Added
--message-format=short
to show one-line messages. #5879 - Added
.cargo_vcs_info.json
file to.crate
packages that captures the current git hash. #5886 - Added
net.git-fetch-with-cli
configuration option to use thegit
executable to fetch repositories instead of using the built-in libgit2 library. #5914 - Added
required-features
tocargo metadata
. #5902 cargo uninstall
within a package will now uninstall that package. #5927- Added
--allow-staged
flag tocargo fix
to allow it to run if files are staged in git. #5943 - Added
net.low-speed-limit
config value, and also honornet.timeout
for http operations. #5957 - Added
--edition
flag tocargo new
. #5984 - Temporarily stabilized 2018 edition support for the duration of the beta. #5984 #5989
- Added support for
target.'cfg(…)'.runner
config value to specify the run/test/bench runner for targets that use config expressions. #5959
Changed
- Windows:
cargo run
will not kill child processes when the main process exits. #5887 - Switched to the
opener
crate to open a web browser withcargo doc --open
. This should more reliably select the system-preferred browser on all platforms. #5888 - Equal file mtimes now cause a target to be rebuilt. Previously only if files were strictly newer than the last build would it cause a rebuild. #5919
- Ignore
build.target
config value when runningcargo install
. #5874 - Ignore
RUSTC_WRAPPER
forcargo fix
. #5983 - Ignore empty
RUSTC_WRAPPER
. #5985
Fixed
- Fixed error when creating a package with an edition field in
Cargo.toml
. #5908 - More consistently use relative paths for path dependencies in a workspace. #5935
cargo fix
now always runs, even if it was run previously. #5944- Windows: Attempt to more reliably detect terminal width. msys-based terminals are forced to 60 characters wide. #6010
- Allow multiple target flags with
cargo doc --document-private-items
. 6022