Commit graph

48 commits

Author SHA1 Message Date
hi-rustin
ed9dc44f47 Update other tests to use cargo:: syntax
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-23 13:17:55 +08:00
Ed Page
293f2250d6 feat(doc): Print the generated docs links
I've wanted something like this myself.  I dislike using `--open`
because I tend to move up to re-run my `cargo doc` run but then have to
edit it to remove `--open`.
Also makes it annoying when opening docs when `cargo doc` is wrapped by
a tool like `make`.

This was previously attempted in #5592:
- Unlike the request in #5562, this aligns with #5592 in always printing
  rather than using a flag as this seems generally useful
- Unlike #5592, this prints as an alternative to "Opening" to keep
  things light
- Unlike #5592, this prints afterwards as the link is only valid then

Fixes #5562
2023-10-19 10:51:56 -05:00
Matheus Z Marchiore
380719da35 feat: add package name and version to warning messages 2023-10-11 16:52:30 -03:00
Ethan Brierley
1f80ffabd1 Improve resolver version mismatch warning
fixes: #12557
2023-08-27 21:11:20 +01:00
Wim Looman
3dec6f234d
Remove unnecessary warning line 2023-05-26 20:27:34 +02:00
Wim Looman
49cc60b1aa
Add notes on how to configure the virtual workspace's resolver 2023-05-26 20:20:56 +02:00
Wim Looman
7067d0df58
Improve warning message grammar 2023-05-26 20:09:27 +02:00
Wim Looman
620f66fa92
Mention workspace root's manifest explicitly 2023-05-26 16:41:04 +02:00
Wim Looman
2e2b3c1f1e
Warn when an edition 2021 crate is in a virtual workspace with default resolver
Edition 2021 updates the default resolver to version "2", but developers
using virtual workspaces commonly don't get this update because the
virtual workspace defaults to version "1". Warn when this situation
occurs so those developers can explicitly configure their workspace and
will be more likely to know that they will need to update it in the
future.
2023-05-26 16:11:09 +02:00
Scott Schafer
da70f75ae4 chore: update features2 tests to use check 2023-02-20 12:21:15 -06:00
Rémy Rakic
2bfc813b9f update test proc_macro_ws
This non-regression test didn't pass as-is because of the new debuginfo
build deps optimization. This restores the original intent of the test.
2023-01-31 22:36:20 +00:00
Weihang Lo
e295a1056e
test(features2): test to prevent regressing of optional host deps of dep 2022-11-07 17:42:05 +00:00
Scott Schafer
c239e407e7 add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
Scott Schafer
4bc8fe85bd remove unneeded nightly flags from various tests 2022-07-14 19:55:44 -05:00
bors
46c9b51957 Auto merge of #10346 - yerke:yerke/no-run-test-executable-path, r=ehuss
Print executable name on cargo test --no-run #2

Closes #9957

This is a continuation of https://github.com/rust-lang/cargo/pull/9959.
2022-02-20 15:47:58 +00:00
Yerkebulan Tulibergenov
ed579b66e2 add short path name for executables 2022-01-31 10:37:02 -08:00
Yerkebulan Tulibergenov
a6c1459f37 fix tests 2022-01-30 23:59:54 -08:00
Maybe Waffle
b7e5186701 Add test for --all-features --features dep/feat 2022-01-30 13:33:08 +03:00
Vaibhav
bef4d79ff2 Print executable name on cargo test --no-run.
Closes #9957

Signed-off-by: Vaibhav <vrongmeal@gmail.com>
2021-10-05 23:47:38 +05:30
Eric Huss
70a607eaa7 Remove nbsp characters. 2021-07-30 15:40:37 -07:00
Matthias Krüger
1b7fa21f39 fix clippy warnings
fixes these clippy warnings:

