From 00ce61eb890f0e2783144b226e9d4953d63542f3 Mon Sep 17 00:00:00 2001 From: Rodolfo Wottrich Date: Tue, 14 Jul 2026 10:29:50 +0000 Subject: [PATCH 1/8] CI: remove draftversion variables - Build script now takes optional --finalversion argument. - If finalversion, pdfs are generated with commit hash as version. Else, the version is described as a development version based on the commit hash (also denotes if the repo is clean). - CI always builds as finalversion. --- .github/PULL_REQUEST_TEMPLATE.md | 4 +- .github/workflows/ci.yml | 14 +--- build_with_docker.sh | 36 ++++++++++- cmse/cmse.md | 4 +- main/acle.md | 2 - morello/morello.md | 4 +- mve_intrinsics/mve.md | 4 +- mve_intrinsics/mve.template.md | 4 +- neon_intrinsics/advsimd.md | 2 - neon_intrinsics/advsimd.template.md | 2 - tools/acle_draftversion_value_check.py | 89 -------------------------- tools/acle_template.tex | 12 ++-- tools/docker/entrypoint.sh | 30 ++++++++- tools/generate-pdfs.sh | 30 ++++++++- 14 files changed, 106 insertions(+), 131 deletions(-) delete mode 100644 tools/acle_draftversion_value_check.py diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f7679e85..5859c7e7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,7 +4,7 @@ about: Technical issues, document format problems, bugs in scripts or feature pr --- - + **Thank you for submitting a pull request!** @@ -60,7 +60,5 @@ Checklist: (mark with ``X`` those which apply) correctness of the result in the PDF output (please refer to the instructions on [how to build the PDFs locally](https://github.com/ARM-software/acle/blob/main/CONTRIBUTING.md#continuous-integration)). -* [ ] The variable `draftversion` is set to `true` in the YAML header - of the sources of the specifications I have modified. * [ ] Please *DO NOT* add my GitHub profile to the list of contributors in the [README](https://github.com/ARM-software/acle/blob/main/README.md#contributors-) page of the project. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a784ef39..37f3e1b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2021 Arm Limited and/or its affiliates +# SPDX-FileCopyrightText: Copyright 2021, 2026 Arm Limited and/or its affiliates # # SPDX-License-Identifier: Apache-2.0 name: CI @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v4.1.7 - name: check the correctness of the sources and generate the PDFs - run: ./build_with_docker.sh + run: ./build_with_docker.sh --finalversion - uses: actions/upload-artifact@v4.4.0 with: name: pdfs @@ -32,13 +32,3 @@ jobs: - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: config-file: '.github/workflows/markdown-link-check.json' - - draftversion-check: - runs-on: ubuntu-latest - if: github.base_ref == 'main' || github.ref == 'refs/heads/main' - steps: - - uses: actions/checkout@v4.1.7 - with: - fetch-depth: 0 - - name: Check correctness of draftversion fields - run: python ./tools/acle_draftversion_value_check.py . diff --git a/build_with_docker.sh b/build_with_docker.sh index 713b7ca2..1c508a39 100755 --- a/build_with_docker.sh +++ b/build_with_docker.sh @@ -3,10 +3,44 @@ # SPDX-FileCopyrightText: Copyright 2021-2026 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 +finalversion="" +cleanrepo="" + +while [[ $# -gt 0 ]]; do + case "$1" in + --finalversion) + finalversion="--finalversion" + ;; + *) + echo "Unknown option: $1" >&2 + exit 1 + ;; + esac + shift +done + +# Check if repo is in a clean state +git diff --quiet && git diff --cached --quiet +if [[ $? -eq 0 ]]; then + cleanrepo="--cleanrepo" +fi + +# Get last commit +commithash="--commithash $(git rev-parse HEAD)" + +echo "Building pdfs with parameters:" +if [[ -n "$finalversion" ]]; then + echo " --finalversion" +fi +if [[ -n "$cleanrepo" ]]; then + echo " --cleanrepo" +fi +echo " $commithash" + set -x IMAGE_NAME=acle_build # Build the image. docker build -t $IMAGE_NAME tools/docker # Run the image, mounting the current folder into the /src folder of # the docker image. Run as the host user so that the output files are owned by them. -docker run --rm -u $(id -u):$(id -g) --mount type=bind,source="$(pwd)",target=/src $IMAGE_NAME +docker run --rm -u $(id -u):$(id -g) --mount type=bind,source="$(pwd)",target=/src $IMAGE_NAME $finalversion $commithash $cleanrepo diff --git a/cmse/cmse.md b/cmse/cmse.md index e62bd2be..da07ef4f 100644 --- a/cmse/cmse.md +++ b/cmse/cmse.md @@ -1,11 +1,9 @@ --- title: Arm®v8-M Security Extensions
Requirements on Development Tools -version: 1.4 date-of-issue: 21 June 2024 set-quote-highlight: true # LaTeX specific variables -copyright-text: Copyright 2019, 2021-2024 Arm Limited and/or its affiliates . -draftversion: true +copyright-text: Copyright 2019, 2021-2024, 2026 Arm Limited and/or its affiliates . # Jekyll specific variables header_counter: true toc: true diff --git a/main/acle.md b/main/acle.md index 470abd48..7d52575f 100644 --- a/main/acle.md +++ b/main/acle.md @@ -1,10 +1,8 @@ --- title: Arm C Language Extensions -version: 2026Q1 date-of-issue: 15 May 2026 # LaTeX specific variables copyright-text: "Copyright: see section \\texorpdfstring{\\nameref{copyright}}{Copyright}." -draftversion: true # Jekyll specific variables header_counter: true toc: true diff --git a/morello/morello.md b/morello/morello.md index 352d196d..9e9ff57a 100644 --- a/morello/morello.md +++ b/morello/morello.md @@ -1,10 +1,8 @@ --- title: Morello Supplement to the Arm C Language Extensions -version: 02alpha date-of-issue: 11 January 2022 # LaTeX specific variables -copyright-text: Copyright 2020-2022 Arm Limited and/or its affiliates . -draftversion: true +copyright-text: Copyright 2020-2022, 2026 Arm Limited and/or its affiliates . # Jekyll specific variables header_counter: true toc: true diff --git a/mve_intrinsics/mve.md b/mve_intrinsics/mve.md index f653ebf3..38fcc628 100644 --- a/mve_intrinsics/mve.md +++ b/mve_intrinsics/mve.md @@ -1,11 +1,9 @@ --- title: Arm MVE Intrinsics -version: 2021Q4 date-of-issue: 11 January 2022 # LaTeX specific variables landscape: true -copyright-text: Copyright 2019-2022 Arm Limited and/or its affiliates . -draftversion: true +copyright-text: Copyright 2019-2022, 2026 Arm Limited and/or its affiliates . # Jekyll specific variables header_counter: true toc: true diff --git a/mve_intrinsics/mve.template.md b/mve_intrinsics/mve.template.md index 92f4575e..4400dbe5 100644 --- a/mve_intrinsics/mve.template.md +++ b/mve_intrinsics/mve.template.md @@ -1,11 +1,9 @@ --- title: Arm MVE Intrinsics -version: 2021Q4 date-of-issue: 11 January 2022 # LaTeX specific variables landscape: true -copyright-text: Copyright 2019-2022 Arm Limited and/or its affiliates . -draftversion: true +copyright-text: Copyright 2019-2022, 2026 Arm Limited and/or its affiliates . # Jekyll specific variables header_counter: true toc: true diff --git a/neon_intrinsics/advsimd.md b/neon_intrinsics/advsimd.md index e8ceab6d..f0d95674 100644 --- a/neon_intrinsics/advsimd.md +++ b/neon_intrinsics/advsimd.md @@ -1,11 +1,9 @@ --- title: Arm Neon Intrinsics Reference -version: 2026Q1 date-of-issue: 15 May 2026 # LaTeX specific variables landscape: true copyright-text: "Copyright: see section \\texorpdfstring{\\nameref{copyright}}{Copyright}." -draftversion: true # Jekyll specific variables header_counter: true toc: true diff --git a/neon_intrinsics/advsimd.template.md b/neon_intrinsics/advsimd.template.md index c87f2781..10f74dd9 100644 --- a/neon_intrinsics/advsimd.template.md +++ b/neon_intrinsics/advsimd.template.md @@ -1,11 +1,9 @@ --- title: Arm Neon Intrinsics Reference -version: 2026Q1 date-of-issue: 15 May 2026 # LaTeX specific variables landscape: true copyright-text: "Copyright: see section \\texorpdfstring{{\\nameref{{copyright}}}}{{Copyright}}." -draftversion: true # Jekyll specific variables header_counter: true toc: true diff --git a/tools/acle_draftversion_value_check.py b/tools/acle_draftversion_value_check.py deleted file mode 100644 index 2f420e6d..00000000 --- a/tools/acle_draftversion_value_check.py +++ /dev/null @@ -1,89 +0,0 @@ -""" -" -" Copyright (C) 2023 Arm Ltd -" -""" - -from pathlib import Path -import re -import subprocess -import sys - - -def get_modified_file_list(repo_path: Path) -> list[str]: - """Use git to get the list of modified files in the patch set""" - starting_point = "origin/main" - cmd = ["git", "-C", str(repo_path), "diff", "--name-only", starting_point, "HEAD"] - - try: - git_result = subprocess.run(args=cmd, capture_output=True, check=True) - except subprocess.CalledProcessError as ex: - print( - f"Error: in command '{' '.join(cmd)}':\n{ex.stderr.decode()}", - file=sys.stderr, - ) - sys.exit(1) - - modified_files = git_result.stdout.decode().split("\n") - modified_files = [x for x in modified_files if x] - return modified_files - - -def check_file(file_path: Path) -> bool: - """Check if file has a draftversion field, and if so, that it's set to true""" - with file_path.open() as file: - print(f"Checking file {file_path}") - for line in file: - re_result = re.search(r"draftversion: (\w+)", line) - if not re_result: - continue - - value = re_result[1] - if value != "true": - print( - f"Error: file {file_path} has been modified but its draftversion" - " isn't set to true!", - file=sys.stderr, - ) - return False - - return True - - -def main() -> int: - """Check if any modified file has the wrong value for draftversion""" - if len(sys.argv) != 2: - print( - "Error: this script takes a single positional argument, which is the path" - " to the ACLE repository!", - file=sys.stderr, - ) - sys.exit(1) - - try: - repo_path = Path(sys.argv[1]).resolve(strict=True) - except FileNotFoundError: - print(f"Error: repository {sys.argv[1]} doesn't exist!", file=sys.stderr) - sys.exit(1) - - modified_files = get_modified_file_list(repo_path) - print("Files to check:") - if not modified_files: - print(" none") - else: - for path in modified_files: - print(f" - {path}") - print() - - success = True - for path in modified_files: - complete_path = repo_path / Path(path) - success = check_file(complete_path) and success - - print("\nEnd result: " + ("OK" if success else "issues found")) - - return not success - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/tools/acle_template.tex b/tools/acle_template.tex index 24e3779a..80a0d02f 100644 --- a/tools/acle_template.tex +++ b/tools/acle_template.tex @@ -1,5 +1,5 @@ % Copyright (c) 2014--2021, John MacFarlane -% SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates +% SPDX-FileCopyrightText: Copyright 2021-2022, 2026 Arm Limited and/or its affiliates % SPDX-License-Identifier: BSD-3-Clause % Based on default.latex template released with Pandoc (www.pandoc.org). % See `data/templates` in `COPYRIGHT` at https://github.com/jgm/pandoc @@ -38,10 +38,14 @@ \makeatother \sectionfont{\color{armblue}} -$if(draftversion)$ -\newcommand{\versiontext}{\textcolor{red}{Development version based on $version$}} +$if(finalversion)$ + \newcommand{\versiontext}{$commithash$} $else$ -\newcommand{\versiontext}{$version$} + $if(cleanrepo)$ + \newcommand{\versiontext}{\textcolor{red}{Development version based on $commithash$}} + $else$ + \newcommand{\versiontext}{\textcolor{red}{Development version based on $commithash$, with modifications}} + $endif$ $endif$ \newcommand{\dateofissue}{$if(draftversion)$TBD$else$$date-of-issue$$endif$} diff --git a/tools/docker/entrypoint.sh b/tools/docker/entrypoint.sh index d455b027..6b3ece82 100755 --- a/tools/docker/entrypoint.sh +++ b/tools/docker/entrypoint.sh @@ -1,8 +1,34 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright 2021 Arm Limited and/or its affiliates +# SPDX-FileCopyrightText: Copyright 2021, 2026 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 +finalversion="" + +while [[ $# -gt 0 ]]; do + case "$1" in + --finalversion) + finalversion="--finalversion" + ;; + --cleanrepo) + cleanrepo="--cleanrepo" + ;; + --commithash) + [[ $# -ge 2 ]] || { + echo "Missing argument for --commithash" >&2 + exit 1 + } + commithash="--commithash $2" + shift + ;; + *) + echo "Unknown option: $1" >&2 + exit 1 + ;; + esac + shift +done + cd /src echo $PWD ls -al @@ -11,4 +37,4 @@ ls -al # fails at any point, stop the docker run. /src/tools/hyperref-check.sh || exit 1 /src/tools/generate-intrinsics-specs.sh || exit 1 -/src/tools/generate-pdfs.sh || exit 1 +/src/tools/generate-pdfs.sh $finalversion $commithash $cleanrepo || exit 1 diff --git a/tools/generate-pdfs.sh b/tools/generate-pdfs.sh index 104cacc3..8c9acc98 100755 --- a/tools/generate-pdfs.sh +++ b/tools/generate-pdfs.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -ex -# SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates +# SPDX-FileCopyrightText: Copyright 2021-2022, 2026 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +16,32 @@ set -ex # See the License for the specific language governing permissions and # limitations under the License. +finalversion="" + +while [[ $# -gt 0 ]]; do + case "$1" in + --finalversion) + finalversion="-V finalversion" + ;; + --cleanrepo) + cleanrepo="-V cleanrepo" + ;; + --commithash) + [[ $# -ge 2 ]] || { + echo "Missing argument for --commithash" >&2 + exit 1 + } + commithash="-V commithash=$2" + shift + ;; + *) + echo "Unknown option: $1" >&2 + exit 1 + ;; + esac + shift +done + function generate_pdfs_from_md() { inputMdFile=$1 if ! [ -f "$inputMdFile" ]; then @@ -36,7 +62,7 @@ function generate_pdfs_from_md() { # in the specific case of the cmse.md file. sed -u ':a;N;$!ba;s/\*\sTOC\n{*{:toc}}*//' $inputMdFile | \ sed -u "s//$geometryForIntrinsics/" | \ - pandoc --template=tools/acle_template.tex -o $outputPdfFile --resource-path=$(dirname $inputMdFile) + pandoc --template=tools/acle_template.tex -o $outputPdfFile --resource-path=$(dirname $inputMdFile) $finalversion $commithash $cleanrepo } mkdir -p pdfs tmp From e80a470bb31a50a6333429698df220fb917aae80 Mon Sep 17 00:00:00 2001 From: Rodolfo Wottrich Date: Sat, 18 Jul 2026 19:23:58 +0100 Subject: [PATCH 2/8] Make commit hash link to commit upstream --- tools/acle_template.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/acle_template.tex b/tools/acle_template.tex index 80a0d02f..8525a808 100644 --- a/tools/acle_template.tex +++ b/tools/acle_template.tex @@ -39,12 +39,12 @@ \sectionfont{\color{armblue}} $if(finalversion)$ - \newcommand{\versiontext}{$commithash$} + \newcommand{\versiontext}{\href{https://github.com/ARM-software/acle/commit/$commithash$}{$commithash$}} $else$ $if(cleanrepo)$ - \newcommand{\versiontext}{\textcolor{red}{Development version based on $commithash$}} + \newcommand{\versiontext}{\textcolor{red}{Development version based on \href{https://github.com/ARM-software/acle/commit/$commithash$}{$commithash$}} $else$ - \newcommand{\versiontext}{\textcolor{red}{Development version based on $commithash$, with modifications}} + \newcommand{\versiontext}{\textcolor{red}{Development version based on \href{https://github.com/ARM-software/acle/commit/$commithash$}{$commithash$}, with modifications}} $endif$ $endif$ \newcommand{\dateofissue}{$if(draftversion)$TBD$else$$date-of-issue$$endif$} From 1c794966f31a236ca720f619863e079fbc6e1468 Mon Sep 17 00:00:00 2001 From: Rodolfo Wottrich Date: Sun, 19 Jul 2026 15:38:20 +0100 Subject: [PATCH 3/8] Modify version on pages navbar --- _includes/navbar.html | 16 +++++++- _sass/main.scss | 16 +++++++- tools/build-github-pages.sh | 81 ++++++++++++++++++++++++++++++------- 3 files changed, 96 insertions(+), 17 deletions(-) diff --git a/_includes/navbar.html b/_includes/navbar.html index a4013f96..bce24b31 100644 --- a/_includes/navbar.html +++ b/_includes/navbar.html @@ -1,5 +1,5 @@ - +