From 3935790c02285a2d35ccd10fcdf6fb15e1e86bce Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 12 Jan 2025 16:42:25 +0100 Subject: [PATCH] turns out Solarish targets support our entire test suite --- README.md | 2 +- ci/ci.sh | 5 +++-- src/shims/unix/solarish/foreign_items.rs | 8 ++++++++ tests/fail-dep/libc/affinity.rs | 3 +-- tests/fail-dep/libc/memrchr_null.rs | 5 ++--- tests/pass-dep/libc/libc-affinity.rs | 3 +-- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 26528c1340..4ae901be9b 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ degree documented below): - For every other target with OS `linux`, `macos`, or `windows`, Miri should generally work, but we make no promises and we don't run tests for such targets. - We have unofficial support (not maintained by the Miri team itself) for some further operating systems. - - `solaris` / `illumos`: maintained by @devnexen. Supports `std::{env, thread, sync}`, but not `std::fs`. + - `solaris` / `illumos`: maintained by @devnexen. Supports the entire test suite. - `freebsd`: maintained by @YohDeadfall. Supports `std::env` and parts of `std::{thread, fs}`, but not `std::sync`. - `android`: **maintainer wanted**. Support very incomplete, but a basic "hello world" works. - `wasi`: **maintainer wanted**. Support very incomplete, not even standard output works, but an empty `main` function works. diff --git a/ci/ci.sh b/ci/ci.sh index 0751f86da8..5583030b49 100755 --- a/ci/ci.sh +++ b/ci/ci.sh @@ -147,13 +147,14 @@ case $HOST_TARGET in # Extra tier 2 TEST_TARGET=arm-unknown-linux-gnueabi run_tests TEST_TARGET=s390x-unknown-linux-gnu run_tests # big-endian architecture of choice + # Not officially supported tier 2 + TEST_TARGET=x86_64-unknown-illumos run_tests + TEST_TARGET=x86_64-pc-solaris run_tests # Partially supported targets (tier 2) BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator UNIX="hello panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random threadname pthread fs libc-pipe TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random threadname pthread fs libc-pipe - TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX time hashmap random thread sync available-parallelism tls libc-pipe fs - TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX time hashmap random thread sync available-parallelism tls libc-pipe fs TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random sync threadname pthread epoll eventfd TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC wasm TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std diff --git a/src/shims/unix/solarish/foreign_items.rs b/src/shims/unix/solarish/foreign_items.rs index c99e8ae7c6..98909d86c8 100644 --- a/src/shims/unix/solarish/foreign_items.rs +++ b/src/shims/unix/solarish/foreign_items.rs @@ -78,6 +78,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { this.write_scalar(result, dest)?; } + // Sockets and pipes + "__xnet_socketpair" => { + let [domain, type_, protocol, sv] = + this.check_shim(abi, Conv::C, link_name, args)?; + let result = this.socketpair(domain, type_, protocol, sv)?; + this.write_scalar(result, dest)?; + } + // Miscellaneous "___errno" => { let [] = this.check_shim(abi, Conv::C, link_name, args)?; diff --git a/tests/fail-dep/libc/affinity.rs b/tests/fail-dep/libc/affinity.rs index 09f096e46f..3acbd83d0e 100644 --- a/tests/fail-dep/libc/affinity.rs +++ b/tests/fail-dep/libc/affinity.rs @@ -1,5 +1,4 @@ -//@ignore-target: windows # only very limited libc on Windows -//@ignore-target: apple # `sched_setaffinity` is not supported on macOS +//@only-target: linux # these are Linux-specific APIs //@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4 fn main() { diff --git a/tests/fail-dep/libc/memrchr_null.rs b/tests/fail-dep/libc/memrchr_null.rs index 8b34ff4ac2..a1d8fd663f 100644 --- a/tests/fail-dep/libc/memrchr_null.rs +++ b/tests/fail-dep/libc/memrchr_null.rs @@ -1,9 +1,8 @@ -//@ignore-target: windows # No `memrchr` on Windows -//@ignore-target: apple # No `memrchr` on some apple targets +//@only-target: linux # `memrchr` is a GNU extension use std::ptr; -// null is explicitly called out as UB in the C docs. +// null is explicitly called out as UB in the C docs for `memchr`. fn main() { unsafe { libc::memrchr(ptr::null(), 0, 0); //~ERROR: null pointer diff --git a/tests/pass-dep/libc/libc-affinity.rs b/tests/pass-dep/libc/libc-affinity.rs index 3c4311efc4..400e3ca3d7 100644 --- a/tests/pass-dep/libc/libc-affinity.rs +++ b/tests/pass-dep/libc/libc-affinity.rs @@ -1,5 +1,4 @@ -//@ignore-target: windows # only very limited libc on Windows -//@ignore-target: apple # `sched_{g, s}etaffinity` are not supported on macOS +//@only-target: linux # these are Linux-specific APIs //@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4 #![feature(io_error_more)] #![feature(pointer_is_aligned_to)]