From 7c61fc51518b84be15417f8e9696601858d1e71b Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 26 Oct 2025 15:06:02 +0100 Subject: [PATCH] tests/sphinx-markdown-changelog: workaround for mawk awk is mawk on Ubuntu. --- build_tools/release-notes.sh | 2 +- docker/ubuntu-latest-lts.Dockerfile | 45 +++++++++++++++++++++ docker/ubuntu-oldest-supported.Dockerfile | 2 - tests/checks/sphinx-markdown-changelog.fish | 5 ++- 4 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 docker/ubuntu-latest-lts.Dockerfile diff --git a/build_tools/release-notes.sh b/build_tools/release-notes.sh index 05c99123c..d6352f9f9 100755 --- a/build_tools/release-notes.sh +++ b/build_tools/release-notes.sh @@ -14,7 +14,7 @@ version=$(sed 's,^fish \(\S*\) .*,\1,; 1q' "$workspace_root/CHANGELOG.rst") previous_version=$( cd "$workspace_root" awk 1 && # Skip tags that have not been created yet.. system("git rev-parse --verify >/dev/null --quiet refs/tags/"$2) == 0 \ diff --git a/docker/ubuntu-latest-lts.Dockerfile b/docker/ubuntu-latest-lts.Dockerfile new file mode 100644 index 000000000..6592a632f --- /dev/null +++ b/docker/ubuntu-latest-lts.Dockerfile @@ -0,0 +1,45 @@ +FROM ubuntu:latest +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 --no-install-recommends \ + cmake ninja-build \ + build-essential \ + ca-certificates \ + clang \ + curl \ + gettext \ + git \ + libpcre2-dev \ + locales \ + openssl \ + python3 \ + python3-pexpect \ + sudo \ + tmux \ + && locale-gen en_US.UTF-8 \ + && apt-get clean + +RUN userdel ubuntu \ + && groupadd -g 1000 fishuser \ + && useradd -p $(openssl passwd -1 fish) -d /home/fishuser -m -u 1000 -g 1000 fishuser \ + -G sudo \ + && mkdir -p /home/fishuser/fish-build \ + && mkdir /fish-source \ + && chown -R fishuser:1000 /home/fishuser /fish-source + +USER fishuser +WORKDIR /home/fishuser + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh \ + && sh /tmp/rustup.sh -y --no-modify-path +ENV PATH=/home/fishuser/.cargo/bin:$PATH + +COPY fish_run_tests.sh / + +ENV FISH_CHECK_LINT=false + +CMD /fish_run_tests.sh diff --git a/docker/ubuntu-oldest-supported.Dockerfile b/docker/ubuntu-oldest-supported.Dockerfile index 2a5b87de9..f4e7517ba 100644 --- a/docker/ubuntu-oldest-supported.Dockerfile +++ b/docker/ubuntu-oldest-supported.Dockerfile @@ -37,8 +37,6 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh \ && sh /tmp/rustup.sh -y --no-modify-path ENV PATH=/home/fishuser/.cargo/bin:$PATH -RUN echo $PATH - COPY fish_run_tests.sh / ENV FISH_CHECK_LINT=false diff --git a/tests/checks/sphinx-markdown-changelog.fish b/tests/checks/sphinx-markdown-changelog.fish index 6a81bf8f0..179383cb6 100644 --- a/tests/checks/sphinx-markdown-changelog.fish +++ b/tests/checks/sphinx-markdown-changelog.fish @@ -1,6 +1,6 @@ #RUN: %fish %s #REQUIRES: command -v sphinx-build -#REQUIRES: python -c 'import sphinx_markdown_builder' +#REQUIRES: python -c 'import sphinx_markdown_builder' || python3 -c 'import sphinx_markdown_builder' set -l workspace_root (status dirname)/../.. if not test -e $workspace_root/.git @@ -9,7 +9,8 @@ end $workspace_root/build_tools/release-notes.sh -q >?relnotes.md or { - echo "Failed to build Markdown release notes." + echo "Failed to build Markdown release notes, retrying with tracing" + sh -x $workspace_root/build_tools/release-notes.sh -q return } sed -n 1p relnotes.md | grep -q '^## fish \S* (released .*)'