From c2ab80d568fa2c94d4f1a69ccf6a973282daa2f1 Mon Sep 17 00:00:00 2001 From: Terry Chan Date: Sun, 5 Oct 2025 22:54:31 +0800 Subject: [PATCH 1/2] fix(solvcon): update Python to 3.8.20 to fix download failure --- .github/workflows/solvcon_runner.yml | 22 ++++++++++++++++++++++ applications/solvcon/entry.sh | 24 +++++++++++++++++++----- contrib/ci-setup-apt.sh | 4 ++++ scripts/build.d/cython | 2 +- scripts/build.d/python | 3 ++- 5 files changed, 48 insertions(+), 7 deletions(-) diff --git a/.github/workflows/solvcon_runner.yml b/.github/workflows/solvcon_runner.yml index cd711bd..c5ea50d 100644 --- a/.github/workflows/solvcon_runner.yml +++ b/.github/workflows/solvcon_runner.yml @@ -24,6 +24,28 @@ jobs: if: matrix.os != 'macos-latest' run: | source ${DEVENV_WORKSPACE}/contrib/ci-setup-apt.sh + - name: Cache Homebrew downloads (macOS) + if: matrix.os == 'macos-latest' + uses: actions/cache@v4 + with: + path: | + ~/Library/Caches/Homebrew + /usr/local/Homebrew + key: brew-${{ runner.os }} + restore-keys: | + brew-${{ runner.os }}- + - name: Dependency (macOS) + if: matrix.os == 'macos-latest' + run: | + brew update --quiet + brew install --cask mactex-no-gui + TEXBIN="/Library/TeX/texbin" + echo "PATH=${TEXBIN}:$PATH" >> $GITHUB_ENV + if [[ "$(uname -m)" == "arm64" ]]; then + echo "PYTHON_DECIMAL_WITH_MACHINE=uint128" >> $GITHUB_ENV + else + echo "PYTHON_DECIMAL_WITH_MACHINE=x64" >> $GITHUB_ENV + fi - name: Launch SOLVCON run: | source ${DEVENV_WORKSPACE}/scripts/init diff --git a/applications/solvcon/entry.sh b/applications/solvcon/entry.sh index f906034..213a8dd 100755 --- a/applications/solvcon/entry.sh +++ b/applications/solvcon/entry.sh @@ -34,21 +34,35 @@ devenv build bzip2 # error: System version of SQLite does not support loadable extensions # make: *** [sharedmods] Error 1 devenv build sqlite -VERSION=3.8 devenv build python -devenv build cmake +# pip>=25 requires virtualenv; +# disable via PIP_REQUIRE_VIRTUALENV=false +export PIP_REQUIRE_VIRTUALENV=false +VERSION=3.8.20 devenv build python +VERSION=3.31.9 devenv build cmake # scotch will be used later by libmarch # cmake will be used for building scotch devenv build scotch # prepare all packages to build SOLVCON +pip3 install "setuptools<60.0" wheel pip3 install nose boto paramiko netCDF4 +pip3 install sphinx furo Pillow pip3 install numpy==1.21.4 -devenv build pybind11 -devenv build gmsh +VERSION=2.11.2 devenv build pybind11 + devenv build hdf +if [[ "$(uname)" == "Darwin" ]]; then + CMAKE_C_FLAGS="-include unistd.h -include string.h" \ + CFLAGS="-include unistd.h -include string.h" \ + devenv build gmsh +else + devenv build gmsh +fi + + python_exe_base=$(which python3) -PYTHON_EXE=${python_exe_base} devenv build cython +VERSION=0.29.37 PYTHON_EXE=${python_exe_base} devenv build cython pushd ${SCSRC} # make libmarch.so and SOLVCON diff --git a/contrib/ci-setup-apt.sh b/contrib/ci-setup-apt.sh index dde63e0..f37f24f 100755 --- a/contrib/ci-setup-apt.sh +++ b/contrib/ci-setup-apt.sh @@ -4,3 +4,7 @@ sudo apt-get -qqy install \ fakeroot debhelper locales \ libffi-dev \ liblapack3 liblapack-dev + +# for sphinx's latex engine +sudo apt-get install -qqy texlive-latex-base texlive-latex-recommended latexmk +sudo apt-get install -qqy ghostscript imagemagick \ No newline at end of file diff --git a/scripts/build.d/cython b/scripts/build.d/cython index e12da99..3fafb5f 100644 --- a/scripts/build.d/cython +++ b/scripts/build.d/cython @@ -7,7 +7,7 @@ SRCSYNC=${SRCSYNC:-tarball} if [ "${SRCSYNC}" == "tarball" ] ; then # Tarball location: https://github.com/cython/cython/releases - pkgname=Cython + pkgname=cython pkgver=${VERSION:-3.0.12} pkgfull=${pkgname}-${pkgver} pkgfn=${pkgfull}.tar.gz diff --git a/scripts/build.d/python b/scripts/build.d/python index 971d1b1..76c74c6 100644 --- a/scripts/build.d/python +++ b/scripts/build.d/python @@ -73,7 +73,6 @@ pushd ${DEVENVFLAVORROOT}/${DEVENVFLAVOR}/src/${pkgfull} > /dev/null cfgcmd+=("--enable-optimizations") cfgcmd+=("--without-ensurepip") cfgcmd+=("--with-system-expat") - cfgcmd+=("--with-system-ffi") cfgcmd+=("--with-system-libmpdec") cfgcmd+=("--with-readline=editline") cfgcmd+=("--with-lto") @@ -82,6 +81,8 @@ pushd ${DEVENVFLAVORROOT}/${DEVENVFLAVOR}/src/${pkgfull} > /dev/null if [[ $(uname) == Darwin ]] ; then cfgcmd+=("--with-dtrace") cfgcmd+=("--with-dbmliborder=ndbm") + elif [ $(uname) == Linux ]; then + cfgcmd+=("--with-system-ffi") fi # Some Python extension does not work properly without this, e.g., pandas. From 694854f5dc3bee6a3d022f043897ad52d19e3828 Mon Sep 17 00:00:00 2001 From: Terry Chan Date: Sat, 4 Oct 2025 16:57:17 +0800 Subject: [PATCH 2/2] feat: add get-pip.py version handling --- scripts/build.d/python | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/build.d/python b/scripts/build.d/python index 76c74c6..fb67d31 100644 --- a/scripts/build.d/python +++ b/scripts/build.d/python @@ -104,11 +104,16 @@ pushd ${DEVENVFLAVORROOT}/${DEVENVFLAVOR}/src/${pkgfull} > /dev/null PY_BIN=${PREFIX}/bin/python3 CURL_URL=https://bootstrap.pypa.io/get-pip.py - IFS='.' read -ra VER <<< ${VERSION} + IFS='.' read -ra VER <<< "${VERSION}" - if [[ ${VER[0]} == "v2" ]]; then + if [[ "${VER[0]}" == "v2" || "${VER[0]}" == "2" ]]; then PY_BIN=${PREFIX}/bin/python CURL_URL=https://bootstrap.pypa.io/pip/2.7/get-pip.py + elif (( "${VER[0]}" == 3 && "${VER[1]}" < 6 )); then + echo "ERROR: Python ${pkgver} is below 3.6. get-pip is not supported." + exit 1 + elif (( "${VER[0]}" == 3 && "${VER[1]}" < 9 )); then + CURL_URL="https://bootstrap.pypa.io/pip/${VER[0]}.${VER[1]}/get-pip.py" fi curl ${CURL_URL} | ${PY_BIN}