From d8fa10c88583734f6ca7dd8cfa7b4f5d64f22267 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Mon, 15 Dec 2025 17:38:25 +0100 Subject: [PATCH 1/3] Update CI to run on macos-15 macos-13 runners are no longer available --- .github/workflows/macWF.yml | 13 +++++++------ .github/workflows/nightly.yml | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/macWF.yml b/.github/workflows/macWF.yml index c6fc3bda30..844bd91051 100644 --- a/.github/workflows/macWF.yml +++ b/.github/workflows/macWF.yml @@ -20,11 +20,10 @@ jobs: # see https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 for possible exclusions matrix: variant: [ "" , "+allmodules" ] - # this is to test both intel and arm64 macs - # note: macos-14 has a problem in fetching the git repository of plumed, namely a - # "fatal: detected dubious ownership in repository" error - # I didn't find any solution, so for the moment I keep macos-14 off - os: [ macos-13 ] + # macos-15 (arm runner) fails with "Failed to open statefile for plumed: + # Could not open file: .../plumed2/plumed2/macports/science/plumed/Portfile" + # so we only run on intel macs for now + os: [macos-15-intel] exclude: # many tests on contributed modules are still failing for numerical reasons on arm64, see https://github.com/plumed/plumed2/pull/950 # once fixed we could introduce this back: @@ -51,6 +50,8 @@ jobs: source ./macports-ci localports macports - name: Build PLUMED run: | + # make sure git clone works without a "dubious ownership" error + sudo git config --global --add safe.directory /Users/runner/work/plumed2/plumed2/ sudo port -N -k install plumed ${{ matrix.variant }} plumed config show for p in $PYVERS ; do @@ -71,7 +72,7 @@ jobs: fail-fast: false matrix: # this is to test both intel and arm64 macs - os: [ macos-13 , macos-14 ] + os: [macos-15-intel, macos-15] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2bb42a34e8..188ea77702 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,5 +1,5 @@ name: Nightly builds -on: +on: schedule: - cron: "30 17 * * 0" @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest , macos-13 , macos-14] + os: [ubuntu-latest, macos-15-intel, macos-15] branch: [v2.8, v2.9, master] runs-on: ${{ matrix.os }} steps: From 31bfdef83ae99cb9a8e16de637a242755660ac34 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Fri, 19 Dec 2025 17:57:49 +0100 Subject: [PATCH 2/3] Copy the local sources instead of using git for macports on CI --- macports/.gitignore | 1 + macports/generate-portfile.sh | 50 +++++++++++++++++------------------ 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/macports/.gitignore b/macports/.gitignore index 5eb6dfb663..c492787462 100644 --- a/macports/.gitignore +++ b/macports/.gitignore @@ -1 +1,2 @@ /science +/python diff --git a/macports/generate-portfile.sh b/macports/generate-portfile.sh index 379647cb64..b6b40595ea 100755 --- a/macports/generate-portfile.sh +++ b/macports/generate-portfile.sh @@ -3,6 +3,8 @@ # This script generates a Portfile in science/plumed # Currently the portfile is aimed at testing the currect git hash +alias awk=gawk + prefix= if git describe --exact-match --tags HEAD 2>/dev/null 1>/dev/null then @@ -17,11 +19,26 @@ else fi if test -n "$plumed_repository" ; then -# get this from environment - repository="$plumed_repository" + fetch="fetch.type git\n" + # get this from environment + fetch+="git.url $plumed_repository\n" + # notice that if instead of hashtag we want to put a version, then it should be + # git.branch v${version} + fetch+="git.branch $prefix$version\n" else -# parent directory: + # parent directory: repository="${PWD%/*}" + + # use a pre-fetch step to copy the sources + fetch="fetch.type none\n\n" + fetch+="pre-fetch {\n" + fetch+=" ui_msg \"Using local source tree\"\n" + fetch+=" set local_repo \"$repository\"\n" + fetch+=" system \"rm -rf \${workpath}/localsrc\"\n" + fetch+=" system \"cp -a \${local_repo} \${workpath}/localsrc\"\n" + fetch+=" return 0\n" + fetch+="}\n\n" + fetch+="worksrcdir \"\${workpath}/localsrc\"\n" fi mkdir -p science/plumed @@ -36,15 +53,8 @@ cat Portfile.in | sed " s/@_VERSION_@/$version/ s/@_REVISION_@/0/ -" | awk '{ - if($1=="@_FETCH_@"){ - print "fetch.type git" - print "git.url '$repository'" -# notice that if instead of hashtag we want to put a version, then it should be -# git.branch v${version} - print "git.branch '$prefix'${version}" - } else print -}' | awk -v modules="$modules" '{ + s|@_FETCH_@|$fetch| +" | awk -v modules="$modules" '{ if($1=="@_MODULES_@"){ var=$2 split(modules,list); @@ -91,17 +101,5 @@ cat PortfilePython.in | sed " s/@_VERSION_@/$version/ s/@_REVISION_@/0/ -" | awk '{ - if($1=="@_FETCH_@"){ - print "fetch.type git" - print "git.url '$repository'" -# notice that if instead of hashtag we want to put a version, then it should be -# git.branch v${version} - print "git.branch '$prefix'${version}" - } else print -}' > python/py-plumed/Portfile - - - - - + s|@_FETCH_@|$fetch| +" > python/py-plumed/Portfile From 093f5d57ec80051533cd10610bba4a2f99b2dee5 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Tue, 16 Dec 2025 13:27:47 +0100 Subject: [PATCH 3/3] [DEBUG] --- .github/workflows/macWF.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macWF.yml b/.github/workflows/macWF.yml index 844bd91051..48be345a1c 100644 --- a/.github/workflows/macWF.yml +++ b/.github/workflows/macWF.yml @@ -50,14 +50,18 @@ jobs: source ./macports-ci localports macports - name: Build PLUMED run: | - # make sure git clone works without a "dubious ownership" error - sudo git config --global --add safe.directory /Users/runner/work/plumed2/plumed2/ sudo port -N -k install plumed ${{ matrix.variant }} plumed config show for p in $PYVERS ; do sudo port -N install $p-plumed done source ./macports-ci ccache --save + - name: show logs + if: always() + run: | + cat /opt/local/var/macports/logs/_Users_runner_work_plumed2_plumed2_macports_science_plumed/plumed/main.log + cat /opt/local/var/macports/logs/_Users_runner_work_plumed2_plumed2_macports_python_py-plumed/py39-plumed/main.log + - name: Run tests run: | sudo port -N -d test plumed ${{ matrix.variant }}