Commit graph

8 commits

Author SHA1 Message Date
Weihang Lo
3df35edca7
fix: hack around libsysroot instead of libtest 2023-05-05 14:48:37 +01:00
Alex Crichton
602f6b64de Revert "Check if rust-src contains a vendor dir, and patch it in"
This reverts commit eadb4fc86c.
2020-12-11 07:45:27 -08:00
Alexis Beingessner
eadb4fc86c Check if rust-src contains a vendor dir, and patch it in
This is the cargo side of https://github.com/rust-lang/wg-cargo-std-aware/issues/23
2020-11-10 11:47:32 -05:00
Yuki Okushi
7c77fedabb
Fix mock-std as well 2020-07-29 12:41:49 +09:00
Alex Crichton
1faf5b9f00 Add a -Zbuild-std-features flag
This flag is intended to pair with `-Zbuild-std` as necessary to
configure the features that libstd is built with. This is highly
unlikely to ever be stabilized in any form (unlike `-Zbuild-std` which
we'd like to stabilize at some point), but can be useful for
experimenting with the standard library. For example today it can be
used to test changes to binary size by disabling backtraces.

My intention is that we won't need a `--no-default-features` equivalent
for libstd, where after rust-lang/rust#74377 is merged we can
unconditionally specify default features are disabled but the default
set of features lists `default`. That way if users want to override the
list *and* include the default feature, they can just be sure to include
`default`.
2020-07-17 07:02:19 -07:00
Yuki Okushi
0dd60d5df9 Use issue = "none" instead of "0" 2019-12-22 17:21:13 +09:00
Alex Crichton
bc5c441b12 Change how standard_lib tests work
* Minimize the sysroot crates in play
* Don't use build scripts to inject args
* Use `RUSTC_WRAPPER` to dynamically switch `--sysroot` depending on
  whether we're building sysroot crates or not.
* Minimize dependency graph in sysroot, only have each crate depend on a
  dummy crates.io crate for testing and otherwise don't depend on
  anything to load the desired sysroot crate directly.
2019-09-23 18:53:28 -07:00
Alex Crichton
4cbfd02eff Improve test suite for -Zbuild-std
This commit is aimed directly at rust-lang/wg-cargo-std-aware#33 and in
general making the `-Zbuild-std` tests more robust. The main change here
is that a new source tree is checked in, `tests/testsuite/mock-std`,
which mirrors rust-lang/rust's own tree for libstd. This mock tree is as
empty as it can be, ideally duplicating almost nothing but for not
requiring duplication of Cargo metadata about patches and such.

The end result here looks like:

* All `-Zbuild-std` tests are now run in parallel
* All tests run much more quickly since they're compiling tiny crates
  instead of actually compiling libstd/libcore
* No tests require network access
* We verify that crates have access to the "custom" libraries
  that we build

Coverage of tests is not currently expanded, but it's hoped that we
could add that shortly afterwards. Coverage has actually gone down
slightly since the custom target test was commented out temporarily and
the full integration test of running `-Zbuild-std` isn't run on CI any
more.

Closes rust-lang/wg-cargo-std-aware#33
2019-09-16 11:46:46 -07:00