Skip to content

Commit f02da6c

Browse files
author
Release Manager
committed
sagemathgh-39030: Use meson in sage-the-distro
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Replace the old setuptools-based build by the new meson-based one in sage-the-distro. Delete most of the old stuff that is no longer needed now. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies - sagemath#40133 - sagemath#39973 - sagemath#40071 - sagemath#40597 <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39030 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik, François Bissey, Tobias Diez
2 parents b13ed74 + 122092c commit f02da6c

File tree

231 files changed

+1872
-1115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+1872
-1115
lines changed

.github/workflows/ci-meson.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
# this step must be after build, because meson.build creates a number of __init__.py files
143143
# that is needed to make tools/update-meson.py run correctly
144144
shell: bash -l {0}
145-
if: matrix.tests == 'all'
145+
if: matrix.tests == 'all' && matrix.python == '3.12'
146146
run: |
147147
python tools/update-meson.py
148148
if ! ./tools/test-git-no-uncommitted-changes; then

.github/workflows/doc-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
mathjax_path_from="[-./A-Za-z_]*/tex-chtml[.]js?v=[0-9a-f]*"
114114
# mathjax path in new doc
115115
mathjax_path_to=$(SAGE_USE_CDNS=yes python -c "from src.sage_docbuild.conf import mathjax_path; print(mathjax_path)")
116-
new_version=$(cat src/VERSION.txt)
116+
new_version=$(cat VERSION.txt)
117117
# Wipe out chronic diffs between old doc and new doc
118118
(cd doc && \
119119
find . -name "*.html" | xargs sed -i -e '/class="sidebar-brand-text"/ s/Sage [0-9a-z.]* /Sage '"$new_version"' /' \

.github/workflows/write-dockerfile.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,11 @@ cat <<EOF
275275
FROM with-system-packages AS bootstrapped
276276
#:bootstrapping:
277277
RUN rm -rf /new /sage/.git
278-
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap conftest.py configure_wrapper configure.ac sage .homebrew-build-env tox.ini .gitignore /new/
278+
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap conftest.py configure_wrapper configure.ac sage .homebrew-build-env tox.ini .gitignore pyproject.toml meson.build meson.options /new/
279279
$ADD config/config.rpath /new/config/config.rpath
280280
$ADD src/doc/bootstrap /new/src/doc/bootstrap
281+
$ADD src/meson.build /new/src/
281282
$ADD src/bin /new/src/bin
282-
$ADD src/pyproject.toml src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt /new/src/
283283
$ADD m4 /new/m4
284284
$ADD pkgs /new/pkgs
285285
$ADD build /new/build
@@ -288,8 +288,8 @@ $ADD tools /new/tools
288288
$ADD .github/workflows /.github/workflows
289289
RUN if [ -d /sage ]; then \\
290290
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \\
291-
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /sage/.gitignore && \\
292-
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /new/.gitignore && \\
291+
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/VERSION.txt\n' >> /sage/.gitignore && \\
292+
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/VERSION.txt\n' >> /new/.gitignore && \\
293293
if ! (cd /new && /.github/workflows/retrofit-worktree.sh worktree-image /sage); then \\
294294
echo "retrofit-worktree.sh failed, falling back to replacing /sage"; \\
295295
for a in local logs; do \\

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
/src/environment-optional-3.10.yml
5353
/src/environment-optional-3.11.yml
5454

55-
/src/setup.cfg
56-
/src/requirements.txt
5755

5856
# Various editors
5957
*~

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ clean:
113113
fi
114114

115115
# "c_lib", ".cython_version", "build" in $(SAGE_SRC) are from old sage versions
116-
# Cleaning .so files (and .c and .cpp files associated with .pyx files) is for editable installs.
117-
# Also cython_debug is for editable installs.
116+
# Cleaning .so files (and .c and .cpp files associated with .pyx files), cython_debug and "sagelib/src/build" is for old editable installs.
118117
sagelib-clean:
119118
@echo "Deleting Sage library build artifacts..."
120119
if [ -d "$(SAGE_SRC)" ]; then \
@@ -123,8 +122,11 @@ sagelib-clean:
123122
rm -rf build; find . -name '*.pyc' -o -name "*.so" | xargs rm -f; \
124123
rm -f $$(find . -name "*.pyx" | sed 's/\(.*\)[.]pyx$$/\1.c \1.cpp/'); \
125124
cd sage/ext/interpreters/ && rm -f *.so *.c *.h *.py* *.pxd) \
126-
&& (cd "$(SAGE_ROOT)/build/pkgs/sagelib/src/" && rm -rf build); \
125+
&& rm -rf "$(SAGE_ROOT)"/build/pkgs/sagelib/src/build; \
127126
fi
127+
# Don't use "meson setup --wipe "$$d";" due to https://github.com/sagemath/sage/pull/39030#issuecomment-3021583924
128+
@echo "Wiping meson build directories..."
129+
rm -rf "$(SAGE_ROOT)/build/sage-distro"
128130

