diff --git a/.github/workflows/ci-meson.yml b/.github/workflows/ci-meson.yml index ab073aae87c..3c433e130af 100644 --- a/.github/workflows/ci-meson.yml +++ b/.github/workflows/ci-meson.yml @@ -72,6 +72,19 @@ jobs: # Use --no-deps and pip check below to verify that all necessary dependencies are installed via conda pip install --no-build-isolation --no-deps --config-settings=builddir=builddir . -v + - name: Check update-meson + # this step must be after build, because meson.build creates a number of __init__.py files + # that is needed to make tools/update-meson.py run correctly + shell: bash -l {0} + run: | + python3 tools/update-meson.py + if ! ./tools/test-git-no-uncommitted-changes; then + git add --intent-to-add . # also show newly created files in git diff + git status + git diff + false + fi + - name: Verify dependencies shell: bash -l {0} run: pip check diff --git a/.gitignore b/.gitignore index b8bfc364a26..9190feb4b13 100644 --- a/.gitignore +++ b/.gitignore @@ -467,3 +467,8 @@ src/sage/libs/mpfr/__init__.py src/sage/libs/mpc/__init__.py src/sage/calculus/transforms/__init__.py src/sage/calculus/__init__.py + +# Temporary files generated by Meson CI (needed to make test pass because +# ci-meson.yml runs a `./tools/test-git-no-uncommitted-changes` step) +/.ccache +/setup-miniconda-patched-environment-*.yml diff --git a/Makefile b/Makefile index 15dbbb411c0..4b5e9350d3e 100644 --- a/Makefile +++ b/Makefile @@ -254,13 +254,7 @@ TEST_TARGET = $@ TEST = ./sage -t --logfile=$(TEST_LOG) $(TEST_FLAGS) --optional=$(TEST_OPTIONAL) $(TEST_FILES) test-git-no-uncommitted-changes: - @UNCOMMITTED=$$(git status --porcelain); \ - if [ -n "$$UNCOMMITTED" ]; then \ - echo "Error: the git repo has uncommitted changes:"; \ - echo "$$UNCOMMITTED"; \ - echo; \ - exit 1; \ - fi + ./tools/test-git-no-uncommitted-changes test: all @echo '### make $(TEST_TARGET): Running $(TEST)' >> $(TEST_LOG) diff --git a/src/sage/data_structures/meson.build b/src/sage/data_structures/meson.build index 8c100328378..3cc243fe62a 100644 --- a/src/sage/data_structures/meson.build +++ b/src/sage/data_structures/meson.build @@ -42,9 +42,7 @@ foreach name, pyx : extension_data ) endforeach -extension_data_cpp = { - 'pairing_heap' : files('pairing_heap.pyx'), -} +extension_data_cpp = {'pairing_heap' : files('pairing_heap.pyx')} foreach name, pyx : extension_data_cpp py.extension_module( diff --git a/tools/test-git-no-uncommitted-changes b/tools/test-git-no-uncommitted-changes new file mode 100755 index 00000000000..f79997062f5 --- /dev/null +++ b/tools/test-git-no-uncommitted-changes @@ -0,0 +1,10 @@ +#!/usr/bin/env sh +# Test that there is no uncommitted changes in the repository. Return failure if there is. +# Can also be invoked with `make test-git-no-uncommitted-changes` from top level. +UNCOMMITTED="$(git status --porcelain)"; +if [ -n "$UNCOMMITTED" ]; then + echo "Error: the git repo has uncommitted changes:"; + echo "$UNCOMMITTED"; + echo; + exit 1; +fi