From b2bdb676548542c23ce6b4a0e0f7a7cadf2def87 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Mon, 3 Jul 2023 22:04:45 -0700 Subject: [PATCH 01/15] CI: experimenting with macOS --- .gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b4ad35f..4fdc3a7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -151,3 +151,51 @@ release: include: - template: Code-Quality.gitlab-ci.yml + + +# Experimenting with macOS: +# - these are "M1" (arm64) macs +# - its possible to run `arch -x86_64 ...` +macos_tests: + image: macos-12-xcode-14 + tags: + - saas-macos-medium-m1 + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never + - if: $CI_PROJECT_PATH == "gnu-octave/octave-pythonic" + when: manual + allow_failure: true + stage: test + variables: + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 + script: + - sw_vers + - pwd + - uname -a + - uname -m + - echo $SHELL + - which python + - python --version + - pip --version + - uname -m + # Testing some stuff for using Rosetta to emulate x86_64 + - arch -x86_64 uname -m + - arch -x86_64 /usr/bin/python3 --version + - arch -arm64 /usr/bin/python3 --version + # Alternative Python + - /usr/bin/python3 -m pip --version + # not sure the built-in python will have the shared library... + # install specific python + # curl https://www.python.org/ftp/python/$MACBIN_PY_VER/python-$MACBIN_PY_VER-macos11.pkg --output python.pkg + # sudo installer -pkg python.pkg -target / + # /usr/local/bin/python3 --version + # arch -x86_64 /usr/local/bin/python3 --version + - make help + - brew --version + - brew install octave + - octave --version + - make + - make check -- GitLab From b68a34cd062fffe0e3f5631c7daa4d81c503650e Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Mon, 3 Jul 2023 22:58:32 -0700 Subject: [PATCH 02/15] CI: needs allows running earlier before docker stuff --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4fdc3a7..5aacb11 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -167,6 +167,7 @@ macos_tests: when: manual allow_failure: true stage: test + needs: [] variables: HOMEBREW_NO_AUTO_UPDATE: 1 HOMEBREW_NO_INSTALL_CLEANUP: 1 -- GitLab From fee2e213d0973892176cb1d74a797623997123b4 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Mon, 3 Jul 2023 23:01:36 -0700 Subject: [PATCH 03/15] CI: macOS: break up script for eventual cache I think you can "cache" some stuff from run to run, or maybe only from one job to the next... --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5aacb11..07474b6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -172,7 +172,7 @@ macos_tests: HOMEBREW_NO_AUTO_UPDATE: 1 HOMEBREW_NO_INSTALL_CLEANUP: 1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 - script: + before_script: - sw_vers - pwd - uname -a @@ -194,9 +194,11 @@ macos_tests: # sudo installer -pkg python.pkg -target / # /usr/local/bin/python3 --version # arch -x86_64 /usr/local/bin/python3 --version - - make help - brew --version - brew install octave + script: + - make help - octave --version + - gcc --version - make - make check -- GitLab From b77e3966bbcd4d99ad836cb55e74b4d3e75e06c5 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Mon, 3 Jul 2023 23:25:18 -0700 Subject: [PATCH 04/15] CI: macos: try installing gcc --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07474b6..7ff72c9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -195,9 +195,13 @@ macos_tests: # /usr/local/bin/python3 --version # arch -x86_64 /usr/local/bin/python3 --version - brew --version + - brew info octave - brew install octave + - brew info gcc + - brew install gcc@13 script: - make help + - g++-13 --version - octave --version - gcc --version - make -- GitLab From 3c6deb632ec81cf2a5ec7af4e9dc87a4a0c3af77 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Mon, 3 Jul 2023 23:45:09 -0700 Subject: [PATCH 05/15] CI: just gcc without version --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7ff72c9..24cbccf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -198,10 +198,10 @@ macos_tests: - brew info octave - brew install octave - brew info gcc - - brew install gcc@13 + - brew install gcc script: - make help - - g++-13 --version + - g++ --version - octave --version - gcc --version - make -- GitLab From 12664ae09fdf24f7d972ccf75a24848e3cdc8081 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Tue, 4 Jul 2023 00:44:28 -0700 Subject: [PATCH 06/15] CI: specify c++11 on mac --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 24cbccf..046976a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -204,5 +204,5 @@ macos_tests: - g++ --version - octave --version - gcc --version - - make + - make CXX=clang CXXFLAGS="-std=c++11" - make check -- GitLab From 608a598502abcefb18a4e0d240f01b6a7e5baa1e Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Mon, 10 Jul 2023 22:09:44 -0700 Subject: [PATCH 07/15] CI: use gnu-sed when building on macOS See https://gitlab.com/gnu-octave/octave-pythonic/-/merge_requests/87 --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 046976a..50d146a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -195,14 +195,15 @@ macos_tests: # /usr/local/bin/python3 --version # arch -x86_64 /usr/local/bin/python3 --version - brew --version + - brew install gnu-sed - brew info octave - brew install octave - brew info gcc - brew install gcc script: - - make help + - make help SED=gsed - g++ --version - octave --version - gcc --version - - make CXX=clang CXXFLAGS="-std=c++11" + - make CXX=clang CXXFLAGS="-std=c++11" SED=gsed - make check -- GitLab From 1404c969df7f7971ea41d17136b09ecb7db8ef3f Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Mon, 10 Jul 2023 22:34:22 -0700 Subject: [PATCH 08/15] CI: always run mac, keep fntests.log as artifact --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 50d146a..64079f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -164,7 +164,6 @@ macos_tests: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' when: never - if: $CI_PROJECT_PATH == "gnu-octave/octave-pythonic" - when: manual allow_failure: true stage: test needs: [] @@ -207,3 +206,6 @@ macos_tests: - gcc --version - make CXX=clang CXXFLAGS="-std=c++11" SED=gsed - make check + artifacts: + paths: + - src/fntests.log -- GitLab From 0507f3c30c6dab9abb10027821130d9806d6dd01 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Mon, 10 Jul 2023 22:40:17 -0700 Subject: [PATCH 09/15] CI: keep fntest.log on failures --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64079f6..7ff56b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -209,3 +209,4 @@ macos_tests: artifacts: paths: - src/fntests.log + when: on_failure -- GitLab From f11ee90e64a8cdcfb944985c5f89edf6a3d208f1 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Tue, 11 Jul 2023 00:50:26 -0700 Subject: [PATCH 10/15] CI: don't install gcc on macOS --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7ff56b0..8453b28 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -197,8 +197,6 @@ macos_tests: - brew install gnu-sed - brew info octave - brew install octave - - brew info gcc - - brew install gcc script: - make help SED=gsed - g++ --version -- GitLab From eb130188abb933037895ef82a29a73227c26592d Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Tue, 11 Jul 2023 21:32:27 -0700 Subject: [PATCH 11/15] CI: clean up the macOS job Move some possibly useful future stuff to a comment block. --- .gitlab-ci.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8453b28..1fcf2bd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -153,8 +153,8 @@ include: - template: Code-Quality.gitlab-ci.yml -# Experimenting with macOS: -# - these are "M1" (arm64) macs +# MacOS tests +# - this job runs on "M1" (arm64) macs # - its possible to run `arch -x86_64 ...` macos_tests: image: macos-12-xcode-14 @@ -177,22 +177,14 @@ macos_tests: - uname -a - uname -m - echo $SHELL + # this Python comes from Homebrew - which python - python --version - pip --version - - uname -m - # Testing some stuff for using Rosetta to emulate x86_64 - - arch -x86_64 uname -m - - arch -x86_64 /usr/bin/python3 --version - - arch -arm64 /usr/bin/python3 --version - # Alternative Python + # this Python comes from the OS + - /usr/bin/python3 --version - /usr/bin/python3 -m pip --version - # not sure the built-in python will have the shared library... - # install specific python - # curl https://www.python.org/ftp/python/$MACBIN_PY_VER/python-$MACBIN_PY_VER-macos11.pkg --output python.pkg - # sudo installer -pkg python.pkg -target / - # /usr/local/bin/python3 --version - # arch -x86_64 /usr/local/bin/python3 --version + # (and installing Octave updates the Homebrew one) - brew --version - brew install gnu-sed - brew info octave @@ -208,3 +200,14 @@ macos_tests: paths: - src/fntests.log when: on_failure + + +# macOS: one can also use Rosetta to emulate x86_64 +# - arch -x86_64 uname -m +# - arch -x86_64 /usr/bin/python3 --version +# - arch -arm64 /usr/bin/python3 --version +# macOS: installing a specific python +# - curl https://www.python.org/ftp/python/3.11.4/python-3.11.4-macos11.pkg --output python.pkg +# - sudo installer -pkg python.pkg -target / +# - /usr/local/bin/python3 --version +# - arch -x86_64 /usr/local/bin/python3 --version -- GitLab From 2f756469d954efe16201875cce576f00b808ca83 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Tue, 11 Jul 2023 21:32:52 -0700 Subject: [PATCH 12/15] CI: macOS passes so no longer allowed to fail --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fcf2bd..6a2d9c1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -164,7 +164,6 @@ macos_tests: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' when: never - if: $CI_PROJECT_PATH == "gnu-octave/octave-pythonic" - allow_failure: true stage: test needs: [] variables: -- GitLab From ac58d0c9dec23a55c49be4e7400bd2b279551ce7 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Tue, 11 Jul 2023 21:37:37 -0700 Subject: [PATCH 13/15] CI: re-order commands, add note about gsed --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a2d9c1..9081f43 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -156,6 +156,7 @@ include: # MacOS tests # - this job runs on "M1" (arm64) macs # - its possible to run `arch -x86_64 ...` +# - `gsed` stuff is Issue #112. macos_tests: image: macos-12-xcode-14 tags: @@ -189,10 +190,10 @@ macos_tests: - brew info octave - brew install octave script: - - make help SED=gsed - - g++ --version - - octave --version - gcc --version + - clang --version + - octave --version + - make help SED=gsed - make CXX=clang CXXFLAGS="-std=c++11" SED=gsed - make check artifacts: -- GitLab From 11838828e2305d73618ef16733cf84e49c8c00d2 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Tue, 11 Jul 2023 22:03:11 -0700 Subject: [PATCH 14/15] CI: run doctests on macOS --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9081f43..03e232a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -196,6 +196,8 @@ macos_tests: - make help SED=gsed - make CXX=clang CXXFLAGS="-std=c++11" SED=gsed - make check + - octave --eval "pkg install -forge doctest" + - make doctest artifacts: paths: - src/fntests.log -- GitLab From f734d0b8241c4e33df03bfec76b003f67700258f Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Tue, 11 Jul 2023 22:03:42 -0700 Subject: [PATCH 15/15] CI: try to build package on macOS --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03e232a..454f843 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -198,6 +198,8 @@ macos_tests: - make check - octave --eval "pkg install -forge doctest" - make doctest + - mkdir -p pkg + - make O=pkg dist dist-zip artifacts: paths: - src/fntests.log -- GitLab