129131
sage_docbuild-clean:
130132
(cd "$(SAGE_ROOT)/build/pkgs/sage_docbuild/src" && rm -rf build)
@@ -175,8 +177,6 @@ bootstrap-clean:
175177
rm -f src/doc/en/installation/*.txt
176178
find src/doc/en/reference/spkg -maxdepth 1 -name index.rst -prune -o -name "*.rst" -exec rm -f {} \+
177179
for a in environment environment-optional src/environment src/environment-optional; do rm -f $$a.yml $$a-3.[89].yml $$a-3.1[0-9].yml; done
178-
rm -f src/requirements.txt
179-
rm -f src/setup.cfg
180180
rm -f build/pkgs/cypari/version_requirements.txt
181181
rm -f build/pkgs/cysignals/version_requirements.txt
182182
rm -f build/pkgs/cython/version_requirements.txt
@@ -355,7 +355,7 @@ ptestoptionallong-nodoc:
355355
# CONFIGURE_DEPENDENCIES is the list of files that influence the generation of 'configure'.
356356
CONFIGURE_DEPENDENCIES = \
357357
configure.ac src/bin/sage-version.sh m4/*.m4 \
358-
src/pyproject.toml \
358+
pyproject.toml \
359359
build/pkgs/*/spkg-configure.m4 \
360360
build/pkgs/*/type build/pkgs/*/SPKG.rst \
361361
build/pkgs/*/checksums.ini build/pkgs/*/requirements.txt \

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SageMath version 10.8.beta1, Release Date: 2025-08-27
1+
10.8.beta1

