Skip to content

Commit 2bcebde

Browse files
committed
Temporary revert all tests workarounds and run tests with gnu host
1 parent bba272d commit 2bcebde

File tree

7 files changed

+14
-54
lines changed

7 files changed

+14
-54
lines changed

src/bootstrap/test.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -1636,9 +1636,8 @@ impl Step for Crate {
16361636
// libstd, then what we're actually testing is the libstd produced in
16371637
// stage1. Reflect that here by updating the compiler that we're working
16381638
// with automatically.
1639-
// FIXME(mati865): do similar for the other branch if this is correct
16401639
let compiler = if builder.force_use_stage1(compiler, target) {
1641-
builder.compiler(1, builder.config.build)
1640+
builder.compiler(1, compiler.host)
16421641
} else {
16431642
compiler.clone()
16441643
};
@@ -1803,10 +1802,6 @@ impl Step for CrateRustdoc {
18031802
cargo.arg("--");
18041803
cargo.args(&builder.config.cmd.test_args());
18051804

1806-
if target.contains("musl") {
1807-
cargo.arg("'-Ctarget-feature=-crt-static'");
1808-
}
1809-
18101805
if !builder.config.verbose_tests {
18111806
cargo.arg("--quiet");
18121807
}

src/ci/docker/dist-x86_64-musl/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,6 @@ ENV HOSTS=x86_64-unknown-linux-musl \
4949

5050
ENV RUSTFLAGS="-C target-feature=-crt-static"
5151

52-
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
52+
ENV SCRIPT \
53+
python2.7 ../x.py test --target $HOSTS && \
54+
python2.7 ../x.py dist --host $HOSTS --target $HOSTS

src/test/run-make-fulldeps/link-cfg/Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
all: $(call DYLIB,return1) $(call DYLIB,return2) $(call NATIVE_STATICLIB,return3)
44
ls $(TMPDIR)
5-
6-
$(BARE_RUSTC) --print cfg --target x86_64-unknown-linux-musl | $(CGREP) crt-static
5+
$(RUSTC) --print cfg --target x86_64-unknown-linux-musl | $(CGREP) crt-static
76

87
$(RUSTC) no-deps.rs --cfg foo
98
$(call RUN,no-deps)

src/test/run-make-fulldeps/linker-output-non-utf8/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ all:
2020
$(RUSTC) library.rs
2121
mkdir $(bad_dir)
2222
mv $(TMPDIR)/liblibrary.a $(bad_dir)
23-
$(RUSTC) -L $(bad_dir) exec.rs 2>&1 | $(CGREP) this_symbol_not_defined
23+
LIBRARY_PATH=$(bad_dir) $(RUSTC) exec.rs 2>&1 | $(CGREP) this_symbol_not_defined

src/test/run-make-fulldeps/reproducible-build/Makefile

-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
-include ../tools.mk
2-
3-
# ignore-musl
4-
#
5-
# diff:
6-
# -/checkout/obj/build/x86_64-unknown-linux-musl/test/run-make-fulldeps/reproducible-build/reproducible-build/rustcORhwur/libunwind-cfdf9e23c318976b.rlib: 6220632559893696134
7-
# +/checkout/obj/build/x86_64-unknown-linux-musl/test/run-make-fulldeps/reproducible-build/reproducible-build/rustcMaw0kI/libunwind-cfdf9e23c318976b.rlib: 6220632559893696134
8-
92
all: \
103
smoke \
114
debug \

src/test/run-make/rustc-macro-dep-files/Makefile

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
# FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC`
44
# instead of hardcoding them everywhere they're needed.
55
all:
6-
ifeq ($(IS_MUSL_HOST),1)
7-
$(BARE_RUSTC) $(RUSTFLAGS) -Clinker=$(RUSTC_LINKER) foo.rs --out-dir $(TMPDIR)
8-
else
9-
$(BARE_RUSTC) foo.rs --out-dir $(TMPDIR)
10-
endif
6+
$(BARE_RUSTC) foo.rs --out-dir $(TMPDIR)
117
$(RUSTC) bar.rs --target $(TARGET) --emit dep-info
128
$(CGREP) -v "proc-macro source" < $(TMPDIR)/bar.d

src/tools/compiletest/src/runtest.rs

+7-32
Original file line numberDiff line numberDiff line change
@@ -1602,15 +1602,18 @@ impl<'test> TestCx<'test> {
16021602
None
16031603
} else if self.config.target.contains("cloudabi")
16041604
|| self.config.target.contains("emscripten")
1605+
|| (self.config.target.contains("musl") && !aux_props.force_host)
16051606
|| self.config.target.contains("wasm32")
16061607
{
16071608
// We primarily compile all auxiliary libraries as dynamic libraries
16081609
// to avoid code size bloat and large binaries as much as possible
16091610
// for the test suite (otherwise including libstd statically in all
16101611
// executables takes up quite a bit of space).
16111612
//
1612-
// For targets like Emscripten, however, there is no support for
1613-
// dynamic libraries so we just go back to building a normal library.
1613+
// For targets like MUSL or Emscripten, however, there is no support for
1614+
// dynamic libraries so we just go back to building a normal library. Note,
1615+
// however, that for MUSL if the library is built with `force_host` then
1616+
// it's ok to be a dylib as the host should always support dylibs.
16141617
Some("lib")
16151618
} else {
16161619
Some("dylib")
@@ -1842,36 +1845,19 @@ impl<'test> TestCx<'test> {
18421845
None => {}
18431846
}
18441847

1845-
// Musl toolchain is build on linux-gnu host
1846-
// but with proper setup it can behave almost* like native linux-musl.
1847-
// One difference is "cc" which will link to glibc; force musl cc.
18481848
if self.props.force_host {
18491849
self.maybe_add_external_args(&mut rustc,
18501850
self.split_maybe_args(&self.config.host_rustcflags));
1851-
if self.config.target.contains("musl") {
1852-
if let Some(ref linker) = self.config.linker {
1853-
rustc.arg(format!("-Clinker={}", linker));
1854-
}
1855-
}
18561851
} else {
18571852
self.maybe_add_external_args(&mut rustc,
18581853
self.split_maybe_args(&self.config.target_rustcflags));
18591854
if !is_rustdoc {
18601855
if let Some(ref linker) = self.config.linker {
18611856
rustc.arg(format!("-Clinker={}", linker));
18621857
}
1863-
} else if self.config.target.contains("musl") {
1864-
if let Some(ref linker) = self.config.linker {
1865-
rustc.arg(format!("--linker={}", linker));
1866-
}
18671858
}
18681859
}
18691860

1870-
// Use dynamic musl for tests because static doesn't allow creating dylibs
1871-
if self.config.target.contains("musl") {
1872-
rustc.arg("-Ctarget-feature=-crt-static");
1873-
}
1874-
18751861
rustc.args(&self.props.compile_flags);
18761862

18771863
rustc
@@ -2655,12 +2641,6 @@ impl<'test> TestCx<'test> {
26552641
// compiler flags set in the test cases:
26562642
cmd.env_remove("RUSTFLAGS");
26572643

2658-
// Use dynamic musl for tests because static doesn't allow creating dylibs
2659-
if self.config.target.contains("musl") {
2660-
cmd.env("RUSTFLAGS", "-Ctarget-feature=-crt-static")
2661-
.env("IS_MUSL_HOST", "1");
2662-
}
2663-
26642644
if self.config.target.contains("msvc") && self.config.cc != "" {
26652645
// We need to pass a path to `lib.exe`, so assume that `cc` is `cl.exe`
26662646
// and that `lib.exe` lives next to it.
@@ -2683,13 +2663,8 @@ impl<'test> TestCx<'test> {
26832663
.env("CC", format!("'{}' {}", self.config.cc, cflags))
26842664
.env("CXX", format!("'{}'", &self.config.cxx));
26852665
} else {
2686-
let cflags = if self.config.target.contains("musl") {
2687-
self.config.cflags.replace("-static", "")
2688-
} else {
2689-
self.config.cflags.to_string()
2690-
};
2691-
cmd.env("CC", format!("{} {}", self.config.cc, cflags))
2692-
.env("CXX", format!("{} {}", self.config.cxx, cflags))
2666+
cmd.env("CC", format!("{} {}", self.config.cc, self.config.cflags))
2667+
.env("CXX", format!("{} {}", self.config.cxx, self.config.cflags))
26932668
.env("AR", &self.config.ar);
26942669

26952670
if self.config.target.contains("windows") {

0 commit comments

Comments
 (0)