map_collect_result_unit
needless_borrow
needless_return
into_iter_on_ref
manual_flatten
match_like_matches_macro
bool_comparison
2021-04-02 12:30:36 +02:00
Eric Huss
37f4ff9a9a Make "2" the default resolver in the 2021 edition. 2021-02-17 22:06:58 -08:00
Eric Huss
d4b3a1d43c Fix panic with cargo doc and new resolver and proc-macros. 2021-01-12 09:17:49 -08:00
Eric Huss
a84689870f Fix unit_for computation on proc-macros in shared workspace. 2021-01-09 15:23:47 -08:00
Eric Huss
d087aeb845 Stabilize -Zfeatures and -Zpackage-features. 2020-12-19 08:26:42 -08:00
Jon Gjengset
7367e4390c Make cargo metadata and tree respect target
Previously, the `metadata` and `tree` subcommands would download
dependencies for all targets, regardless of whether those targets were
actually enabled. This PR updates them so that they only download the
same dependencies that building would do with the requested target(s).

`cargo metadata` still includes all targets by default; you can only opt
_out_ using `--filter-platform`. Ideally it should use `--target` the
same way `tree` does, but it's too late to change that now.

Fixes #8981.
2020-12-16 14:22:30 -08:00
Eric Huss
b1029b7d16 Allow resolver="1" to explicitly use the old resolver behavior. 2020-11-13 12:03:15 -08:00
Eric Huss
3d5a908393 Avoid some extra downloads with new feature resolver. 2020-10-31 16:49:22 -07:00
Eric Huss
bcfdf9fbad New namespaced features implementation. 2020-10-23 16:04:41 -07:00
Eric Huss
7f02a671a5 Fix panic in cargo doc with -Zfeatures=itarget 2020-10-13 15:39:46 -07:00
Eric Huss
6fe6595c17 Properly set for_host for proc-macro tests. 2020-09-28 16:21:55 -07:00
Eric Huss
6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Eric Huss
9efa0d5526 Fix non-determinism with new feature resolver. 2020-09-13 10:06:19 -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
d267fac227 Fix panic with cargo tree --target=all -Zfeatures=all 2020-05-22 14:35:07 -07:00
Eric Huss
5907db6599 Fix warning for resolve mismatch in workspace. 2020-04-27 14:16:41 -07:00
Eric Huss
787e75b797 Add resolver opt-in for new feature resolver. 2020-04-19 08:45:18 -07:00
Eric Huss
86ee8cecd3 Fix -Zfeatures=itarget with certain host dependencies 2020-03-27 14:58:03 -07:00
Eric Huss
b112255f37 Fix bug with -Zfeatures=dev_dep and check --profile=test. 2020-03-22 10:58:10 -07:00
Eric Huss
0b115f57aa -Zfeatures=host_dep: Support decoupling proc-macro features. 2020-03-15 15:59:42 -07:00
Eric Huss
887ee6cc70 Fix bug with new feature resolver and required-features. 2020-03-03 11:46:37 -08:00
Eric Huss
4d0fda7cd9 Fix bug where an optional dependency is disabled in one fork, and enabled in another. 2020-02-20 12:15:40 -08:00
Eric Huss
8973b95922 Fix bug where required-features didn't work with -Zfeatures=build_dep correctly. 2020-02-20 12:04:28 -08:00
Eric Huss
da678a75d5 Add -Zfeatures=all option. 2020-02-20 12:04:28 -08:00
Eric Huss
899067fbec Add a cyclical dev-dep test. 2020-02-20 12:04:28 -08:00
Eric Huss
2c8b9fb5ee Add test for build script being run multiple times. 2020-02-20 12:04:28 -08:00
Eric Huss
d728f386e7 Ensure dev-dep features are unified if any are used.
There is a complex issue where `cargo test -Zfeatures=dev_dep` was
building things incorrectly if there was a binary executable. The issue
is that lib.rs needed to be built twice (once linked against normal
dependencies, once against dev dependencies), but the current Unit
structure can't distinguish between the two, and thus it was picking the
wrong one.

Instead of allowing `cargo test` to build binaries without
dev-dependency features, just link main.rs against the
dev-dependency-unified versions.

We may need to revisit this in the future, but for now it is not clear
what people want or how this should work. Fixing this would require
substantial changes to how unit dependencies are computed (to properly
handle deduplication), so for now we'll use a simpler solution. It would
also mean `cargo test` would take longer on some projects (because it
would need to build the library 3 times instead of twice).
2020-02-20 12:04:28 -08:00
Eric Huss
7caa1612cf Add new feature resolver. 2020-02-20 12:04:28 -08:00