Commit graph

89 commits

Author SHA1 Message Date
Thom Wiggers 32130f8e58
enable the broken_symlink test on Windows 2019-07-30 09:31:35 +02:00
Thom Wiggers 50a24ff29b
Check if symlinks are directories
Fixes #2748.

Uses @ehuss's suggested fix.
See https://github.com/rust-lang/cargo/pull/6817#issuecomment-480538976
2019-07-30 09:31:35 +02:00
Thom Wiggers 77cfceea7d
Add tests for symlinks to git submodules or directories. 2019-07-30 09:31:32 +02:00
Eric Huss 24d2850247 Remove include/exclude glob warning. 2019-07-23 13:49:17 -07:00
Sekhat Temporus 69226ed887 improve uncommitted changes cargo-package message
fixes #7003

Explicitly state what the suggested flag `--allow-dirty`
actually does when packaging/publishing the crate. Primarily,
that the uncommited changes are included within the resulting
package.
2019-07-01 18:48:59 +01:00
Eric Huss 34307c6122 Stabilize publish-lockfile. 2019-06-10 13:19:18 -07:00
Jethro Beekman 0e0d968825 Update #[test] attribute on all tests in the testsuite
sed -i 's/^#\[test\]/#[cargo_test]/' $(rg -l '^#\[test\]')

Manual fixes:
* proc_macro::proc_macro_doctest
2019-06-07 12:41:26 -07:00
Michael Lamparski aef2a9cbc4 cargo package: detect new empty directories 2019-05-20 21:11:34 -04:00
Eric Huss 337fbaaa12 Fix version of ignore.
Some tests relied on new behavior, so bump the minimal version.

The change to `gitignore_negate` was just an innocuous typo.
2019-05-13 18:05:10 -07:00
Eric Huss db3328ecb1 Add a warning if both package.include and package.exclude are specified. 2019-05-10 07:46:50 -07:00
Eric Huss 3ca96e90eb Add support for ! negate gitignore patterns. 2019-05-10 07:46:50 -07:00
Eric Huss d4b6e90fc1 Migrate package include/exclude to gitignore patterns. 2019-05-10 07:46:50 -07:00
bors 29b000fcc2 Auto merge of #6925 - ehuss:package-include-manifest, r=alexcrichton
Always include `Cargo.toml` when packaging.

Since `Cargo.toml` is required, might as well include it automatically rather than force everyone to include it explicitly. If it is not listed in `include`, there was a somewhat confusing error message when packaging.

Closes #6830
Closes #4660
2019-05-10 13:44:03 +00:00
Eric Huss 49e37f80fa Always include Cargo.toml when packaging. 2019-05-09 13:34:08 -07:00
Eric Huss 87449f453b Remove unnecessary calls to masquerade_as_nightly_cargo.
These are not needed anymore.
2019-05-09 10:58:18 -07:00
Eric Huss ebb5764ad8 Move publish-lockfile tests to a dedicated file. 2019-04-16 08:54:24 -07:00
Alex Crichton f16efff150 Run cargo fmt 2019-04-10 10:42:07 -07:00
Eric Huss c495e0a654 testsuite: cleanup for alternative-registries
Remove some `alternative-registries` features that were accidentally left
behind.
2019-04-09 19:08:43 -07:00
Eric Huss ef0b47769b Cleanup: Remove unnecessary borrows. 2019-03-26 18:09:56 -07:00
Eric Huss 50277e88fe Testsuite: remove some unnecessary is_nightly checks. 2019-03-26 13:56:14 -07:00
Eric Huss e7124ba262 Testsuite: Make cwd() relative to project root.
It's a fairly common pattern, and it seemed natural to me.
2019-03-20 16:34:56 -07:00
Eric Huss 78a60bc74f Stricter package change detection. 2019-03-12 20:33:45 -07:00
Jonathan Claudius 46b2b78754
Merge branch 'master' into https_all_the_things 2019-02-22 14:21:53 -05:00
Alexander Regueiro f7c91ba622
Various cosmetic improvements. 2019-02-20 10:58:27 +00:00
Dale Wijnand 37df042ba8
Test cleanup: remove unnecessary with_status(0) 2019-02-04 18:52:33 +01:00
Jonathan Claudius 0c3851c017
HTTPS all the things 2019-01-30 15:34:37 -05:00
nasa db09895f3c $cargo fmt --all 2019-01-27 22:39:49 +09:00
Eric Huss b5144c7f83 Add test for publish with [patch] + cleanup. 2019-01-11 19:14:58 -08:00
bors c9fa7db4d4 Auto merge of #6453 - spacekookie:publish-featured, r=alexcrichton
Adding feature-flags to `cargo publish` and `cargo package`

This change adds the `--features` and `--all-features` flags to the
above mentioned commands. This is to allow publishing of crates that
have certain feature requirements for compilation, without having to
rely on `--no-verify` which isn't good practise.

This PR adds two new fields `features` and `all_features` to both the
`PackageOpts` and `PublishOpts` and also adds the argument options
to the CLI commands.

