215 Commits

Author SHA1 Message Date
Eric Huss
35758d2c92 Disable long_file_names test if not supported on Windows. 2020-07-08 16:57:40 -07:00
Martin Pool
0dfd4a88fd Add test for packaging long file names 2020-07-04 17:52:02 -07:00
Alex Crichton
6514c289d2 Improve git error messages a bit
This commit is targeted at further improving the error messages
generated from git errors. For authentication errors the actual URL
fetched is now printed out as well if it's different from the original
URL. This should help handle `insteadOf` logic where SSH urls are used
instead of HTTPS urls and users can know to track that down.

Otherwise the logic about recommending `net.git-fetch-with-cli` was
tweaked a bit and moved to the same location as the rest of our error
reporting.

Note that a change piggy-backed here as well is that `Caused by:` errors
are now automatically all tabbed over a bit instead of only having the
first line tabbed over. This required a good number of tests to be
updated, but it's just an updated in renderings.
2020-06-25 08:47:15 -07:00
Eric Huss
156c65123f Allow cargo package --list even for things that don't package. 2020-04-28 10:49:21 -07:00
Hanif Bin Ariffin
2c67111552 Added warning when using restricted names in Windows. 2020-04-26 06:13:08 -07:00
Eric Huss
1232ad3cde Don't require Cargo.toml to be in root of a git repo for path source walking. 2020-04-22 11:29:59 -07:00
Eric Huss
787e75b797 Add resolver opt-in for new feature resolver. 2020-04-19 08:45:18 -07:00
bors
b04345c21b Auto merge of #8122 - kornelski:future-edition, r=Eh2406
Hint upgrading for future edition keys

A more specific error message for potentially-future edition values.

This error is likely to be seen by people who are not regular Rust users and are just trying to build someone's crate. It may be helpful to stronger hint at upgrading Cargo, rather than display a more general message about an unknown value.

I know Cargo plans to fix it better with explicit MSRV eventually, but that's not ready yet, so it's better to land something sooner.
2020-04-17 15:20:04 +00:00
Eric Huss
4ae79d2ffd Use fs helpers instead of File functions. 2020-04-17 07:56:16 -07:00
Kornel
f57c4c9ba3 Hint upgrading for future edition keys 2020-04-17 15:23:59 +01:00
Eric Huss
2a874aa522 Warn when packaging files with Windows special names. 2020-03-02 16:14:36 -08:00
Matthias Krüger
1d912002e9 fix most remaining clippy findings (mostly redundant imports) 2020-02-21 12:15:16 +01:00
Eric Huss
90887707ed Copy license-file into package if outside of root. 2020-02-20 13:27:25 -08:00
Eric Huss
ab33bc0c36 Add a warning if license-file points to a file that does not exist. 2020-02-20 13:27:00 -08:00
bors
c8595e8897 Auto merge of #7680 - stefanhoelzl:issue-7183, r=ehuss
include dotfiles in packages

This PR solves #7183

It changes the behavior of `cargo package` to also include dotfiles by default.

It should be discussed if this is intended or if the implementation should be changed to only include dotfiles which are specified in the `include` section.

From the [existing comment](40885dfab4/src/cargo/sources/path.rs (L358)) it is a little bit unclear to me, but I supposed it was intended only to exclude directories starting with a dot?
2019-12-12 18:19:57 +00:00
Matthias Krüger
34f2d4710b fix a couple of typos 2019-12-11 15:31:26 +01:00
Stefan Hoelzl
5c5d1718e3 test variant to exclude dot-files/dirs by default 2019-12-08 16:03:17 +01:00
Stefan Hoelzl
7662c2d8bb added dotfile to include test
got rid of extra test for dotfiles
2019-12-08 12:10:13 +01:00
Stefan Hoelzl
60db94c056 fix format issues 2019-12-07 20:19:17 +01:00
Stefan Hoelzl
525e250be5 added testcase 2019-12-06 22:21:14 +01:00
Eric Huss
83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Alex Crichton
9115b2c326 Extract support directory to its own crate
Extract out all our test support code to its own standalone crate so it
can be shared between multiple test suites if necessary.
2019-09-16 11:47:09 -07:00
Eric Huss
3c20a24335 Clean up some git test support functions. 2019-08-12 22:25:36 -07:00
Thom Wiggers
d0f7c0ee31
Cargo fmt 2019-07-30 10:02:05 +02:00
Thom Wiggers
55e5623368
Don't run symlink tests based on symlink_supported 2019-07-30 09:31:35 +02:00
Thom Wiggers
673bb69cf5
Ignore tests that need Administrator privileges on Windows.
This patch allows you to run them when wanted with ``--ignored`` on Windows.
2019-07-30 09:31:35 +02:00
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