Skip to content

Commit

Permalink
Merge branch 'sagemath:develop' into fedora
Browse files Browse the repository at this point in the history
  • Loading branch information
enriqueartal authored Jul 25, 2024
2 parents 2cd47c1 + 79c047c commit 9f1a2e7
Show file tree
Hide file tree
Showing 375 changed files with 6,226 additions and 2,873 deletions.
71 changes: 0 additions & 71 deletions .ci/set_labels_by_changes.sh

This file was deleted.

22 changes: 14 additions & 8 deletions .ci/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ADD="ADD $__CHOWN"
RUN=RUN
cat <<EOF
ARG BASE_IMAGE=$(eval echo "${FULL_BASE_IMAGE_AND_TAG}")
FROM \${BASE_IMAGE} as with-system-packages
FROM \${BASE_IMAGE} AS with-system-packages
EOF
case $SYSTEM in
debian*|ubuntu*)
Expand Down Expand Up @@ -199,7 +199,7 @@ EOF
*)
cat <<EOF
ARG BASE_IMAGE
FROM \${BASE_IMAGE} as with-system-packages
FROM \${BASE_IMAGE} AS with-system-packages
EOF
INSTALL=$(sage-print-system-package-command $SYSTEM install " ")
;;
Expand Down Expand Up @@ -260,9 +260,15 @@ case ${DOCKER_BUILDKIT-0} in
CHECK_STATUS_THEN='STATUS=$(cat STATUS 2>/dev/null); case "$STATUS" in ""|0) ;; *) exit $STATUS;; esac; '
esac

if [ -n "$GITHUB_ACTIONS" ]; then
cat <<EOF
ENV GITHUB_ACTIONS=1
EOF
fi

cat <<EOF
FROM with-system-packages as bootstrapped
FROM with-system-packages AS bootstrapped
#:bootstrapping:
RUN rm -rf /new /sage/.git
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-conda configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 .gitignore /new/
Expand Down Expand Up @@ -295,7 +301,7 @@ WORKDIR /sage
ARG BOOTSTRAP="${BOOTSTRAP-./bootstrap}"
$RUN sh -x -c "\${BOOTSTRAP}" $ENDRUN $THEN_SAVE_STATUS
FROM bootstrapped as configured
FROM bootstrapped AS configured
#:configuring:
RUN $CHECK_STATUS_THEN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
ARG CONFIGURE_ARGS="${CONFIGURE_ARGS:---enable-build-as-root}"
Expand All @@ -311,7 +317,7 @@ EOF
fi
cat <<EOF
FROM configured as with-base-toolchain
FROM configured AS with-base-toolchain
# We first compile base-toolchain because otherwise lots of packages are missing their dependency on 'patch'
ARG NUMPROC=8
ENV MAKE="make -j\${NUMPROC}"
Expand All @@ -321,7 +327,7 @@ ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!
#:toolchain:
$RUN $CHECK_STATUS_THEN make \${USE_MAKEFLAGS} base-toolchain $ENDRUN $THEN_SAVE_STATUS
FROM with-base-toolchain as with-targets-pre
FROM with-base-toolchain AS with-targets-pre
ARG NUMPROC=8
ENV MAKE="make -j\${NUMPROC}"
ARG USE_MAKEFLAGS="-k V=0"
Expand All @@ -331,7 +337,7 @@ ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!
ARG TARGETS_PRE="all-sage-local"
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_PRE} $ENDRUN $THEN_SAVE_STATUS
FROM with-targets-pre as with-targets
FROM with-targets-pre AS with-targets
ARG NUMPROC=8
ENV MAKE="make -j\${NUMPROC}"
ARG USE_MAKEFLAGS="-k V=0"
Expand All @@ -353,7 +359,7 @@ RUN cd /new && rm -rf .git && \
ARG TARGETS="build"
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS} $ENDRUN $THEN_SAVE_STATUS
FROM with-targets as with-targets-optional
FROM with-targets AS with-targets-optional
ARG NUMPROC=8
ENV MAKE="make -j\${NUMPROC}"
ARG USE_MAKEFLAGS="-k V=0"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

61 changes: 42 additions & 19 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,41 +155,48 @@ jobs:
if: env.CAN_DEPLOY == 'true'

build_wheels:
name: Build wheels on ${{ matrix.os }}, arch ${{ matrix.arch }}
name: wheels ${{ matrix.build }}*_${{ matrix.arch }}
runs-on: ${{ matrix.os }}
needs: sdists_for_pypi
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
arch: [x86_64, i686, aarch64]
build: [manylinux, musllinux]
include:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-latest
arch: i686
- os: macos-13
arch: x86_64
build: macosx
- os: macos-14
arch: arm64
build: macosx
env:
CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }}
# SPKGs to install as system packages
SPKGS: _bootstrap _prereq
# Non-Python packages to install as spkgs
TARGETS_PRE: gmp mpfr mpc bliss coxeter3 mcqd meataxe sirocco boost_cropped tdlib
CIBW_BUILD: "*${{ matrix.build }}*"
# Disable building PyPy wheels on all platforms
# Disable musllinux until #33083 provides alpine package information
CIBW_SKIP: "pp* *-musllinux*"
CIBW_SKIP: "pp*"
#
CIBW_ARCHS: ${{ matrix.arch }}
# https://cibuildwheel.readthedocs.io/en/stable/options/#requires-python
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9, <3.13"
# Environment during wheel build
CIBW_ENVIRONMENT: "PATH=$(pwd)/prefix/bin:$PATH CPATH=$(pwd)/prefix/include:$CPATH LIBRARY_PATH=$(pwd)/prefix/lib:$LIBRARY_PATH LD_LIBRARY_PATH=$(pwd)/prefix/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=$(pwd)/prefix/share/pkgconfig:$PKG_CONFIG_PATH ACLOCAL_PATH=/usr/share/aclocal PIP_CONSTRAINT=$(pwd)/constraints.txt"
CIBW_ENVIRONMENT: "PATH=$(pwd)/prefix/bin:$PATH CPATH=$(pwd)/prefix/include:$CPATH LIBRARY_PATH=$(pwd)/prefix/lib:$LIBRARY_PATH LD_LIBRARY_PATH=$(pwd)/prefix/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=$(pwd)/prefix/share/pkgconfig:$PKG_CONFIG_PATH ACLOCAL_PATH=/usr/share/aclocal PIP_CONSTRAINT=$(pwd)/constraints.txt PIP_FIND_LINKS=file://$(pwd)/wheelhouse SAGE_NUM_THREADS=6"
# Use 'build', not 'pip wheel'
CIBW_BUILD_FRONTEND: build
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
if: runner.os == 'Linux' && matrix.arch != 'x86_64' && matrix.arch != 'i686'
uses: docker/setup-qemu-action@v3
with:
platforms: all