Merging this feature will allow people to publish crates on crates.io
that require some feature flag to compile (or all?) without needing
to rely on not checking the package before uploading, potentially
resulting in less packaging errors and broken packages.
2019-01-10 18:37:22 +00:00
Katharina Fey b29e37968a
Adding support for no-default-features to package and publish 2019-01-09 18:30:54 +01:00
Eric Huss 3d84d0ad77 Add dependency registry to cargo metadata.
This adds the `registry` field for dependencies for alternate registries in
`cargo metadata`.
2018-12-29 21:14:25 -08:00
Katharina Fey 40cca8058d
Undoing bad formatting changes and removing redundant struct fields 2018-12-29 18:18:50 +01:00
Katharina Fey 142bafb7e6
Adding feature tests to publish and package 2018-12-29 11:45:05 +01:00
Alex Crichton fecb724643 Format with cargo fmt 2018-12-08 03:19:47 -08:00
Dale Wijnand 04ddd4d0fc
Upgrade to Rust 2018 2018-12-06 20:18:35 +01:00
Ximin Luo dd998a096b Fix package::include/exclude tests so they work even if running them not in cargo.git 2018-11-04 08:59:20 -08:00
Guillaume Gomez 2fc6b3e338 revert b1d6a7e changes 2018-09-14 23:19:00 +02:00
Zach Lute b020d3789a Resolve merge conflicts with test string changes. 2018-09-09 16:48:57 -07:00
Zach Lute 89f43938fe Print file paths instead of file:// URLs.
This change ensures cargo will output file paths in the expected format
(C:\foo\... on Windows, /foo/... elsewhere). Previously it would output
file:// URLs instead.

To support this change, additional changes were made to the test suite
string processing such that [ROOT] is now replaced with the appropriate
file path root for the platform.

The CWD template was also updated to use [CWD] like other replacement
templates and to do the replacement on the expected value rather than
the actual value to avoid replacing things we don't expect with CWD.
2018-09-07 19:42:59 -07:00
bors 56ee6204de Auto merge of #5984 - alexcrichton:stabilize-edition, r=ehuss
Stabilize `edition` key and add `cargo new --edition`

This commit stabilizes the `edition` key in `Cargo.toml`, both in the
`[package]` section and inside subtargets. Additionally the `cargo new` and
`cargo init` subcommands have been enhanced with a `--edition` flag to allow
explicitly specifying the edition to be generated.

This commit does not yet change the default edition that's generated.

Closes #5980
2018-09-06 22:17:24 +00:00
Alex Crichton 3d0290398a Stabilize edition key and add cargo new --edition
This commit stabilizes the `edition` key in `Cargo.toml`, both in the
`[package]` section and inside subtargets. Additionally the `cargo new` and
`cargo init` subcommands have been enhanced with a `--edition` flag to allow
explicitly specifying the edition to be generated.

This commit does not yet change the default edition that's generated.

Closes #5980
2018-09-06 11:28:10 -07:00
Dale Wijnand 7bda434a57
support::git::Repository doesn't support .cargo (yet?) 2018-09-06 07:33:24 +01:00
Dale Wijnand 4415c72828
Remove/reworksome redundant .cwd(p.root()) in tests 2018-09-06 01:12:53 +01:00
Matthias Krüger 2cd9cce6e3 clippy: resolve all warnings about useless format!() 2018-09-03 11:38:29 +02:00
Dale Wijnand d5fc8dc3a7
Introduce the CWD macro in test output asserting
Avoids dealing with things like CWD changing.
2018-08-30 11:05:29 +02:00
Dale Wijnand 570fe8927d
Remove hamcrest existing_file() 2018-08-29 10:26:12 +02:00
Dale Wijnand a5de2c0ce7
Remove hamcrest contains() 2018-08-29 07:42:03 +02:00
Dale Wijnand 85984a8700
Migrate from tests fom assert_that/execs to .run() 2018-08-28 15:08:12 +02:00
Dale Wijnand b5ee3635ef
Wrap ProcessBuilder in Execs & make .cargo return that 2018-08-28 09:24:37 +01:00
bors 0ec7281b9c Auto merge of #5886 - dekellum:record-package-git-head-3, r=alexcrichton
Generate .cargo_vcs_info.json and include in `cargo package` (take 2)

Implements #5629 and supersedes #5786, with the following improvements:

* With an upstream git2-rs fix (tracked #5823, validated and min version update in: #5858), no longer requires windows/unix split tests.

* Per review in #5786, drops file system output and locks for .cargo_vcs_info.json.

* Now uses serde `json!` macro for json production with appropriate escaping.

* Now includes a test of the output json format.

Possible followup:

* Per discussion in #5786, we could improve reliability of both the VCS dirty check and the git head sha1 recording by preferring (and/or warning otherwise) the local repository bytes of each source file, at the same head commit. This makes the process more appropriately like an atomic snapshot, with no sentry file or other locking required.  However given my lack of a window's license and dev setup, as exhibited by troubles of #5823, this feel intuitively like too much to attempt to change in one iteration here.  I accept the "best effort" concept of this feature as suggested in #5786, and think it acceptable progress if merged in this form.

@alexcrichton r?
@joshtriplett cc
2018-08-20 21:18:45 +00:00