diff --git a/.cirrus.yml b/.cirrus.yml index be3c96dd3..ec2698045 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,38 +8,18 @@ linux_task: container: &step image: ghcr.io/fish-shell/fish-ci/alpine:latest memory: 4GB - - name: bionic + - name: jammy container: <<: *step - image: ghcr.io/fish-shell/fish-ci/bionic:latest - - name: bionic-asan-clang + image: ghcr.io/fish-shell/fish-ci/jammy:latest + - name: jammy-asan container: <<: *step - image: ghcr.io/fish-shell/fish-ci/bionic-asan-clang:latest - - name: bionic-tsan - container: - <<: *step - image: ghcr.io/fish-shell/fish-ci/bionic-tsan:latest - - name: bionic-tsan-clang - container: - <<: *step - image: ghcr.io/fish-shell/fish-ci/bionic-tsan-clang:latest - - name: centos7 - container: - <<: *step - image: ghcr.io/fish-shell/fish-ci/centos7:latest - - name: centos8 - container: - <<: *step - image: ghcr.io/fish-shell/fish-ci/centos8:latest + image: ghcr.io/fish-shell/fish-ci/jammy-asan:latest - name: focal-32bit container: <<: *step image: ghcr.io/fish-shell/fish-ci/focal-32bit:latest - - name: xenial - container: - <<: *step - image: ghcr.io/fish-shell/fish-ci/xenial:latest tests_script: # cirrus at times gives us 32 procs and 2 GB of RAM diff --git a/cmake/Rust.cmake b/cmake/Rust.cmake index 057262a41..7a7949663 100644 --- a/cmake/Rust.cmake +++ b/cmake/Rust.cmake @@ -11,6 +11,10 @@ if(DEFINED ASAN) list(APPEND CARGO_FLAGS "-Z" "build-std") list(APPEND FISH_CRATE_FEATURES "asan") endif() +if(DEFINED TSAN) + list(APPEND CARGO_FLAGS "-Z" "build-std") + list(APPEND FISH_CRATE_FEATURES "tsan") +endif() if (Rust_CARGO_TARGET) set(rust_target_dir "${FISH_RUST_BUILD_DIR}/${Rust_CARGO_TARGET}") diff --git a/cmake/Tests.cmake b/cmake/Tests.cmake index d345f1fa1..6b577af1c 100644 --- a/cmake/Tests.cmake +++ b/cmake/Tests.cmake @@ -139,6 +139,12 @@ if(DEFINED ASAN) intended target triple") endif() endif() +if(DEFINED TSAN) + if(NOT DEFINED Rust_CARGO_TARGET) + message(FATAL_ERROR "TSAN requires defining the CMake variable Rust_CARGO_TARGET to the + intended target triple") + endif() +endif() if(DEFINED Rust_CARGO_TARGET) list(APPEND cargo_test_flags "--target" ${Rust_CARGO_TARGET}) diff --git a/docker/alpine.Dockerfile b/docker/alpine.Dockerfile index 36f4dc6a8..f56f413e9 100644 --- a/docker/alpine.Dockerfile +++ b/docker/alpine.Dockerfile @@ -5,18 +5,21 @@ ENV LANG C.UTF-8 ENV LC_ALL C.UTF-8 RUN apk add --no-cache \ - bash \ - cmake \ - g++ \ - gettext-dev \ - git \ - libintl \ - musl-dev \ - ninja \ - pcre2-dev \ - python3 \ - py3-pexpect \ - cargo + bash \ + cargo \ + cmake \ + g++ \ + gettext-dev \ + git \ + libintl \ + musl-dev \ + ninja \ + pcre2-dev \ + py3-pexpect \ + python3 \ + rust \ + sudo \ + tmux RUN addgroup -g 1000 fishuser diff --git a/docker/centos7.Dockerfile b/docker/centos7.Dockerfile deleted file mode 100644 index 1487ef6ff..000000000 --- a/docker/centos7.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM centos:7 -LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell - -# install epel first to get cmake3 -RUN yum install --assumeyes epel-release https://repo.ius.io/ius-release-el7.rpm \ - && yum install --assumeyes \ - cmake3 \ - gcc-c++ \ - git236 \ - ninja-build \ - python3 \ - openssl \ - pcre2-devel \ - sudo \ - && yum clean all - -# cmake is called "cmake3" on centos7. -RUN ln -s /usr/bin/cmake3 /usr/bin/cmake \ - && pip3 install pexpect - -RUN groupadd -g 1000 fishuser \ - && useradd -p $(openssl passwd -1 fish) -d /home/fishuser -m -u 1000 -g 1000 fishuser -G wheel \ - && mkdir -p /home/fishuser/fish-build \ - && mkdir /fish-source \ - && chown -R fishuser:fishuser /home/fishuser /fish-source - -USER fishuser -WORKDIR /home/fishuser - -COPY fish_run_tests.sh / - -CMD /fish_run_tests.sh diff --git a/docker/centos8.Dockerfile b/docker/centos9.Dockerfile similarity index 92% rename from docker/centos8.Dockerfile rename to docker/centos9.Dockerfile index 7fb15c1fa..f1f712f11 100644 --- a/docker/centos8.Dockerfile +++ b/docker/centos9.Dockerfile @@ -1,4 +1,4 @@ -FROM centos:8 +FROM tgagor/centos-stream:latest LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell # See https://stackoverflow.com/questions/70963985/error-failed-to-download-metadata-for-repo-appstream-cannot-prepare-internal @@ -13,19 +13,21 @@ RUN dnf -y install dnf-plugins-core \ && dnf config-manager --set-enabled powertools \ && yum install --assumeyes epel-release \ && yum install --assumeyes \ + cargo \ cmake \ diffutils \ gcc-c++ \ git \ ninja-build \ python3 \ + python3-pexpect \ openssl \ pcre2-devel \ + rustc \ sudo \ + tmux \ && yum clean all -RUN pip3 install pexpect - RUN groupadd -g 1000 fishuser \ && useradd -p $(openssl passwd -1 fish) -d /home/fishuser -m -u 1000 -g 1000 fishuser -G wheel \ && mkdir -p /home/fishuser/fish-build \ diff --git a/docker/focal-32bit.Dockerfile b/docker/focal-32bit.Dockerfile index a154ca047..b079773fb 100644 --- a/docker/focal-32bit.Dockerfile +++ b/docker/focal-32bit.Dockerfile @@ -3,7 +3,7 @@ LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell ENV LANG C.UTF-8 ENV LC_ALL C.UTF-8 -ENV CXXFLAGS="-m32 -Werror=address -Werror=return-type" CFLAGS="-m32" +ENV CFLAGS="-m32" ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ @@ -19,6 +19,7 @@ RUN apt-get update \ python3 \ python3-pexpect \ sudo \ + tmux \ && locale-gen en_US.UTF-8 \ && apt-get clean @@ -32,6 +33,11 @@ RUN groupadd -g 1000 fishuser \ USER fishuser WORKDIR /home/fishuser +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh \ + && sh /tmp/rustup.sh -y --default-toolchain nightly --component rust-src + COPY fish_run_tests.sh / -CMD /fish_run_tests.sh +CMD . ~/.cargo/env \ + && rustup target add i686-unknown-linux-gnu \ + && /fish_run_tests.sh -DFISH_USE_SYSTEM_PCRE2=OFF -DRust_CARGO_TARGET=i686-unknown-linux-gnu diff --git a/docker/focal-arm64.Dockerfile b/docker/focal-arm64.Dockerfile index 4b55c7647..8bbeda1fb 100644 --- a/docker/focal-arm64.Dockerfile +++ b/docker/focal-arm64.Dockerfile @@ -8,8 +8,9 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get -y install \ build-essential \ + cargo \ cmake \ - clang-9 \ + clang \ gettext \ git \ libpcre2-dev \ @@ -17,7 +18,9 @@ RUN apt-get update \ ninja-build \ python3 \ python3-pexpect \ + rustc \ sudo \ + tmux \ && locale-gen en_US.UTF-8 \ && apt-get clean diff --git a/docker/bionic-tsan.Dockerfile b/docker/focal.Dockerfile similarity index 87% rename from docker/bionic-tsan.Dockerfile rename to docker/focal.Dockerfile index b44d6fda9..0a00b1d9d 100644 --- a/docker/bionic-tsan.Dockerfile +++ b/docker/focal.Dockerfile @@ -1,22 +1,25 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell ENV LANG C.UTF-8 ENV LC_ALL C.UTF-8 +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get -y install \ build-essential \ + cargo \ cmake \ - clang-9 \ gettext \ git \ - libpcre2-dev \ locales \ ninja-build \ + pkg-config \ python3 \ python3-pexpect \ + rustc \ sudo \ + tmux \ && locale-gen en_US.UTF-8 \ && apt-get clean @@ -32,5 +35,4 @@ WORKDIR /home/fishuser COPY fish_run_tests.sh / -ENV CXXFLAGS "-fsanitize=thread" CMD /fish_run_tests.sh diff --git a/docker/jammy-armv7-32bit.Dockerfile b/docker/jammy-armv7-32bit.Dockerfile index 427d048be..6091b1594 100644 --- a/docker/jammy-armv7-32bit.Dockerfile +++ b/docker/jammy-armv7-32bit.Dockerfile @@ -3,12 +3,12 @@ LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell ENV LANG C.UTF-8 ENV LC_ALL C.UTF-8 -ENV CXXFLAGS="-Werror=address -Werror=return-type -Wno-psabi" ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get -y install \ build-essential \ + cargo \ cmake \ file \ g++ \ @@ -20,7 +20,9 @@ RUN apt-get update \ pkg-config \ python3 \ python3-pexpect \ + rust \ sudo \ + tmux \ && locale-gen en_US.UTF-8 \ && apt-get clean diff --git a/docker/jammy-asan-clang.Dockerfile b/docker/jammy-asan.Dockerfile similarity index 97% rename from docker/jammy-asan-clang.Dockerfile rename to docker/jammy-asan.Dockerfile index 178ca8c73..35c961d6e 100644 --- a/docker/jammy-asan-clang.Dockerfile +++ b/docker/jammy-asan.Dockerfile @@ -16,9 +16,8 @@ RUN apt-get update \ ninja-build \ python3 \ python3-pexpect \ - tmux \ - rustc \ sudo \ + tmux \ && locale-gen en_US.UTF-8 \ && apt-get clean @@ -42,9 +41,9 @@ COPY fish_run_tests.sh / ENV \ RUSTFLAGS=-Zsanitizer=address \ + RUSTDOCFLAGS=-Zsanitizer=address \ CC=clang \ CXX=clang++ \ - CXXFLAGS=-DFISH_CI_SAN \ ASAN_OPTIONS=check_initialization_order=1:detect_stack_use_after_return=1:detect_leaks=1 \ LSAN_OPTIONS=verbosity=0:log_threads=0:use_tls=1:print_suppressions=0:suppressions=/fish-source/build_tools/lsan_suppressions.txt \ FISH_CI_SAN=1 diff --git a/docker/bionic-tsan-clang.Dockerfile b/docker/jammy-tsan.Dockerfile similarity index 64% rename from docker/bionic-tsan-clang.Dockerfile rename to docker/jammy-tsan.Dockerfile index 66e1c968d..ccc05a405 100644 --- a/docker/bionic-tsan-clang.Dockerfile +++ b/docker/jammy-tsan.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:jammy LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell ENV LANG C.UTF-8 @@ -8,7 +8,7 @@ RUN apt-get update \ && apt-get -y install \ build-essential \ cmake \ - clang-9 \ + clang \ gettext \ git \ libpcre2-dev \ @@ -17,6 +17,7 @@ RUN apt-get update \ python3 \ python3-pexpect \ sudo \ + tmux \ && locale-gen en_US.UTF-8 \ && apt-get clean @@ -30,7 +31,15 @@ RUN groupadd -g 1000 fishuser \ USER fishuser WORKDIR /home/fishuser +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh \ + && sh /tmp/rustup.sh -y --default-toolchain nightly --component rust-src + COPY fish_run_tests.sh / -ENV CXXFLAGS="-fsanitize=thread" CC=clang-9 CXX=clang++-9 -CMD /fish_run_tests.sh +ENV \ + RUSTFLAGS=-Zsanitizer=thread \ + RUSTDOCFLAGS=-Zsanitizer=thread \ + FISH_CI_SAN=1 + +CMD . ~/.cargo/env \ + && /fish_run_tests.sh -DTSAN=1 -DRust_CARGO_TARGET=x86_64-unknown-linux-gnu diff --git a/docker/bionic.Dockerfile b/docker/jammy.Dockerfile similarity index 91% rename from docker/bionic.Dockerfile rename to docker/jammy.Dockerfile index 36cfe2f78..6949ff01b 100644 --- a/docker/bionic.Dockerfile +++ b/docker/jammy.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:jammy LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell ENV LANG C.UTF-8 @@ -7,8 +7,9 @@ ENV LC_ALL C.UTF-8 RUN apt-get update \ && apt-get -y install \ build-essential \ + cargo \ cmake \ - clang-9 \ + clang \ gettext \ git \ libpcre2-dev \ @@ -16,7 +17,9 @@ RUN apt-get update \ ninja-build \ python3 \ python3-pexpect \ + rustc \ sudo \ + tmux \ && locale-gen en_US.UTF-8 \ && apt-get clean diff --git a/docker/xenial.Dockerfile b/docker/xenial.Dockerfile deleted file mode 100644 index 41f0fed06..000000000 --- a/docker/xenial.Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM ubuntu:16.04 -LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell - -ENV LANG C.UTF-8 -ENV LC_ALL C.UTF-8 - -RUN apt-get update \ - && apt-get -y install \ - build-essential \ - cmake \ - gettext \ - git \ - libpcre2-dev \ - locales \ - ninja-build \ - python3 \ - python3-pip \ - sudo \ - && locale-gen en_US.UTF-8 \ - && apt-get clean - -# The python3-pexpect package on Xenial doesn't allow delaybeforesend to be None. -# Install pexpect with pip which is newer. -RUN pip3 install pexpect - -RUN groupadd -g 1000 fishuser \ - && useradd -p $(openssl passwd -1 fish) -d /home/fishuser -m -u 1000 -g 1000 fishuser \ - && adduser fishuser sudo \ - && mkdir -p /home/fishuser/fish-build \ - && mkdir /fish-source \ - && chown -R fishuser:fishuser /home/fishuser /fish-source - -USER fishuser -WORKDIR /home/fishuser - -COPY fish_run_tests.sh / - -CMD /fish_run_tests.sh