- uses: actions/download-artifact@v4
with:
name: dist
Expand All @@ -209,7 +216,7 @@ jobs:
eval $(sage-print-system-package-command auto --sudo --yes --no-install-recommends --spkg install _bootstrap)
./bootstrap
- name: Build platform wheels
- name: Unpack and prepare
# We build the wheels from the sdists so that MANIFEST filtering becomes effective.
# But we must run cibuildwheel with the unpacked source directory, not a tarball,
# so that SAGE_ROOT is copied into the build containers.
Expand All @@ -223,21 +230,37 @@ jobs:
#
# omit sagemath-{meataxe,sirocco} for now -- needs sagemath-modules
run: |
"${{ steps.python.outputs.python-path }}" -m pip install pipx
"${{ steps.python.outputs.python-path }}" -m pip install cibuildwheel==2.18.0
export PATH=build/bin:$PATH
export CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || echo error ignored) ) && if cp /host/sage-\$AUDITWHEEL_PLAT/config.status . 2>/dev/null; then chmod +x config.status; fi && if [ -x ./config.status ]; then ./config.status; else ./configure --enable-build-as-root ${{ startsWith(matrix.os, 'ubuntu') && '--prefix=/host/sage-\$AUDITWHEEL_PLAT' || '' }} && cp config.status prefix/; fi && MAKE=\"make -j6\" make V=0 $TARGETS_PRE && (echo \"sage_conf @ file://\$(pwd)/pkgs/sage-conf\" && echo \"sage_setup @ file://\$(pwd)/pkgs/sage-setup\") > constraints.txt"
echo CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || $(sage-print-system-package-command alpine --yes --no-install-recommends install $(sage-get-system-packages alpine $SPKGS)) || echo error ignored) ) && if cp /host/sage-\$AUDITWHEEL_PLAT/config.status . 2>/dev/null; then chmod +x config.status; fi && if [ -x ./config.status ]; then ./config.status; else ./configure --enable-build-as-root ${{ startsWith(matrix.os, 'ubuntu') && '--prefix=/host/sage-\$AUDITWHEEL_PLAT' || '' }} && cp config.status prefix/; fi && MAKE=\"make -j6\" make V=0 $TARGETS_PRE && (echo \"sage_conf @ file://\$(pwd)/pkgs/sage-conf\" && echo \"sage_setup @ file://\$(pwd)/pkgs/sage-setup\") > constraints.txt" >> "$GITHUB_ENV"
mkdir -p unpacked
for pkg in sagemath*objects sagemath*categories sagemath*bliss sagemath*coxeter3 sagemath*mcqd sagemath*tdlib; do
case "$pkg:${{ matrix.arch }}" in
sagemath*tdlib:i686) continue;; # broken - boost-related
esac
(cd unpacked && tar xfz - ) < dist/$pkg*.tar.gz
"${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.18.0 unpacked/$pkg*
for sdist in dist/$pkg*.tar.gz; do
(cd unpacked && tar xfz - ) < $sdist
done
- name: sagemath-objects
run: |
"${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*objects*
- name: sagemath-categories
run: |
"${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*categories*
- name: sagemath-bliss
run: |
"${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*bliss*
- name: sagemath-coxeter3
run: |
"${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*coxeter3*
- name: sagemath-mcqd
run: |
"${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*mcqd*
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-wheels
name: ${{ matrix.os }}-${{ matrix.build }}-${{ matrix.arch }}-wheels
path: ./wheelhouse/*.whl

upload_wheels:
Expand All @@ -250,7 +273,7 @@ jobs:

- uses: actions/download-artifact@v4
with:
pattern: "*-*-wheels"
pattern: "*-*-*-wheels"
path: wheelhouse
merge-multiple: true

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ on:
"fedora-38",
"fedora-39",
"fedora-40",
"centos-7-devtoolset-gcc_11",
"centos-stream-9-python3.9",
"almalinux-8-python3.9",
"almalinux-9-python3.11",
Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/pr-labeler.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ build/pkgs/wheel/version_requirements.txt
/src/doc/en/reference/*/sage_docbuild
/src/doc/en/reference/sage
/src/doc/en/reference/spkg/*.rst
!/src/doc/en/reference/spkg/index.rst
/src/doc/output
/src/doc/en/installation/*.txt
/src/doc/en/reference/repl/*.txt
Expand Down
Loading

0 comments on commit 9f1a2e7

Please sign in to comment.