Skip to content

Commit 2705081

Browse files
authored
Merge pull request #591 from tgross35/testing-updates
Add a way to test more targets on non-linux machines
2 parents 2978bdd + 656928f commit 2705081

File tree

24 files changed

+202
-88
lines changed

24 files changed

+202
-88
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
*.rs.bk
22
Cargo.lock
33
target
4+
compiler-rt
5+
*.tar.gz

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,26 @@ features = ["c"]
7878
[8]: http://en.cppreference.com/w/cpp/language/implicit_conversion
7979
[9]: https://doc.rust-lang.org/std/primitive.i32.html
8080

81+
## Testing
82+
83+
The easiest way to test locally is using Docker. This can be done by running
84+
`./ci/run-docker.sh [target]`. If no target is specified, all targets will be
85+
run.
86+
87+
In order to run the full test suite, you will also need the C compiler runtime
88+
to test against, located in a directory called `compiler-rt`. This can be
89+
obtained with the following:
90+
91+
```sh
92+
curl -L -o rustc-llvm-18.0.tar.gz https://github.com/rust-lang/llvm-project/archive/rustc/18.0-2024-02-13.tar.gz
93+
tar xzf rustc-llvm-18.0.tar.gz --strip-components 1 llvm-project-rustc-18.0-2024-02-13/compiler-rt
94+
````
95+
96+
Local targets may also be tested with `./ci/run.sh [target]`.
97+
98+
Note that testing may not work on all hosts, in which cases it is acceptable to
99+
rely on CI.
100+
81101
## Progress
82102

83103
- [x] adddf3.c

build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,9 @@ mod c {
572572
// rust-lang/rust.
573573
let root = match env::var_os("RUST_COMPILER_RT_ROOT") {
574574
Some(s) => PathBuf::from(s),
575-
None => panic!("RUST_COMPILER_RT_ROOT is not set"),
575+
None => {
576+
panic!("RUST_COMPILER_RT_ROOT is not set. You may need to download compiler-rt.")
577+
}
576578
};
577579
if !root.exists() {
578580
panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display());

ci/docker/aarch64-unknown-linux-gnu/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc libc6-dev ca-certificates \

ci/docker/arm-unknown-linux-gnueabi/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc libc6-dev ca-certificates \

ci/docker/arm-unknown-linux-gnueabihf/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc libc6-dev ca-certificates \

ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc libc6-dev ca-certificates \
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc-multilib libc6-dev ca-certificates
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc-multilib libc6-dev ca-certificates

ci/docker/mips-unknown-linux-gnu/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23

34
RUN apt-get update && \
45
apt-get install -y --no-install-recommends \

0 commit comments

Comments
 (0)