Commit graph

86 commits

Author SHA1 Message Date
Scott Schafer
0d62ae2fc3
feat: Add rustc style errors for manifest parsing 2023-12-15 13:30:10 -07:00
Weihang Lo
a3267bfa29
refactor(util-schemas): error type for restricted_names 2023-12-20 10:38:02 -05:00
Ed Page
c1d9b76401 fix: Improve feature name errors
This moves feature name validation early enough in the process to get
TOML errors.
2023-12-13 10:53:40 -06:00
Eric Huss
0afd943dad Fix some test output validation. 2023-11-15 15:10:18 -08:00
bors
2ef56214b3 Auto merge of #12939 - hi-rustin:rustin-patch-feature-msg, r=epage
Fix the invalidate feature name message
2023-11-08 17:15:01 +00:00
hi-rustin
976835d045 Update the test for the msg change
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-11-08 23:40:24 +08:00
hi-rustin
d61816465f Add test for empty feature name
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-11-08 22:52:35 +08:00
David Tolnay
649a14d470
Add regression test for issue 6915: features and transitive dev deps 2023-11-01 14:22:16 -07:00
Eric Huss
9835622853 Convert valid feature name warning to an error. 2023-06-20 12:39:27 -07:00
Scott Schafer
a5ec7e0266 chore: update features tests to use check 2023-02-20 12:21:15 -06:00
Dinu Blanovschi
2071acd5ec Add -v to some feature tests 2022-12-28 18:44:05 +01:00
Scott Schafer
ab18bd40d5 refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
Scott Schafer
cda5f82498 add preloading for workspace packages in resolve_with_previous so manifests aren't parsed twice 2022-06-16 15:34:22 -05:00
hi-rustin
8b895cc80b Use warn_on_deprecated
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-03-10 00:08:28 +08:00
hi-rustin
460ea25377 Warning on conflicting default_features keys
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-03-09 23:16:38 +08:00
Eric Huss
43a063c80a Stabilize namespaced and weak dependency features. 2022-01-06 15:56:56 -08:00
Eric Huss
85854b1884 Refactor feature handling, and improve error messages. 2021-03-19 14:59:53 -07:00
Eric Huss
d087aeb845 Stabilize -Zfeatures and -Zpackage-features. 2020-12-19 08:26:42 -08:00
Eric Huss
ea1a73a121 Add period to allowed feature name characters. 2020-12-02 07:56:44 -08:00
Eric Huss
b731190daa Add a future-compatibility warning on allowed feature name characters. 2020-10-27 14:23:35 -07:00
Eric Huss
bcfdf9fbad New namespaced features implementation. 2020-10-23 16:04:41 -07:00
Eric Huss
2611f5c73c Move namespaced features tests to a separate file. 2020-10-23 16:04:41 -07:00
Ivan Tham
fd5902c6ca
Fix help message in features.rs test 2020-10-14 10:21:37 +08:00
Eric Huss
6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Alex Tokarev
19a9579031 Warn on missing required-features
Co-authored-by: Eric Huss <eric@huss.org>
2020-07-26 13:01:18 +03: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
ab73b2c35c Fix order-dependent feature resolution. 2020-06-21 17:28:36 -07:00
Eric Huss
4ae79d2ffd Use fs helpers instead of File functions. 2020-04-17 07:56:16 -07:00
Eric Huss
54ace8af65 Merge -Zpackage-features2 and -Zpackage-features. 2020-04-08 14:06:09 -07:00
Eric Huss
7caa1612cf Add new feature resolver. 2020-02-20 12:04:28 -08:00
Jonas Platte
2166db8c49
Add a note to the error message for using --feature / --no-default-features in a virtual workspace 2019-12-24 14:46:16 +01:00
Eric Huss
83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Eric Huss
4d524ea57b Allow --all-features in root of virtual workspace. 2019-10-18 09:39:58 -07:00
Eric Huss
bf474ba589 Reject feature flags in a virtual workspace. 2019-10-14 12:40:14 -07:00
Alex Crichton
1fa02e77b6 Fix interpretation of --features a b on the CLI
Fixes an accidental regression from #7084 where `--features a b` was
erroneously mistinterpreted as `--features "a b"`.

Closes #7418
2019-09-24 09:24:47 -07: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
ecf824f7b2 Update additional uses of --all.
- man pages
- Slightly reword deprecation notice.
- Include --all in man pages.
- Update some additional usages in code and docs.
2019-09-03 17:51:07 -07:00
k-nasa
7176df01d6 Change --all to --workspace 2019-09-03 17:14:34 -07:00
Eric Huss
88d3b4ce42 Remove debug panic in package-features. 2019-08-05 08:44:13 -07:00
bors
10776bdde3 Auto merge of #7084 - scruffystuffs:invoke-feature-multi, r=alexcrichton
Add support for multiple --features options

Closes #7076

Pretty straightforward, but I added an extra test to make sure that space-separated features work in conjunction with multiple --features options.
2019-07-19 13:56:28 +00:00
Eric Huss
a4e9611453 Fix some formatting for some strings. 2019-07-13 16:00:47 -07:00
Wesley Van Melle
51c26b6776 Add support for multiple --features options 2019-07-01 15:29:38 -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
Alex Crichton
dbc2c2b57d Don't synthesize feature diretives for non-optional deps
Currently when Cargo is invoked on the command like `cargo build
--features foo/bar` then it will actually always compile the current
crate with `feature = "foo"` even if `foo` is a non-optional dependency.
This isn't intended because the crate doesn't actually have a `foo`
feature as so no directive should be emitted or passed to the compiler.

This was discovered in rust-lang/rust where Cargo is being built with
the `rustc-workspace-hack` feature but when the RLS depends on Cargo it
doesn't enable the same feature. This feature, however, doesn't actually
exist for Cargo!
2019-06-05 09:10:10 -07:00
Eh2406
35ff555b70 just give up and make it an error 2019-04-22 17:31:55 -04:00
Alexander Regueiro
f7c91ba622
Various cosmetic improvements. 2019-02-20 10:58:27 +00:00
Eric Huss
f58d107e7c testsuite: Require failing commands to check output. 2018-12-28 17:59:36 -08:00
Alex Crichton
fecb724643 Format with cargo fmt 2018-12-08 03:19:47 -08:00
bors
41a7e150fc Auto merge of #6387 - dwijnand:rust-2018, r=dwijnand
Upgrade to Rust 2018 & fix edition idioms

None
2018-12-07 16:37:19 +00:00
Dale Wijnand
04ddd4d0fc
Upgrade to Rust 2018 2018-12-06 20:18:35 +01:00