bootstrap

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ bootstrap () {
3939
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
4040
echo "bootstrap:$LINENO: installing '"$target"'"
4141
fi
42-
echo "# Generated by SAGE_ROOT/bootstrap based on src/pyproject.toml; do not edit directly" > $target
42+
echo "# Generated by SAGE_ROOT/bootstrap based on pyproject.toml; do not edit directly" > $target
4343
sage-get-system-packages install-requires ${pkgname} >> $target
4444
done
4545
for a in m4/sage_spkg_configures.m4 m4/sage_spkg_versions.m4 m4/sage_spkg_versions_toml.m4; do
@@ -230,16 +230,14 @@ save () {
230230
src/doc/en/installation/*.txt \
231231
$(find src/doc/en/reference/spkg -maxdepth 1 -name index.rst -prune -o -name "*.rst" -print) \
232232
environment-3.1[0-9]-*.yml \
233-
src/pyproject.toml \
234-
src/requirements.txt \
235-
src/setup.cfg \
233+
pyproject.toml \
236234
build/pkgs/cypari/version_requirements.txt \
237235
build/pkgs/cysignals/version_requirements.txt \
238236
build/pkgs/cython/version_requirements.txt \
239237
build/pkgs/gmpy2/version_requirements.txt \
240238
build/pkgs/jupyter_core/version_requirements.txt \
241239
build/pkgs/memory_allocator/version_requirements.txt \
242-
build/pkgs/meson/version_requirements.txt \
240+
build/pkgs/meson/version_requirements.txt \
243241
build/pkgs/numpy/version_requirements.txt \
244242
build/pkgs/pkgconfig/version_requirements.txt \
245243
build/pkgs/pplpy/version_requirements.txt \

build/bin/sage-get-system-packages

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@ fi
1414

1515
case "$SYSTEM" in
1616
install-requires)
17-
# Collect from src/pyproject.toml or from version_requirements.txt (falling back to requirements.txt) and output it in the format
17+
# Collect from pyproject.toml or from version_requirements.txt (falling back to requirements.txt) and output it in the format
1818
# needed by setup.cfg [options] install_requires=
19-
SYSTEM_PACKAGES_FILE_NAMES="src/pyproject.toml version_requirements.txt requirements.txt"
19+
SYSTEM_PACKAGES_FILE_NAMES="pyproject.toml version_requirements.txt requirements.txt"
2020
# also normalizes quotes from "" to ''.
2121
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;s/\"/'/g;"
2222
COLLECT=
2323
;;
2424
install-requires-toml)
25-
# Collect from src/pyproject.toml or from version_requirements.txt (falling back to requirements.txt) and output it in the format
25+
# Collect from pyproject.toml or from version_requirements.txt (falling back to requirements.txt) and output it in the format
2626
# needed by pyproject.toml [build-system] requires=
27-
SYSTEM_PACKAGES_FILE_NAMES="src/pyproject.toml version_requirements.txt requirements.txt"
27+
SYSTEM_PACKAGES_FILE_NAMES="pyproject.toml version_requirements.txt requirements.txt"
2828
# also normalizes quotes from '' to "".
2929
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;s/'/\"/g;s/^/'/;s/$/',/;"
3030
COLLECT=
3131
;;
3232
pip)
33-
SYSTEM_PACKAGES_FILE_NAMES="requirements.txt src/pyproject.toml version_requirements.txt"
33+
SYSTEM_PACKAGES_FILE_NAMES="requirements.txt pyproject.toml version_requirements.txt"
3434
STRIP_COMMENTS='sed s/#.*//;s/[[:space:]]//g;'
3535
COLLECT=echo
3636
;;
3737
versions)
3838
# For use in sage-spkg-info
39-
SYSTEM_PACKAGES_FILE_NAMES="package-version.txt requirements.txt src/pyproject.toml version_requirements.txt"
39+
SYSTEM_PACKAGES_FILE_NAMES="package-version.txt requirements.txt pyproject.toml version_requirements.txt"
4040
strip_comments () {
4141
TEXT=$(sed "s/#.*//;/^[[:space:]]*$/d;s/\"/'/g;s/^/ /;" "$@")
4242
if [ -n "$(echo $TEXT)" ]; then
@@ -101,9 +101,9 @@ for PKG_BASE in $SPKGS; do
101101
*pyproject.toml)
102102
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/$NAME
103103
if [ -f "$SYSTEM_PACKAGES_FILE" ]; then
104-
# Extract from the "requires" block in src/pyproject.toml
104+
# Extract from the "requires" block in pyproject.toml
105105
# Packages are in the format "'sage-conf ~= 10.3b3',"
106-
PACKAGE_INFO=$(sed -n '/requires *= *\[/,/^\]/s/^ *'\''\('$PKG_BASE'.*\)'\'',/\1/p' "$SAGE_ROOT/src/pyproject.toml")
106+
PACKAGE_INFO=$(sed -n '/requires *= *\[/,/^\]/s/^ *'\''\('$PKG_BASE'.*\)'\'',/\1/p' "$SAGE_ROOT/pyproject.toml")
107107
if [ -n "$PACKAGE_INFO" ]; then
108108
echo "$PACKAGE_INFO" | ${STRIP_COMMENTS}
109109
[ $SYSTEM = versions ] || break

build/pkgs/configure/checksums.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=0b15812b968c24c0c67a2dc4497427a0d5395d12
3-
sha256=a80101c084c47be664697335900274b26432e73ce80bedbf03f1ef37f4356fc5
2+
sha1=130d69617212390efda25846030d807fcdefe1b9
3+
sha256=0b6e6088e47ea8063af83ecebf187993d68c4f9dde869b8a0b1c0b9685d96fd6
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cbf32b0a7b5d2df54f7b9f89a14e885499bd0953
1+
3b2de4690ed7b6bc8b72adeaf8026603ed0f1c08

0 commit comments

Comments
 (0)