Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some CI Fixes #1691

Merged
merged 8 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ jobs:
os: ubuntu-latest
- tuple: riscv64gc-unknown-linux-gnu
os: ubuntu-latest
- tuple: powerpc-unknown-linux-gnu
os: ubuntu-latest
- tuple: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
# MIPS targets disabled since they are dropped to tier 3.
Expand Down Expand Up @@ -155,6 +157,10 @@ jobs:
# tuple: mipsel-unknown-linux-musl
# os: ubuntu-latest
# norun: true
- target:
tuple: powerpc-unknown-linux-gnu
os: ubuntu-latest
disable_assert_instr: true
- target:
tuple: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
Expand All @@ -171,11 +177,6 @@ jobs:
tuple: aarch64-pc-windows-msvc
os: windows-latest
norun: true
- target:
tuple: x86_64-pc-windows-msvc
os: windows-latest
profile: dev
norun: true # FIXME: why doesn't this work in debug mode?

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ FROM ubuntu:24.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross \
qemu-system-ppc file make
file make

ENV CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-linux-gnu-gcc \
CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64 -cpu power9 -L /usr/powerpc64-linux-gnu" \
CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64 -cpu power10 -L /usr/powerpc64-linux-gnu" \
CC=powerpc64-linux-gnu-gcc \
OBJDUMP=powerpc64-linux-gnu-objdump
4 changes: 2 additions & 2 deletions ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ FROM ubuntu:24.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross \
qemu-system-ppc file make
file make

# Work around qemu triggering a sigill on vec_subs if the cpu target is not defined.
ENV CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc \
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64le -cpu power9 -L /usr/powerpc64le-linux-gnu" \
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64le -cpu power10 -L /usr/powerpc64le-linux-gnu" \
CC=powerpc64le-linux-gnu-gcc \
OBJDUMP=powerpc64le-linux-gnu-objdump
6 changes: 3 additions & 3 deletions ci/docker/x86_64-unknown-linux-gnu-emulated/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
xz-utils

RUN wget https://downloadmirror.intel.com/831748/sde-external-9.44.0-2024-08-22-lin.tar.xz
RUN tar -xJf sde-external-9.44.0-2024-08-22-lin.tar.xz
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="/sde-external-9.44.0-2024-08-22-lin/sde64 \
RUN wget https://downloadmirror.intel.com/843185/sde-external-9.48.0-2024-11-25-lin.tar.xz
RUN tar -xJf sde-external-9.48.0-2024-11-25-lin.tar.xz
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="/sde-external-9.48.0-2024-11-25-lin/sde64 \
-cpuid-in /checkout/ci/docker/x86_64-unknown-linux-gnu-emulated/cpuid.def \
-rtm-mode full -tsx --"
6 changes: 3 additions & 3 deletions ci/docker/x86_64-unknown-linux-gnu-emulated/cpuid.def
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (C) 2017-2023 Intel Corporation.
#
# Copyright (C) 2017-2024 Intel Corporation.
#
# This software and the related documents are Intel copyrighted materials, and your
# use of them is governed by the express license under which they were provided to
# you ("License"). Unless the License provides otherwise, you may not use, modify,
# copy, publish, distribute, disclose or transmit this software or the related
# documents without Intel's prior written permission.
#
#
# This software and the related documents are provided as is, with no express or
# implied warranties, other than those that are expressly stated in the License.
#
Expand Down
61 changes: 25 additions & 36 deletions ci/dox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,36 @@

set -ex

rm -rf target/doc
mkdir -p target/doc

dox() {
local arch=$1
local target=$2

echo "documenting ${arch}"

if [ "$CI" != "" ]; then
rustup target add "${target}" || true
rustup target add "${1}" || true
fi

rm -rf "target/doc/${arch}"
mkdir "target/doc/${arch}"
cargo clean --target "${1}"

cargo build --verbose --target "${target}" --manifest-path crates/core_arch/Cargo.toml
cargo build --verbose --target "${target}" --manifest-path crates/std_detect/Cargo.toml
cargo build --verbose --target "${1}" --manifest-path crates/core_arch/Cargo.toml
cargo build --verbose --target "${1}" --manifest-path crates/std_detect/Cargo.toml

rustdoc --verbose --target "${target}" \
-o "target/doc/${arch}" crates/core_arch/src/lib.rs \
--edition=2018 \
--crate-name core_arch \
--library-path "target/${target}/debug/deps"
rustdoc --verbose --target "${target}" \
-o "target/doc/${arch}" crates/std_detect/src/lib.rs \
--edition=2018 \
--crate-name std_detect \
--library-path "target/${target}/debug/deps" \
--extern cfg_if="$(ls target/"${target}"/debug/deps/libcfg_if-*.rlib)" \
--extern libc="$(ls target/"${target}"/debug/deps/liblibc-*.rlib)"
cargo doc --verbose --target "${1}" --manifest-path crates/core_arch/Cargo.toml
cargo doc --verbose --target "${1}" --manifest-path crates/std_detect/Cargo.toml
}

