From ae370c24abb0a5fb819697b54c2cdd76ade09a95 Mon Sep 17 00:00:00 2001 From: Dan Bonachea Date: Sun, 27 Sep 2026 14:02:53 -0700 Subject: [PATCH 1/6] CI: Retire macos-14 + flang testing Homebrew has removed the macos-14 llvm bottle --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7323e6..c308c1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,9 +33,6 @@ jobs: # --- LLVM flang coverage --- - - os: macos-14 - compiler: flang - version: 23 - os: macos-15 compiler: flang version: 23 From 62f6a1b22ed884f76bce29168f15d7bb2e4ed144 Mon Sep 17 00:00:00 2001 From: Dan Bonachea Date: Sun, 27 Sep 2026 14:08:05 -0700 Subject: [PATCH 2/6] CI: Install automatic retry for dependency downloads --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c308c1b..a53be85 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,26 +114,48 @@ jobs: FC: ${{ matrix.compiler }} FFLAGS: ${{ matrix.extra_flags }} FPM_FLAGS: --profile release --verbose --flag -DASSERTIONS - CHECK_ASSERT: --flag -DASSERTIONS 2>&1 | tee output ; test ${PIPESTATUS[0]} = $ERROR_STOP_CODE && grep -q "Assertion failure" output + CURL_OPTIONS: --retry 10 --retry-all-errors --fail -L + steps: - name: Checkout code uses: actions/checkout@v6 + - name: Install shell functions + run: | + mkdir -p ~/.bash_helpers + cat << 'EOF' > ~/.bash_helpers/custom_functions.sh + retry() { + local retry_cnt=0 + local retry_delay + while ! "$@" ; do + retry_cnt=$(expr $retry_cnt + 1) + if [[ $retry_cnt > 5 ]] ; then exit 1 ; fi + ( set +x ; + echo "::warning::Command failed: <$@> Pausing before retry $retry_cnt..." ); + retry_delay=$(( 5 ** retry_cnt )) + if [[ $retry_delay > 600 ]] ; then retry_delay=600 ; fi + sleep $retry_delay + done + } + EOF + # Register file in BASH_ENV so it automatically loads in all future steps + echo "BASH_ENV=~/.bash_helpers/custom_functions.sh" >> $GITHUB_ENV + - name: Install Ubuntu Native Dependencies if: ${{ contains(matrix.os, 'ubuntu') && matrix.container == '' && matrix.compiler == 'gfortran' }} run: | - sudo apt-get update + retry sudo apt-get update #sudo apt list -a 'gfortran-*' - sudo apt install -y build-essential + retry sudo apt install -y build-essential if [[ ${COMPILER_VERSION} -lt 15 ]] || type -p gfortran-${COMPILER_VERSION} ; then - sudo apt install -y gfortran-${COMPILER_VERSION} + retry sudo apt install -y gfortran-${COMPILER_VERSION} else - curl -L https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o install-homebrew.sh + curl $CURL_OPTIONS https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o install-homebrew.sh chmod +x install-homebrew.sh env CI=1 ./install-homebrew.sh HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew" - ${HOMEBREW_PREFIX}/bin/brew install -v gcc@${COMPILER_VERSION} binutils + retry ${HOMEBREW_PREFIX}/bin/brew install -v gcc@${COMPILER_VERSION} binutils ls -al ${HOMEBREW_PREFIX}/bin echo "PATH=${HOMEBREW_PREFIX}/bin:${PATH}" >> "$GITHUB_ENV" : Homebrew GCC@15 needs binutils 2.44+ @@ -147,8 +169,8 @@ jobs: - name: Install Ubuntu Container Dependencies if: ${{ contains(matrix.os, 'ubuntu') && matrix.container != '' && !contains(matrix.container, 'phhargrove') }} run: | - apt update - apt install -y build-essential git curl + retry apt update + retry apt install -y build-essential git curl # Add container lfortran to PATH: if test "$FC" = "lfortran"; then echo "/app/bin" >> "$GITHUB_PATH" @@ -173,17 +195,17 @@ jobs: - name: Install macOS Dependencies if: contains(matrix.os, 'macos') run: | - brew update + retry brew update # fpm binary distribution for macOS requires gfortran shared libraries from gcc@12 - brew install gcc@12 + retry brew install gcc@12 if [[ ${{ matrix.compiler }} == 'gfortran' && ${COMPILER_VERSION} -gt 15 ]] ; then - brew install gcc@${COMPILER_VERSION} + retry brew install gcc@${COMPILER_VERSION} fi - name: Install LLVM flang on macOS if: contains(matrix.os, 'macos') && matrix.compiler == 'flang' run: | - brew install llvm@${COMPILER_VERSION} flang + retry brew install llvm@${COMPILER_VERSION} flang # workaround issue #228: clang cannot find homebrew flang's C header for p in /opt/homebrew /usr/local $(brew --prefix) ; do find $p/Cellar/flang -name ISO_Fortran_binding.h 2>/dev/null || true ; done echo "CFLAGS=-I$(dirname $(find $(brew --prefix)/Cellar/flang -name ISO_Fortran_binding.h | head -1)) ${CFLAGS}" >> "$GITHUB_ENV" From 9ff674890684d251009bc70b28c76b3c01cefd08 Mon Sep 17 00:00:00 2001 From: Dan Bonachea Date: Sun, 27 Sep 2026 14:12:44 -0700 Subject: [PATCH 3/6] CI: Tweak curl invocation in Build FPM step --- .github/workflows/build.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a53be85..4e75e66 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -243,10 +243,16 @@ jobs: if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' }} run: | export FPM_VERSION=0.13.0 - curl --retry 5 -LOsS https://github.com/fortran-lang/fpm/releases/download/v$FPM_VERSION/fpm-$FPM_VERSION.F90 - mkdir fpm-temp - gfortran-14 -o fpm-temp/fpm fpm-$FPM_VERSION.F90 - echo "PATH=${PWD}/fpm-temp:${PATH}" >> "$GITHUB_ENV" + for suff in -14 -15 -16 "" -13 -12 ; do + GFORTRAN=gfortran$suff + if type -P $GFORTRAN ; then break ; fi + done + [[ -n "$GFORTRAN" ]] + mkdir -p fpm-temp/bin + cd fpm-temp + curl $CURL_OPTIONS https://github.com/fortran-lang/fpm/releases/download/v$FPM_VERSION/fpm-$FPM_VERSION.F90 -o fpm.F90 + $GFORTRAN -fopenmp -o bin/fpm fpm.F90 + echo "PATH=$PWD/bin:${PATH}" >> "$GITHUB_ENV" - name: Version info run: | From e7a7f25f57c305bcf575cee5426b97b78c2441f2 Mon Sep 17 00:00:00 2001 From: Dan Bonachea Date: Sun, 27 Sep 2026 14:17:09 -0700 Subject: [PATCH 4/6] CI: Add coverage for LFortran 0.66 --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e75e66..a149af6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,6 +101,11 @@ jobs: version: 0.65.0 container: ghcr.io/lfortran/lfortran:v0.65.0 + - os: ubuntu-22.04 + compiler: lfortran + version: 0.66.0 + container: ghcr.io/lfortran/lfortran:v0.66.0 + - os: ubuntu-22.04 compiler: lfortran version: latest From 214e91f5d7d453629e98a92727b91127b9f54dc1 Mon Sep 17 00:00:00 2001 From: Dan Bonachea Date: Sun, 27 Sep 2026 14:19:14 -0700 Subject: [PATCH 5/6] CI: Disable gcc@16 on macOS+Intel Homebrew ceased support for macintel in 2026-09 --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a149af6..fa7f035 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,14 @@ jobs: version: [ 13, 14, 15, 16 ] extra_flags: [ -g ] + exclude: + + # Homebrew removed Intel bottles for gcc@16 + - os: macos-15-intel + version: 16 + - os: macos-26-intel + version: 16 + include: # --- LLVM flang coverage --- From 9aae097ced91c9c2b9321f8a796e8299e17fe6fd Mon Sep 17 00:00:00 2001 From: Dan Bonachea Date: Sun, 27 Sep 2026 14:52:55 -0700 Subject: [PATCH 6/6] CI: Add BREW_WARNING_FILTER --- .github/workflows/build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa7f035..9b40243 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -128,6 +128,7 @@ jobs: FFLAGS: ${{ matrix.extra_flags }} FPM_FLAGS: --profile release --verbose --flag -DASSERTIONS CURL_OPTIONS: --retry 10 --retry-all-errors --fail -L + BREW_WARNING_FILTER: 's/^[[:punct:]]*warning[[:punct:]]*(You are using macOS)/warn: \1/i' steps: @@ -210,15 +211,18 @@ jobs: run: | retry brew update # fpm binary distribution for macOS requires gfortran shared libraries from gcc@12 - retry brew install gcc@12 + retry brew install gcc@12 \ + 2>&1 | perl -pe "$BREW_WARNING_FILTER" ; test ${PIPESTATUS[0]} = 0 if [[ ${{ matrix.compiler }} == 'gfortran' && ${COMPILER_VERSION} -gt 15 ]] ; then - retry brew install gcc@${COMPILER_VERSION} + retry brew install gcc@${COMPILER_VERSION} \ + 2>&1 | perl -pe "$BREW_WARNING_FILTER" ; test ${PIPESTATUS[0]} = 0 fi - name: Install LLVM flang on macOS if: contains(matrix.os, 'macos') && matrix.compiler == 'flang' run: | - retry brew install llvm@${COMPILER_VERSION} flang + retry brew install llvm@${COMPILER_VERSION} flang \ + 2>&1 | perl -pe "$BREW_WARNING_FILTER" ; test ${PIPESTATUS[0]} = 0 # workaround issue #228: clang cannot find homebrew flang's C header for p in /opt/homebrew /usr/local $(brew --prefix) ; do find $p/Cellar/flang -name ISO_Fortran_binding.h 2>/dev/null || true ; done echo "CFLAGS=-I$(dirname $(find $(brew --prefix)/Cellar/flang -name ISO_Fortran_binding.h | head -1)) ${CFLAGS}" >> "$GITHUB_ENV"