From 3d0e63d8d5b5622d5d198e3b70363743e9089179 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 30 Aug 2026 15:59:21 -0700 Subject: [PATCH 1/3] when possible, suppress build paths in Bison-generated files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build paths in Bison-generated files has been a barrier to reproducible builds, pointed out by Debian Developers many times over the past years. It has never seemed worth fixing this because a bug in Flex made the build not reproducible anyway.¹ In my mind, I actually incorrectly conflated the Flex bug as the _root cause_ of the Bison problem due to this situation having persisted for so long. The Flex bug has now been fixed in Flex commit cff048484c75ba2f434b69caa8df1c2bbe12d366. Though this has not yet made it into a Flex release, it seems a good time to fix our interactions with Bison such that we should automatically acquire reproducible builds when the Flex fix propagates to Debian. ¹ Compounding the confusing situation, the Flex bug was closed without the underlying issue being fixed. It was later reposted as a new issue. Github: https://github.com/westes/flex/issues/268 Github: https://github.com/westes/flex/issues/463 Github: https://github.com/westes/flex/pull/704 Reported-by: Phil Wyett Reported-by: Simon Quigley Reported-by: Tobias Frost Thanks-to: Javier Maestro Thanks-to: Joshua Watt --- librumur/CMakeLists.txt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/librumur/CMakeLists.txt b/librumur/CMakeLists.txt index 08d97f6c..a07d3041 100644 --- a/librumur/CMakeLists.txt +++ b/librumur/CMakeLists.txt @@ -1,4 +1,20 @@ find_package(BISON REQUIRED) +if(BISON_VERSION VERSION_GREATER_EQUAL "3.7.1") + # we have a recent enough Bison to support `--file-prefix-map=…` + if(CMAKE_CURRENT_BINARY_DIR MATCHES " " OR + CMAKE_CURRENT_BINARY_DIR MATCHES "=") + # The build path contains characters that will be misinterpreted in + # `--file-prefix-map=…`. Thus we cannot achieve a reproducible build. + set(PREFIX_MAP "") + else() + # suppress build paths in generated files + set(PREFIX_MAP "--file-prefix-map=${CMAKE_CURRENT_BINARY_DIR}= ") + endif() +else() + # we do not have a recent enough Bison to support `--file-prefix-map=…` + set(PREFIX_MAP "") +endif() +message(STATUS "Bison prefix map option: ${PREFIX_MAP}") find_package(FLEX REQUIRED) find_path(GMPXX_INCLUDE NAMES gmpxx.h PATHS ENV CPLUS_INCLUDE_PATH) @@ -17,7 +33,7 @@ endif() bison_target(parser src/parser.yy ${CMAKE_CURRENT_BINARY_DIR}/parser.yy.cc - COMPILE_FLAGS "--no-lines --warnings=all") + COMPILE_FLAGS "${PREFIX_MAP}--no-lines --warnings=all") flex_target(lexer src/lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.l.cc From 20bd0f4b82eef3114065cefabbf2a0bb23d9767b Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 30 Aug 2026 17:53:52 -0700 Subject: [PATCH 2/3] CI: add a CMake linting job --- .github/workflows/ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4834e76f..3b1f6284 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -570,3 +570,21 @@ jobs: - run: > cd wd && git ls-files -z -- '**/*.c' '**/*.cc' '**/*.h' | xargs -0 -- clang-format-22 --dry-run --style=file --Werror -- + + cmake_analysis: + name: CMake analysis + runs-on: ubuntu-26.04 + steps: + - run: uname -rms + - run: python3 --version + - run: python3 -m pip install --user cmakelang + - run: echo "cloning ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" + - run: git clone --no-checkout -- ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} wd + - run: > + cd wd && + git fetch -- origin ${{ github.event.pull_request.head.sha }} && + git checkout FETCH_HEAD + - run: > + cd wd && + git ls-files -z -- ':(glob)**/CMakeLists.txt' ':(glob)**/*.cmake' | + xargs -0 -- python3 -m cmakelang.lint From 64ab0b34390ddb8510ecad214a7f7c42d8b8078d Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 30 Aug 2026 17:56:51 -0700 Subject: [PATCH 3/3] CI: add some rudimentary Python linting --- .github/workflows/ci.yml | 18 ++++++++++++++++++ doc/toy-model-checker.py | 1 + 2 files changed, 19 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b1f6284..b46b7a42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -588,3 +588,21 @@ jobs: cd wd && git ls-files -z -- ':(glob)**/CMakeLists.txt' ':(glob)**/*.cmake' | xargs -0 -- python3 -m cmakelang.lint + + python_analysis: + name: Python analysis + runs-on: ubuntu-26.04 + steps: + - run: uname -rms + - run: python3 --version + - run: python3 -m pip install --user isort + - run: echo "cloning ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" + - run: git clone --no-checkout -- ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} wd + - run: > + cd wd && + git fetch -- origin ${{ github.event.pull_request.head.sha }} && + git checkout FETCH_HEAD + - run: > + cd wd && + git ls-files -z -- ':(glob)**/*.py' | + xargs -0 -- python3 -m isort --profile=black -- diff --git a/doc/toy-model-checker.py b/doc/toy-model-checker.py index 8718ea0e..0b64f584 100644 --- a/doc/toy-model-checker.py +++ b/doc/toy-model-checker.py @@ -12,6 +12,7 @@ import sys from typing import Optional, Set + class State(object): def __init__(self, value: int = 0, previous: Optional["State"] = None):