dox i686 i686-unknown-linux-gnu
dox x86_64 x86_64-unknown-linux-gnu
dox arm armv7-unknown-linux-gnueabihf
dox aarch64 aarch64-unknown-linux-gnu
dox powerpc powerpc-unknown-linux-gnu
dox powerpc64le powerpc64le-unknown-linux-gnu
# MIPS targets disabled since they are dropped to tier 3.
# See https://github.com/rust-lang/compiler-team/issues/648
#dox mips mips-unknown-linux-gnu
#dox mips64 mips64-unknown-linux-gnuabi64
dox wasm32 wasm32-unknown-unknown
if [ -z "$1" ]; then
dox i686-unknown-linux-gnu
dox x86_64-unknown-linux-gnu
# Disabled temporarily,
# See https://github.com/rust-lang/rust/issues/134511
#dox armv7-unknown-linux-gnueabihf
dox aarch64-unknown-linux-gnu
dox powerpc-unknown-linux-gnu
dox powerpc64le-unknown-linux-gnu
dox loongarch64-unknown-linux-gnu
# MIPS targets disabled since they are dropped to tier 3.
# See https://github.com/rust-lang/compiler-team/issues/648
#dox mips-unknown-linux-gnu
#dox mips64-unknown-linux-gnuabi64
dox wasm32-unknown-unknown
dox nvptx64-nvidia-cuda
else
dox "${1}"
fi
34 changes: 0 additions & 34 deletions ci/gba.json

This file was deleted.

4 changes: 0 additions & 4 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ cargo_test() {
wasm32*)
cmd="$cmd --nocapture"
;;
# qemu has an erratic behavior on those tests
powerpc64*)
cmd="$cmd --skip test_vec_lde_u16 --skip test_vec_lde_u32 --skip test_vec_expte"
;;
esac

if [ "$SKIP_TESTS" != "" ]; then
Expand Down
6 changes: 3 additions & 3 deletions crates/stdarch-test/src/disassembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn parse(output: &str) -> HashSet<Function> {
.filter(|&x| !x.is_empty())
.skip(1)
.map(str::to_lowercase)
.skip_while(|s| *s == "lock") // skip x86-specific prefix
.skip_while(|s| matches!(&**s, "lock" | "vex")) // skip x86-specific prefix
.collect::<Vec<String>>()
} else {
// objdump with --no-show-raw-insn
Expand All @@ -150,8 +150,8 @@ fn parse(output: &str) -> HashSet<Function> {
instruction
.split_whitespace()
.skip(1)
.skip_while(|s| *s == "lock" || *s == "{evex}") // skip x86-specific prefix
.map(std::string::ToString::to_string)
.skip_while(|s| matches!(*s, "lock" | "{evex}" | "{vex}")) // skip x86-specific prefix
.map(ToString::to_string)
.collect::<Vec<String>>()
};

Expand Down
7 changes: 6 additions & 1 deletion crates/stdarch-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ pub fn assert(shim_addr: usize, fnname: &str, expected: &str) {
// 2. It is a mark, indicating that the instruction will be
// compiled into other instructions - mainly because of llvm
// optimization.
let found = expected == "nop" || instrs.iter().any(|s| s.contains(expected));
let expected = if expected == "unknown" {
"<unknown>" // Workaround for rust-lang/stdarch#1674, todo: remove when the issue is fixed
} else {
expected
};
let found = expected == "nop" || instrs.iter().any(|s| s.starts_with(expected));

// Look for subroutine call instructions in the disassembly to detect whether
// inlining failed: all intrinsics are `#[inline(always)]`, so calling one
Expand Down
Loading