Skip to content

Meson: test archlinux on CI and migrate devcontainer #40142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .devcontainer/onCreate-meson.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ uv pip install \
meson-python \
"cypari2 >=2.2.1" \
"cysignals >=1.11.2, != 1.12.0" \
"cython >=3.0, != 3.0.3" \
"cython >=3.0, != 3.0.3, < 3.1.0" \
"gmpy2 ~=2.1.b999" \
memory_allocator \
"numpy >=1.25" \
jinja2
uv sync --frozen --inexact --no-build-isolation-package=sagemath
jinja2 \
setuptools
uv sync --frozen --inexact --no-build-isolation --config-settings=builddir=build/build-$SYSTEM

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions .devcontainer/portability-archlinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM archlinux
RUN pacman -Syu --noconfirm bash git python
23 changes: 23 additions & 0 deletions .devcontainer/portability-archlinux/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// See https://aka.ms/devcontainer.json for format details.
{
"name": "archlinux",
//"image": "archlinux",
"dockerFile": "Dockerfile",
"onCreateCommand": ".devcontainer/onCreate-meson.sh || true",
"features": {
// Git feature is not compatible with Arch Linux, so we install it manually in the Dockerfile
// https://github.com/devcontainers/features/issues/824
//"ghcr.io/devcontainers/features/git": {},
//"ghcr.io/devcontainers/features/python:1": {},
"../uv": {
"version": "latest"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python"
]
}
}
}
3 changes: 3 additions & 0 deletions .devcontainer/portability-void/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ghcr.io/void-linux/void-glibc-full
RUN xbps-install -Suy bash git python
RUN chsh -s /usr/bin/bash
24 changes: 24 additions & 0 deletions .devcontainer/portability-void/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// See https://aka.ms/devcontainer.json for format details.
{
"name": "void",
// Doesn't include 'bash', so we use a custom dockerfile
// "image": "ghcr.io/void-linux/void-glibc-full",
"dockerFile": "Dockerfile",
"onCreateCommand": ".devcontainer/onCreate-meson.sh || true",
"features": {
// Git feature is not compatible with Void Linux, so we install it manually in the Dockerfile
// https://github.com/devcontainers/features/issues/824
//"ghcr.io/devcontainers/features/git": {},
//"ghcr.io/devcontainers/features/python:1": {},
"../uv": {
"version": "latest"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python"
]
}
}
}
33 changes: 27 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths:
- '**.build'
- 'subprojects/**'
- '.github/workflows/ci.yml'
workflow_dispatch:
# Allow to run manually

Expand All @@ -21,10 +22,26 @@ jobs:
container:
- fedora:41
- fedora:42
- ghcr.io/void-linux/void-glibc-full
- archlinux
container:
image: ${{ matrix.container }}

steps:
- name: Prepare container
run: |
if [ "${{ matrix.container }}" = "ghcr.io/void-linux/void-glibc-full" ]; then
xbps-install -Syu xbps
xbps-install -yu
# node-based actions require libstdc++.so.6
xbps-install -Sy libstdc++ bash git
fi
if [ "${{ matrix.container }}" = "archlinux" ]; then
# The archlinux container is configured to not install docs by default
# but we need the maxima help to be in place
sed -i '/^NoExtract/d' /etc/pacman.conf
fi

- name: Checkout code
# cannot use v4 yet because of https://github.com/actions/checkout/issues/1487
uses: actions/checkout@v3
Expand All @@ -37,7 +54,11 @@ jobs:
- name: Set up Python
run: |
uv python install
uv venv
if [ "${{ matrix.container }}" = "ghcr.io/void-linux/void-glibc-full" ] || [ "${{ matrix.container }}" = "archlinux" ]; then
uv venv --system-site-packages
else
uv venv
fi
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV

Expand Down Expand Up @@ -65,15 +86,15 @@ jobs:
meson-python \
"cypari2 >=2.2.1" \
"cysignals >=1.11.2, != 1.12.0" \
"cython >=3.0, != 3.0.3" \
"cython >=3.0, != 3.0.3, < 3.1.0" \
"gmpy2 ~=2.1.b999" \
memory_allocator \
"numpy >=1.25" \
jinja2

uv sync --frozen --inexact --no-build-isolation-package=sagemath
jinja2 \
setuptools
uv sync --frozen --inexact --no-build-isolation -v

- name: Test
run: |
uv run ./sage -t --all -p4 || true
uv run --frozen ./sage -t --all -p4 || true

2 changes: 1 addition & 1 deletion build/bin/sage-print-system-package-command
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ case $system:$command in
fi
;;
void*:update)
print_shell_command "${SUDO}xbps-install -Su"
print_shell_command "${SUDO}xbps-install -Suy"
;;
void*:install)
[ "$YES" = yes ] && options="$options --yes"
Expand Down
1 change: 1 addition & 0 deletions build/pkgs/ecm/distros/arch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gmp-ecm
1 change: 1 addition & 0 deletions build/pkgs/elliptic_curves/distros/void.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sage-data-elliptic_curves
1 change: 1 addition & 0 deletions build/pkgs/gap/distros/void.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gap-devel
1 change: 1 addition & 0 deletions build/pkgs/mpfi/distros/arch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mpfi
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ zlib = dependency('zlib', version: '>=1.2.11')
# https://github.com/conda-forge/eclib-feedstock/issues/48
ec = dependency('eclib', version: '>=20231211', required: false, disabler: true)
# Cannot be found via pkg-config
ec = cc.find_library('ec', required: not is_windows, disabler: true)
ec = cc.find_library('ec', required: false, disabler: true)
ecm = cc.find_library('ecm', required: not is_windows, disabler: true)
gmpxx = dependency('gmpxx', required: not is_windows, disabler: true)
fflas = dependency(
Expand Down
Loading