From c678f4ca2b3141410e4f39305bbbdd20be23b96f Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Mon, 25 Dec 2023 14:31:17 -0300 Subject: [PATCH 01/29] Update install_name fixing --- relativize_install_names.py | 65 +++++++++++++++---------------------- 1 file changed, 27 insertions(+), 38 deletions(-) diff --git a/relativize_install_names.py b/relativize_install_names.py index 0659026..95a8796 100755 --- a/relativize_install_names.py +++ b/relativize_install_names.py @@ -2,50 +2,39 @@ import os import subprocess -import itertools from pathlib import Path -OPENFOAM_VERSION = int(subprocess.run(["bin/foamEtcFile", "-show-api"], stdout=subprocess.PIPE, check=True).stdout) - -libs = {} - -# Find names of OpenFOAM libraries -if OPENFOAM_VERSION < 2312: # References are already relative in OpenFOAM >= 2312 - # See https://develop.openfoam.com/Development/openfoam/-/issues/2948 - MPI_LIB_PATH = list(Path("platforms").glob("*/lib/*mpi*"))[0] - DUMMY_LIB_PTH = list(Path("platforms").glob("*/lib/dummy"))[0] - - for openfoam_lib in Path("platforms").glob("*/lib/**/*.dylib"): - # Replace references to dummy MPI libraries with the actual MPI libraries - if openfoam_lib.parent == DUMMY_LIB_PTH: - libs[openfoam_lib] = MPI_LIB_PATH / openfoam_lib.name - else: - libs[openfoam_lib] = openfoam_lib - -# Find names of dependency libraries -DEPS_PATH = Path("usr") -DEPS_PATH_RESOLVED = DEPS_PATH.resolve() # In case "usr" is a symlink -for dep_path in (DEPS_PATH_RESOLVED / "opt").iterdir(): - dep_libs = itertools.chain(dep_path.rglob("*.so"), dep_path.rglob("*.dylib")) - for dep_lib in dep_libs: - libs[dep_lib] = DEPS_PATH / dep_lib.relative_to(DEPS_PATH_RESOLVED) - - -def relativize_install_names(file): +def relativize_install_names(file, lib_dirs): otool_stdout = subprocess.run(["otool", "-L", file], stdout=subprocess.PIPE, check=True).stdout.decode() - for old_path,new_path in libs.items(): - if str(old_path.absolute()) in otool_stdout: - new_relative_path = os.path.relpath(new_path, start=file.parent) - subprocess.run(["install_name_tool", - "-change", - old_path.absolute(), - f"@loader_path/{new_relative_path}", - file]) + install_names = [Path(line.split(" (compatibility version ")[0].strip()) for line in otool_stdout.splitlines()[1:]] + for install_name in install_names: + if install_name.is_absolute(): + for lib_dir,new_lib_dir in lib_dirs.items(): + lib_dir = lib_dir.absolute() + if install_name.is_relative_to(lib_dir): + new_install_name = new_lib_dir.absolute() / install_name.relative_to(lib_dir) + relative_install_name = Path("@loader_path") / os.path.relpath(new_install_name, start=file.parent) + subprocess.run(["install_name_tool", "-change", install_name, relative_install_name, file]) + break + +# Replace references to dependencies +lib_dirs = {Path("usr").resolve(): Path("usr")} # In case "usr" is a symlink + +# Replace references to OpenFOAM libraries if necessary +OPENFOAM_VERSION = int(subprocess.run(["bin/foamEtcFile", "-show-api"], stdout=subprocess.PIPE, check=True).stdout) +if OPENFOAM_VERSION < 2312: + # References are already relative in OpenFOAM >= 2312 + # See https://develop.openfoam.com/Development/openfoam/-/issues/2948 + LIB_DIR, = list(Path("platforms").glob("*/lib")) + MPI_LIB_DIR, = list(Path("platforms").glob("*/lib/*mpi*")) + DUMMY_LIB_DIR, = list(Path("platforms").glob("*/lib/dummy")) + lib_dirs[DUMMY_LIB_DIR] = MPI_LIB_DIR # Replace references to dummy MPI libraries with the actual MPI libraries + lib_dirs[LIB_DIR] = LIB_DIR for lib in Path("platforms").glob("*/lib/**/*.dylib"): - relativize_install_names(lib) + relativize_install_names(lib, lib_dirs) for bin in Path("platforms").glob("*/bin/*"): - relativize_install_names(bin) + relativize_install_names(bin, lib_dirs) From 01d990400a00fcaef98900c712cc1e4ee90fdb3b Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Fri, 7 Jul 2023 16:14:57 -0300 Subject: [PATCH 02/29] Improve Makefile --- .github/workflows/build-test.yml | 48 +++++++---------- Makefile | 93 +++++++++++++++++--------------- 2 files changed, 70 insertions(+), 71 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index f71f4bc..bd8a6bf 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -95,40 +95,30 @@ jobs: - name: Generate cache restore keys id: caching run: | - DEPS_RESTORE_KEY="deps-${{ env.OPENFOAM }}-${{ env.BUILD_OS }}-${{ hashFiles('make_deps.txt', 'Brewfile') }}-" - BUILD_RESTORE_KEY="build-${{ env.OPENFOAM }}-${{ env.BUILD_OS }}-${{ hashFiles('make_build.txt', 'Brewfile', format('OpenFOAM-v${0}.tgz.sha256', inputs.openfoam-version), 'configure.sh') }}-" + DEPS_RESTORE_KEY="build-${{ env.OPENFOAM }}-${{ env.BUILD_OS }}-${{ hashFiles('make_deps.txt', 'Brewfile') }}" + BUILD_RESTORE_KEY="$DEPS_RESTORE_KEY-${{ hashFiles('make_build.txt', 'configure.sh') }}" echo "DEPS_RESTORE_KEY=$DEPS_RESTORE_KEY" >> "$GITHUB_OUTPUT" echo "BUILD_RESTORE_KEY=$BUILD_RESTORE_KEY" >> "$GITHUB_OUTPUT" - - name: Look up cached build - if: inputs.use-cached - id: cache_build - uses: actions/cache/restore@v3 - with: - path: build/*-build.sparsebundle - key: ignore - restore-keys: - ${{ steps.caching.outputs.BUILD_RESTORE_KEY }} - lookup-only: true - name: Look up cached deps - if: inputs.use-cached && steps.cache_build.outputs.cache-matched-key == '' id: cache_deps + if: inputs.use-cached uses: actions/cache/restore@v3 with: - path: build/*-deps.sparsebundle + path: build/*.sparsebundle key: ignore - restore-keys: + restore-keys: | ${{ steps.caching.outputs.DEPS_RESTORE_KEY }} lookup-only: true - name: Make deps - if: steps.cache_build.outputs.cache-matched-key == '' && steps.cache_deps.outputs.cache-matched-key == '' + if: steps.cache_deps.outputs.cache-matched-key == '' run: | make deps ${{ env.MAKE_VARS }} - name: Save deps to cache - if: steps.cache_build.outputs.cache-matched-key == '' && steps.cache_deps.outputs.cache-matched-key == '' + if: steps.cache_deps.outputs.cache-matched-key == '' uses: actions/cache/save@v3 with: - path: build/*-deps.sparsebundle - key: ${{ steps.caching.outputs.DEPS_RESTORE_KEY }}${{ github.run_id }} + path: build/*.sparsebundle + key: ${{ steps.caching.outputs.DEPS_RESTORE_KEY }}-${{ github.run_id }} build: needs: deps @@ -141,36 +131,36 @@ jobs: id: cache_build uses: actions/cache/restore@v3 with: - path: build/*-build.sparsebundle + path: build/*.sparsebundle key: ignore - restore-keys: + restore-keys: | ${{ needs.deps.outputs.build-restore-key }} - name: Restore cached deps if: steps.cache_build.outputs.cache-matched-key == '' id: cache_deps uses: actions/cache/restore@v3 with: - path: build/*-deps.sparsebundle + path: build/*.sparsebundle key: ignore - restore-keys: + restore-keys: | ${{ needs.deps.outputs.deps-restore-key }} fail-on-cache-miss: true - - name: Reuse cached build or deps - run: | - touch -c build/*-deps.sparsebundle - touch -c build/*-build.sparsebundle - name: Build if: steps.cache_build.outputs.cache-matched-key == '' run: | + hdiutil attach build/*.sparsebundle + make --touch deps ${{ env.MAKE_VARS }} make build ${{ env.MAKE_VARS }} - name: Save build to cache if: steps.cache_build.outputs.cache-matched-key == '' && inputs.cache-build uses: actions/cache/save@v3 with: - path: build/*-build.sparsebundle - key: ${{ needs.deps.outputs.build-restore-key }}${{ github.run_id }} + path: build/*.sparsebundle + key: ${{ needs.deps.outputs.build-restore-key }}-${{ github.run_id }} - name: Make app run: | + hdiutil attach build/*.sparsebundle + make --touch build ${{ env.MAKE_VARS }} make zip ${{ env.MAKE_VARS }} - name: Upload app artifact uses: actions/upload-artifact@v4 diff --git a/Makefile b/Makefile index 9480b1a..779c298 100644 --- a/Makefile +++ b/Makefile @@ -34,11 +34,15 @@ ifndef OPENFOAM_GIT_BRANCH OPENFOAM_TARBALL = $(shell basename $(OPENFOAM_TARBALL_URL)) endif +VOLUME = /Volumes/$(APP_NAME) + # Build targets app: build/$(APP_NAME).app -build: build/$(APP_NAME)-build.sparsebundle -deps: build/$(APP_NAME)-deps.sparsebundle +build: $(VOLUME)/build/log.txt + hdiutil detach $(VOLUME) +deps: $(VOLUME)/Brewfile.lock.json + hdiutil detach $(VOLUME) fetch-source: $(OPENFOAM_TARBALL) ifeq ($(DEPENDENCIES_KIND),both) @@ -55,7 +59,6 @@ install: $(INSTALL_DIR)/$(APP_NAME).app # Build rules -VOLUME = /Volumes/$(APP_NAME) VOLUME_ID_FILE = $(VOLUME)/.vol_id APP_CONTENTS = \ @@ -111,7 +114,7 @@ build/$(APP_NAME).app/Contents/%: Contents/% mkdir -p $(@D) cp -a $< $@ -build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg: build/$(APP_NAME)-build.sparsebundle build/$(APP_NAME).app/Contents/Resources/icon.icns relativize_install_names.py +build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg: $(VOLUME)/build/log.txt build/$(APP_NAME).app/Contents/Resources/icon.icns relativize_install_names.py [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) hdiutil attach \ build/$(APP_NAME)-build.sparsebundle \ @@ -138,7 +141,7 @@ else ifeq ($(DEPENDENCIES_KIND),homebrew) else $(error Invalid value for DEPENDENCIES_KIND) endif - rm -rf $(VOLUME)/.fseventsd || true + rm -rf $(VOLUME)/.fseventsd mkdir -p build/$(APP_NAME).app/Contents/Resources hdiutil create \ -format $(DMG_FORMAT) \ @@ -150,10 +153,15 @@ endif hdiutil detach $(VOLUME) rm build/$(APP_NAME)-build.sparsebundle.shadow -build/$(APP_NAME)-build.sparsebundle: build/$(APP_NAME)-deps.sparsebundle $(OPENFOAM_TARBALL) configure.sh - [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) - mv build/$(APP_NAME)-deps.sparsebundle build/$(APP_NAME)-build.sparsebundle - hdiutil attach build/$(APP_NAME)-build.sparsebundle +$(VOLUME)/build/log.txt: $(VOLUME)/Brewfile.lock.json $(VOLUME)/etc/prefs.sh + cd $(VOLUME) \ + && source etc/bashrc \ + && foamSystemCheck \ + && ( ./Allwmake -j $(WMAKE_NJOBS) -s -q -k || true ) \ + && ./Allwmake -j $(WMAKE_NJOBS) -s -log=build/log.txt + +$(VOLUME)/etc/prefs.sh: $(OPENFOAM_TARBALL) configure.sh | $(VOLUME) + setopt extendedglob && rm -rf -- $(VOLUME)/^(usr|homebrew|Brewfile*)(N) ifdef OPENFOAM_TARBALL tar -xzf $(OPENFOAM_TARBALL) --strip-components 1 -C $(VOLUME) else ifdef OPENFOAM_GIT_BRANCH @@ -162,47 +170,50 @@ else ifdef OPENFOAM_GIT_BRANCH git -C $(VOLUME) pull origin $(OPENFOAM_GIT_BRANCH) git -C $(VOLUME) submodule update --init --recursive endif - cd $(VOLUME) \ - && "$(CURDIR)/configure.sh" \ - && source etc/bashrc \ - && foamSystemCheck \ - && ( ./Allwmake -j $(WMAKE_NJOBS) -s -q -k || true ) \ - && ./Allwmake -j $(WMAKE_NJOBS) -s - hdiutil detach $(VOLUME) + cd $(VOLUME) && "$(CURDIR)/configure.sh" -build/$(APP_NAME)-deps.sparsebundle: Brewfile $(if $(filter homebrew,$(DEPENDENCIES_KIND)),Brewfile.lock.json) - [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) - mkdir -p build - hdiutil create \ - -size 50g \ - -fs $(VOLUME_FILESYSTEM) \ - -volname $(APP_NAME) \ - build/$(APP_NAME)-deps.sparsebundle \ - -ov -attach - cp Brewfile $(VOLUME)/ +$(VOLUME)/Brewfile.lock.json: $(VOLUME)/Brewfile | $(VOLUME)/usr +ifeq ($(DEPENDENCIES_KIND),standalone) + HOMEBREW_RELOCATABLE_INSTALL_NAMES=1 $(VOLUME)/usr/bin/brew bundle --file $(VOLUME)/Brewfile --cleanup --verbose + $(VOLUME)/usr/bin/brew list --versions +else ifeq ($(DEPENDENCIES_KIND),homebrew) + brew bundle --file $(VOLUME)/Brewfile --no-upgrade +else + $(error Invalid value for DEPENDENCIES_KIND) +endif + +$(VOLUME)/usr: | $(VOLUME) ifeq ($(DEPENDENCIES_KIND),standalone) git clone https://github.com/Homebrew/brew $(VOLUME)/homebrew mkdir -p $(VOLUME)/usr/bin ln -s ../../homebrew/bin/brew $(VOLUME)/usr/bin/ - HOMEBREW_RELOCATABLE_INSTALL_NAMES=1 $(VOLUME)/usr/bin/brew bundle --file $(VOLUME)/Brewfile --verbose - $(VOLUME)/usr/bin/brew autoremove - $(VOLUME)/usr/bin/brew list --versions else ifeq ($(DEPENDENCIES_KIND),homebrew) - brew bundle check --verbose --no-upgrade - cp Brewfile.lock.json $(VOLUME)/ ln -s $(shell brew --prefix) $(VOLUME)/usr else $(error Invalid value for DEPENDENCIES_KIND) endif - hdiutil detach $(VOLUME) -$(OPENFOAM_TARBALL): $(or $(wildcard $(OPENFOAM_TARBALL).sha256), \ - $(warning No checksum file found for $(OPENFOAM_TARBALL); will skip verification)) +$(VOLUME)/Brewfile: Brewfile | $(VOLUME) + cp Brewfile $(VOLUME)/ + +$(VOLUME): | build/$(APP_NAME)-build.sparsebundle + hdiutil attach build/$(APP_NAME)-build.sparsebundle + +build/$(APP_NAME)-build.sparsebundle: + mkdir -p build + hdiutil create \ + -size 50g \ + -fs $(VOLUME_FILESYSTEM) \ + -volname $(APP_NAME) \ + build/$(APP_NAME)-build.sparsebundle \ + -ov + +$(OPENFOAM_TARBALL): | $(OPENFOAM_TARBALL).sha256 curl -L -o $(OPENFOAM_TARBALL) $(OPENFOAM_TARBALL_URL) - [ -z $< ] || shasum -a 256 -c $< + [ ! -f $(OPENFOAM_TARBALL).sha256 ] || shasum -a 256 --check $(OPENFOAM_TARBALL).sha256 -Brewfile.lock.json: Brewfile - brew bundle +$(OPENFOAM_TARBALL).sha256: + $(warning No checksum file found for $(OPENFOAM_TARBALL); will skip verification) # Non-build targets and rules @@ -254,11 +265,11 @@ test-dmg: clean-app: [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) - rm -rf build/$(APP_NAME).app + rm -rf build/$(APP_NAME).app build/$(APP_NAME)-build.sparsebundle.shadow clean-build: clean-app rm -f build/$(DIST_NAME).zip - rm -rf build/$(APP_NAME)-build.sparsebundle build/$(APP_NAME)-deps.sparsebundle $(TEST_DIR)/test-openfoam $(TEST_DIR)/test-bash $(TEST_DIR)/test-zsh $(TEST_DIR)/test-dmg + rm -rf build/$(APP_NAME)-build.sparsebundle $(TEST_DIR)/test-openfoam $(TEST_DIR)/test-bash $(TEST_DIR)/test-zsh $(TEST_DIR)/test-dmg rmdir $(TEST_DIR) || true rmdir build || true @@ -268,9 +279,7 @@ clean: clean-build uninstall: rm -rf $(INSTALL_DIR)/$(APP_NAME).app - # Set special targets .PHONY: app build deps fetch-source zip install test test-openfoam test-bash test-zsh test-dmg clean-app clean-build clean uninstall -.PRECIOUS: build/$(APP_NAME)-build.sparsebundle -.SECONDARY: $(OPENFOAM_TARBALL) Brewfile.lock.json build/$(APP_NAME)-deps.sparsebundle build/$(APP_NAME)-build.sparsebundle +.SECONDARY: $(OPENFOAM_TARBALL) .DELETE_ON_ERROR: From dc0d376c815f903c0434b0e1d2822ea7b950aa5c Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Fri, 29 Dec 2023 12:12:08 -0300 Subject: [PATCH 03/29] Update Makefile --- .github/workflows/build-test.yml | 2 +- Makefile | 48 ++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index bd8a6bf..b508f4e 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -96,7 +96,7 @@ jobs: id: caching run: | DEPS_RESTORE_KEY="build-${{ env.OPENFOAM }}-${{ env.BUILD_OS }}-${{ hashFiles('make_deps.txt', 'Brewfile') }}" - BUILD_RESTORE_KEY="$DEPS_RESTORE_KEY-${{ hashFiles('make_build.txt', 'configure.sh') }}" + BUILD_RESTORE_KEY="$DEPS_RESTORE_KEY-${{ hashFiles('make_build.txt', 'configure.sh', 'relativize_install_names.py') }}" echo "DEPS_RESTORE_KEY=$DEPS_RESTORE_KEY" >> "$GITHUB_OUTPUT" echo "BUILD_RESTORE_KEY=$BUILD_RESTORE_KEY" >> "$GITHUB_OUTPUT" - name: Look up cached deps diff --git a/Makefile b/Makefile index 779c298..6f0be45 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Build configuration -SHELL = /bin/zsh +SHELL = /bin/bash OPENFOAM_VERSION = 2312 APP_NAME = OpenFOAM-v$(OPENFOAM_VERSION) @@ -38,11 +38,15 @@ VOLUME = /Volumes/$(APP_NAME) # Build targets -app: build/$(APP_NAME).app -build: $(VOLUME)/build/log.txt - hdiutil detach $(VOLUME) -deps: $(VOLUME)/Brewfile.lock.json - hdiutil detach $(VOLUME) +app: | $(VOLUME) + $(MAKE) build/$(APP_NAME).app + [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) +build: | $(VOLUME) + $(MAKE) $(VOLUME)/build + [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) +deps: | $(VOLUME) + $(MAKE) $(VOLUME)/Brewfile.lock.json + [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) fetch-source: $(OPENFOAM_TARBALL) ifeq ($(DEPENDENCIES_KIND),both) @@ -50,12 +54,15 @@ zip: $(MAKE) zip DEPENDENCIES_KIND=standalone $(MAKE) clean-app $(MAKE) zip DEPENDENCIES_KIND=homebrew - $(MAKE) clean-app -else -zip: build/$(DIST_NAME).zip + $(MAKE) clean-app endif +zip: | $(VOLUME) + $(MAKE) build/$(DIST_NAME).zip + [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) -install: $(INSTALL_DIR)/$(APP_NAME).app +install: | $(VOLUME) + $(MAKE) $(INSTALL_DIR)/$(APP_NAME).app + [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) # Build rules @@ -73,7 +80,6 @@ APP_CONTENTS = \ build/$(APP_NAME).app/Contents/MacOS/openfoam \ build/$(APP_NAME).app/Contents/MacOS/bashrc - $(INSTALL_DIR)/$(APP_NAME).app: build/$(APP_NAME).app cp -r build/$(APP_NAME).app $(INSTALL_DIR)/ @@ -114,14 +120,12 @@ build/$(APP_NAME).app/Contents/%: Contents/% mkdir -p $(@D) cp -a $< $@ -build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg: $(VOLUME)/build/log.txt build/$(APP_NAME).app/Contents/Resources/icon.icns relativize_install_names.py +build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg: $(VOLUME)/build Contents/Resources/icon.icns [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) hdiutil attach \ build/$(APP_NAME)-build.sparsebundle \ -shadow - cd $(VOLUME) \ - && "$(CURDIR)/relativize_install_names.py" - cp build/$(APP_NAME).app/Contents/Resources/icon.icns $(VOLUME)/.VolumeIcon.icns + cp Contents/Resources/icon.icns $(VOLUME)/.VolumeIcon.icns SetFile -c icnC $(VOLUME)/.VolumeIcon.icns SetFile -a C $(VOLUME) uuidgen > $(VOLUME_ID_FILE) @@ -129,8 +133,8 @@ build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg: $(VOLUME)/build/log.tx rm -rf $(VOLUME)/homebrew [ ! -L $(VOLUME)/usr ] || rm $(VOLUME)/usr rm -rf $(VOLUME)/build - rm -rf -- $(VOLUME)/**/.git(N) - rm -f -- $(VOLUME)/**/.DS_Store(N) + rm -rf -- $(VOLUME)/**/.git + rm -f -- $(VOLUME)/**/.DS_Store ifeq ($(DEPENDENCIES_KIND),standalone) rm $(VOLUME)/usr/bin/brew rm $(VOLUME)/Brewfile @@ -153,15 +157,17 @@ endif hdiutil detach $(VOLUME) rm build/$(APP_NAME)-build.sparsebundle.shadow -$(VOLUME)/build/log.txt: $(VOLUME)/Brewfile.lock.json $(VOLUME)/etc/prefs.sh +$(VOLUME)/build: $(VOLUME)/etc/prefs.sh $(VOLUME)/Brewfile.lock.json relativize_install_names.py cd $(VOLUME) \ && source etc/bashrc \ && foamSystemCheck \ && ( ./Allwmake -j $(WMAKE_NJOBS) -s -q -k || true ) \ - && ./Allwmake -j $(WMAKE_NJOBS) -s -log=build/log.txt + && ./Allwmake -j $(WMAKE_NJOBS) -s + cd $(VOLUME) && "$(CURDIR)/relativize_install_names.py" + touch $(VOLUME)/build $(VOLUME)/etc/prefs.sh: $(OPENFOAM_TARBALL) configure.sh | $(VOLUME) - setopt extendedglob && rm -rf -- $(VOLUME)/^(usr|homebrew|Brewfile*)(N) + shopt -s extglob; rm -rf $(VOLUME)/!(usr|homebrew|Brewfile*) ifdef OPENFOAM_TARBALL tar -xzf $(OPENFOAM_TARBALL) --strip-components 1 -C $(VOLUME) else ifdef OPENFOAM_GIT_BRANCH @@ -281,5 +287,5 @@ uninstall: # Set special targets .PHONY: app build deps fetch-source zip install test test-openfoam test-bash test-zsh test-dmg clean-app clean-build clean uninstall -.SECONDARY: $(OPENFOAM_TARBALL) +.SECONDARY: $(VOLUME) $(OPENFOAM_TARBALL) .DELETE_ON_ERROR: From e55f7bbc4e33b66d57d78f301fd94dec447033b2 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Fri, 29 Dec 2023 13:31:34 -0300 Subject: [PATCH 04/29] Fix Makefile --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6f0be45..b5fb7b7 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ app: | $(VOLUME) $(MAKE) build/$(APP_NAME).app [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) build: | $(VOLUME) - $(MAKE) $(VOLUME)/build + $(MAKE) $(VOLUME)/platforms [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) deps: | $(VOLUME) $(MAKE) $(VOLUME)/Brewfile.lock.json @@ -120,7 +120,7 @@ build/$(APP_NAME).app/Contents/%: Contents/% mkdir -p $(@D) cp -a $< $@ -build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg: $(VOLUME)/build Contents/Resources/icon.icns +build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg: $(VOLUME)/platforms Contents/Resources/icon.icns [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) hdiutil attach \ build/$(APP_NAME)-build.sparsebundle \ @@ -157,20 +157,20 @@ endif hdiutil detach $(VOLUME) rm build/$(APP_NAME)-build.sparsebundle.shadow -$(VOLUME)/build: $(VOLUME)/etc/prefs.sh $(VOLUME)/Brewfile.lock.json relativize_install_names.py +$(VOLUME)/platforms: $(VOLUME)/etc/prefs.sh $(VOLUME)/Brewfile.lock.json relativize_install_names.py cd $(VOLUME) \ && source etc/bashrc \ && foamSystemCheck \ && ( ./Allwmake -j $(WMAKE_NJOBS) -s -q -k || true ) \ && ./Allwmake -j $(WMAKE_NJOBS) -s cd $(VOLUME) && "$(CURDIR)/relativize_install_names.py" - touch $(VOLUME)/build $(VOLUME)/etc/prefs.sh: $(OPENFOAM_TARBALL) configure.sh | $(VOLUME) - shopt -s extglob; rm -rf $(VOLUME)/!(usr|homebrew|Brewfile*) + rm -rf $(VOLUME)/etc ifdef OPENFOAM_TARBALL tar -xzf $(OPENFOAM_TARBALL) --strip-components 1 -C $(VOLUME) else ifdef OPENFOAM_GIT_BRANCH + rm -rf $(VOLUME)/.git git -C $(VOLUME) init -b $(OPENFOAM_GIT_BRANCH) git -C $(VOLUME) remote add origin $(OPENFOAM_GIT_REPO_URL) git -C $(VOLUME) pull origin $(OPENFOAM_GIT_BRANCH) From c4eedb9e78bb0d24d071ef2ad044b51d2051ffe5 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Fri, 29 Dec 2023 16:02:31 -0300 Subject: [PATCH 05/29] Update Makefile --- Makefile | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index b5fb7b7..57d0943 100644 --- a/Makefile +++ b/Makefile @@ -16,16 +16,16 @@ OPENFOAM_GIT_REPO_URL = https://develop.openfoam.com/Development/openfoam.git OPENFOAM_GIT_BRANCH = VOLUME_FILESYSTEM = 'Case-sensitive APFS' WMAKE_NJOBS = -DEPENDENCIES_KIND = standalone +DEPS_KIND = standalone DMG_FORMAT = UDRO APP_HOMEPAGE = https://github.com/gerlero/openfoam-app APP_VERSION = TEST_DIR = build/test-v$(OPENFOAM_VERSION) -ifeq ($(DEPENDENCIES_KIND),standalone) +ifeq ($(DEPS_KIND),standalone) DIST_NAME = openfoam$(OPENFOAM_VERSION)-app-$(shell uname -m) else -DIST_NAME = openfoam$(OPENFOAM_VERSION)-app-$(DEPENDENCIES_KIND)-$(shell uname -m) +DIST_NAME = openfoam$(OPENFOAM_VERSION)-app-$(DEPS_KIND)-$(shell uname -m) endif INSTALL_DIR = /Applications @@ -49,11 +49,11 @@ deps: | $(VOLUME) [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) fetch-source: $(OPENFOAM_TARBALL) -ifeq ($(DEPENDENCIES_KIND),both) +ifeq ($(DEPS_KIND),both) zip: - $(MAKE) zip DEPENDENCIES_KIND=standalone + $(MAKE) zip DEPS_KIND=standalone $(MAKE) clean-app - $(MAKE) zip DEPENDENCIES_KIND=homebrew + $(MAKE) zip DEPS_KIND=homebrew $(MAKE) clean-app endif zip: | $(VOLUME) @@ -93,7 +93,7 @@ build/$(APP_NAME).app/Contents/Info.plist: Contents/Info.plist | build/$(APP_NAM mkdir -p build/$(APP_NAME).app/Contents cp Contents/Info.plist build/$(APP_NAME).app/Contents/ sed -i '' "s|{{APP_VERSION}}|$(APP_VERSION)|g" build/$(APP_NAME).app/Contents/Info.plist - sed -i '' "s|{{DEPENDENCIES_KIND}}|$(DEPENDENCIES_KIND)|g" build/$(APP_NAME).app/Contents/Info.plist + sed -i '' "s|{{DEPS_KIND}}|$(DEPS_KIND)|g" build/$(APP_NAME).app/Contents/Info.plist sed -i '' "s|{{ARCH}}|$(shell uname -m)|g" build/$(APP_NAME).app/Contents/Info.plist build/$(APP_NAME).app/Contents/Resources/etc/openfoam: Contents/Resources/etc/openfoam | build/$(APP_NAME).app/Contents/Resources/volume @@ -135,15 +135,15 @@ build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg: $(VOLUME)/platforms Co rm -rf $(VOLUME)/build rm -rf -- $(VOLUME)/**/.git rm -f -- $(VOLUME)/**/.DS_Store -ifeq ($(DEPENDENCIES_KIND),standalone) +ifeq ($(DEPS_KIND),standalone) rm $(VOLUME)/usr/bin/brew rm $(VOLUME)/Brewfile rm $(VOLUME)/Brewfile.lock.json -else ifeq ($(DEPENDENCIES_KIND),homebrew) +else ifeq ($(DEPS_KIND),homebrew) rm -rf $(VOLUME)/usr ln -s $(shell brew --prefix) $(VOLUME)/usr else - $(error Invalid value for DEPENDENCIES_KIND) + $(error Invalid value for DEPS_KIND) endif rm -rf $(VOLUME)/.fseventsd mkdir -p build/$(APP_NAME).app/Contents/Resources @@ -179,24 +179,24 @@ endif cd $(VOLUME) && "$(CURDIR)/configure.sh" $(VOLUME)/Brewfile.lock.json: $(VOLUME)/Brewfile | $(VOLUME)/usr -ifeq ($(DEPENDENCIES_KIND),standalone) +ifeq ($(DEPS_KIND),standalone) HOMEBREW_RELOCATABLE_INSTALL_NAMES=1 $(VOLUME)/usr/bin/brew bundle --file $(VOLUME)/Brewfile --cleanup --verbose $(VOLUME)/usr/bin/brew list --versions -else ifeq ($(DEPENDENCIES_KIND),homebrew) +else ifeq ($(DEPS_KIND),homebrew) brew bundle --file $(VOLUME)/Brewfile --no-upgrade else - $(error Invalid value for DEPENDENCIES_KIND) + $(error Invalid value for DEPS_KIND) endif $(VOLUME)/usr: | $(VOLUME) -ifeq ($(DEPENDENCIES_KIND),standalone) +ifeq ($(DEPS_KIND),standalone) git clone https://github.com/Homebrew/brew $(VOLUME)/homebrew mkdir -p $(VOLUME)/usr/bin ln -s ../../homebrew/bin/brew $(VOLUME)/usr/bin/ -else ifeq ($(DEPENDENCIES_KIND),homebrew) +else ifeq ($(DEPS_KIND),homebrew) ln -s $(shell brew --prefix) $(VOLUME)/usr else - $(error Invalid value for DEPENDENCIES_KIND) + $(error Invalid value for DEPS_KIND) endif $(VOLUME)/Brewfile: Brewfile | $(VOLUME) From 68d088c4b262fbb95cdd3c7b2ed32da47d49effc Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Fri, 29 Dec 2023 16:28:42 -0300 Subject: [PATCH 06/29] Fix Info.plist --- Contents/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contents/Info.plist b/Contents/Info.plist index 87417de..f6084a3 100644 --- a/Contents/Info.plist +++ b/Contents/Info.plist @@ -7,7 +7,7 @@ CFBundleIconFile icon.icns CFBundleVersion - {{APP_VERSION}}-{{DEPENDENCIES_KIND}}-{{ARCH}} + {{APP_VERSION}}-{{DEPS_KIND}}-{{ARCH}} CFBundleShortVersionString {{APP_VERSION}} From 99b133b6efc89c2715ded63c6993bc1f0843bb0f Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Sat, 30 Dec 2023 19:31:36 -0300 Subject: [PATCH 07/29] Reorganize repository --- .github/workflows/build-test.yml | 4 ++-- Makefile | 18 +++++++++--------- README.md | 4 ++-- icon.png => images/icon.png | Bin screenshot.png => images/screenshot.png | Bin configure.sh => scripts/configure.sh | 0 .../relativize_install_names.py | 0 test.sh => scripts/test.sh | 0 .../OpenFOAM-v2112.tgz.sha256 | 2 +- .../OpenFOAM-v2112_220610.tgz.sha256 | 2 +- .../OpenFOAM-v2206.tgz.sha256 | 2 +- .../OpenFOAM-v2212.tgz.sha256 | 2 +- .../OpenFOAM-v2212_230612.tgz.sha256 | 2 +- .../OpenFOAM-v2306.tgz.sha256 | 2 +- .../OpenFOAM-v2312.tgz.sha256 | 2 +- 15 files changed, 20 insertions(+), 20 deletions(-) rename icon.png => images/icon.png (100%) rename screenshot.png => images/screenshot.png (100%) rename configure.sh => scripts/configure.sh (100%) rename relativize_install_names.py => scripts/relativize_install_names.py (100%) rename test.sh => scripts/test.sh (100%) rename OpenFOAM-v2112.tgz.sha256 => sources/OpenFOAM-v2112.tgz.sha256 (68%) rename OpenFOAM-v2112_220610.tgz.sha256 => sources/OpenFOAM-v2112_220610.tgz.sha256 (64%) rename OpenFOAM-v2206.tgz.sha256 => sources/OpenFOAM-v2206.tgz.sha256 (68%) rename OpenFOAM-v2212.tgz.sha256 => sources/OpenFOAM-v2212.tgz.sha256 (68%) rename OpenFOAM-v2212_230612.tgz.sha256 => sources/OpenFOAM-v2212_230612.tgz.sha256 (64%) rename OpenFOAM-v2306.tgz.sha256 => sources/OpenFOAM-v2306.tgz.sha256 (68%) rename OpenFOAM-v2312.tgz.sha256 => sources/OpenFOAM-v2312.tgz.sha256 (68%) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b508f4e..ac4ec28 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -74,7 +74,7 @@ env: ${{ inputs.app-version != '' && format('APP_VERSION={0}', inputs.app-version) || '' }} ${{ inputs.app-name != '' && format('APP_NAME={0}', inputs.app-name) || '' }} ${{ inputs.openfoam-git-branch != '' && format('OPENFOAM_GIT_BRANCH={0}', inputs.openfoam-git-branch) || '' }} - + OPENFOAM: ${{ inputs.openfoam-version || inputs.openfoam-git-branch }} jobs: @@ -96,7 +96,7 @@ jobs: id: caching run: | DEPS_RESTORE_KEY="build-${{ env.OPENFOAM }}-${{ env.BUILD_OS }}-${{ hashFiles('make_deps.txt', 'Brewfile') }}" - BUILD_RESTORE_KEY="$DEPS_RESTORE_KEY-${{ hashFiles('make_build.txt', 'configure.sh', 'relativize_install_names.py') }}" + BUILD_RESTORE_KEY="$DEPS_RESTORE_KEY-${{ hashFiles('make_build.txt', 'scripts/configure.sh', 'scripts/relativize_install_names.py') }}" echo "DEPS_RESTORE_KEY=$DEPS_RESTORE_KEY" >> "$GITHUB_OUTPUT" echo "BUILD_RESTORE_KEY=$BUILD_RESTORE_KEY" >> "$GITHUB_OUTPUT" - name: Look up cached deps diff --git a/Makefile b/Makefile index 57d0943..5dade8c 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ endif INSTALL_DIR = /Applications ifndef OPENFOAM_GIT_BRANCH -OPENFOAM_TARBALL = $(shell basename $(OPENFOAM_TARBALL_URL)) +OPENFOAM_TARBALL = sources/$(shell basename $(OPENFOAM_TARBALL_URL)) endif VOLUME = /Volumes/$(APP_NAME) @@ -157,15 +157,15 @@ endif hdiutil detach $(VOLUME) rm build/$(APP_NAME)-build.sparsebundle.shadow -$(VOLUME)/platforms: $(VOLUME)/etc/prefs.sh $(VOLUME)/Brewfile.lock.json relativize_install_names.py +$(VOLUME)/platforms: $(VOLUME)/etc/prefs.sh $(VOLUME)/Brewfile.lock.json scripts/relativize_install_names.py cd $(VOLUME) \ && source etc/bashrc \ && foamSystemCheck \ && ( ./Allwmake -j $(WMAKE_NJOBS) -s -q -k || true ) \ && ./Allwmake -j $(WMAKE_NJOBS) -s - cd $(VOLUME) && "$(CURDIR)/relativize_install_names.py" + cd $(VOLUME) && "$(CURDIR)/scripts/relativize_install_names.py" -$(VOLUME)/etc/prefs.sh: $(OPENFOAM_TARBALL) configure.sh | $(VOLUME) +$(VOLUME)/etc/prefs.sh: $(OPENFOAM_TARBALL) scripts/configure.sh | $(VOLUME) rm -rf $(VOLUME)/etc ifdef OPENFOAM_TARBALL tar -xzf $(OPENFOAM_TARBALL) --strip-components 1 -C $(VOLUME) @@ -176,7 +176,7 @@ else ifdef OPENFOAM_GIT_BRANCH git -C $(VOLUME) pull origin $(OPENFOAM_GIT_BRANCH) git -C $(VOLUME) submodule update --init --recursive endif - cd $(VOLUME) && "$(CURDIR)/configure.sh" + cd $(VOLUME) && "$(CURDIR)/scripts/configure.sh" $(VOLUME)/Brewfile.lock.json: $(VOLUME)/Brewfile | $(VOLUME)/usr ifeq ($(DEPS_KIND),standalone) @@ -231,7 +231,7 @@ test-openfoam: mkdir -p $(TEST_DIR)/test-openfoam build/$(APP_NAME).app/Contents/Resources/etc/openfoam -c foamInstallationTest cd $(TEST_DIR)/test-openfoam \ - && "$(CURDIR)/build/$(APP_NAME).app/Contents/Resources/etc/openfoam" < "$(CURDIR)/test.sh" + && "$(CURDIR)/build/$(APP_NAME).app/Contents/Resources/etc/openfoam" < "$(CURDIR)/scripts/test.sh" build/$(APP_NAME).app/Contents/Resources/volume eject && [ ! -d $(VOLUME) ] test-bash: @@ -243,7 +243,7 @@ test-bash: set -ex; \ foamInstallationTest; \ cd $(TEST_DIR)/test-bash; \ - source "$(CURDIR)/test.sh"' + source "$(CURDIR)/scripts/test.sh"' build/$(APP_NAME).app/Contents/Resources/volume eject && [ ! -d $(VOLUME) ] test-zsh: @@ -255,7 +255,7 @@ test-zsh: set -ex; \ foamInstallationTest; \ cd $(TEST_DIR)/test-zsh; \ - source "$(CURDIR)/test.sh"' + source "$(CURDIR)/scripts/test.sh"' build/$(APP_NAME).app/Contents/Resources/volume eject && [ ! -d $(VOLUME) ] test-dmg: @@ -266,7 +266,7 @@ test-dmg: cd $(TEST_DIR)/test-dmg \ && source $(VOLUME)/etc/bashrc \ && foamInstallationTest \ - && "$(CURDIR)/test.sh" + && "$(CURDIR)/scripts/test.sh" hdiutil detach $(VOLUME) clean-app: diff --git a/README.md b/README.md index 59fd2fa..2a85b65 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[](#) +[](#) # **OpenFOAM.app**: OpenFOAM for macOS @@ -58,7 +58,7 @@ Just open the **OpenFOAM** app to start an OpenFOAM session in a new Terminal window. - + That's it! When using OpenFOAM, a read-only volume will be loaded and visible in the Finder. The OpenFOAM installation lives inside this virtual disk. When you're not actively using OpenFOAM, it is safe to "eject" the volume from the Finder sidebar. diff --git a/icon.png b/images/icon.png similarity index 100% rename from icon.png rename to images/icon.png diff --git a/screenshot.png b/images/screenshot.png similarity index 100% rename from screenshot.png rename to images/screenshot.png diff --git a/configure.sh b/scripts/configure.sh similarity index 100% rename from configure.sh rename to scripts/configure.sh diff --git a/relativize_install_names.py b/scripts/relativize_install_names.py similarity index 100% rename from relativize_install_names.py rename to scripts/relativize_install_names.py diff --git a/test.sh b/scripts/test.sh similarity index 100% rename from test.sh rename to scripts/test.sh diff --git a/OpenFOAM-v2112.tgz.sha256 b/sources/OpenFOAM-v2112.tgz.sha256 similarity index 68% rename from OpenFOAM-v2112.tgz.sha256 rename to sources/OpenFOAM-v2112.tgz.sha256 index 7052277..b369506 100644 --- a/OpenFOAM-v2112.tgz.sha256 +++ b/sources/OpenFOAM-v2112.tgz.sha256 @@ -1 +1 @@ -3e838731e79db1c288acc27aad8cc8a43d9dac1f24e5773e3b9fa91419a8c3f7 OpenFOAM-v2112.tgz +3e838731e79db1c288acc27aad8cc8a43d9dac1f24e5773e3b9fa91419a8c3f7 sources/OpenFOAM-v2112.tgz diff --git a/OpenFOAM-v2112_220610.tgz.sha256 b/sources/OpenFOAM-v2112_220610.tgz.sha256 similarity index 64% rename from OpenFOAM-v2112_220610.tgz.sha256 rename to sources/OpenFOAM-v2112_220610.tgz.sha256 index 5e2ad48..63f8e19 100644 --- a/OpenFOAM-v2112_220610.tgz.sha256 +++ b/sources/OpenFOAM-v2112_220610.tgz.sha256 @@ -1 +1 @@ -e07fd7220520e4bcfd6c8100a7e027fba13eeca2b11085c9dd4642758422a63d OpenFOAM-v2112_220610.tgz +e07fd7220520e4bcfd6c8100a7e027fba13eeca2b11085c9dd4642758422a63d sources/OpenFOAM-v2112_220610.tgz diff --git a/OpenFOAM-v2206.tgz.sha256 b/sources/OpenFOAM-v2206.tgz.sha256 similarity index 68% rename from OpenFOAM-v2206.tgz.sha256 rename to sources/OpenFOAM-v2206.tgz.sha256 index d7b7883..1a277e7 100644 --- a/OpenFOAM-v2206.tgz.sha256 +++ b/sources/OpenFOAM-v2206.tgz.sha256 @@ -1 +1 @@ -db95eda4afb97ca870733b2d4201ef539099d0778e3f3eca9a075d4f1a0eea46 OpenFOAM-v2206.tgz +db95eda4afb97ca870733b2d4201ef539099d0778e3f3eca9a075d4f1a0eea46 sources/OpenFOAM-v2206.tgz diff --git a/OpenFOAM-v2212.tgz.sha256 b/sources/OpenFOAM-v2212.tgz.sha256 similarity index 68% rename from OpenFOAM-v2212.tgz.sha256 rename to sources/OpenFOAM-v2212.tgz.sha256 index 9809c03..e7748cc 100644 --- a/OpenFOAM-v2212.tgz.sha256 +++ b/sources/OpenFOAM-v2212.tgz.sha256 @@ -1 +1 @@ -0a3ddbfea9abca04c3a811e72fcbb184c6b1f92c295461e63b231f1a97e96476 OpenFOAM-v2212.tgz +0a3ddbfea9abca04c3a811e72fcbb184c6b1f92c295461e63b231f1a97e96476 sources/OpenFOAM-v2212.tgz diff --git a/OpenFOAM-v2212_230612.tgz.sha256 b/sources/OpenFOAM-v2212_230612.tgz.sha256 similarity index 64% rename from OpenFOAM-v2212_230612.tgz.sha256 rename to sources/OpenFOAM-v2212_230612.tgz.sha256 index 86ea8a2..39dd4f4 100644 --- a/OpenFOAM-v2212_230612.tgz.sha256 +++ b/sources/OpenFOAM-v2212_230612.tgz.sha256 @@ -1 +1 @@ -604cd731173ec2a3645c838cf2468fae050a35c6340e2ca7c157699899d904c0 OpenFOAM-v2212_230612.tgz +604cd731173ec2a3645c838cf2468fae050a35c6340e2ca7c157699899d904c0 sources/OpenFOAM-v2212_230612.tgz diff --git a/OpenFOAM-v2306.tgz.sha256 b/sources/OpenFOAM-v2306.tgz.sha256 similarity index 68% rename from OpenFOAM-v2306.tgz.sha256 rename to sources/OpenFOAM-v2306.tgz.sha256 index 986f882..1b3af76 100644 --- a/OpenFOAM-v2306.tgz.sha256 +++ b/sources/OpenFOAM-v2306.tgz.sha256 @@ -1 +1 @@ -d7fba773658c0f06ad17f90199565f32e9bf502b7bb03077503642064e1f5344 OpenFOAM-v2306.tgz +d7fba773658c0f06ad17f90199565f32e9bf502b7bb03077503642064e1f5344 sources/OpenFOAM-v2306.tgz diff --git a/OpenFOAM-v2312.tgz.sha256 b/sources/OpenFOAM-v2312.tgz.sha256 similarity index 68% rename from OpenFOAM-v2312.tgz.sha256 rename to sources/OpenFOAM-v2312.tgz.sha256 index 35643e5..34fb9c5 100644 --- a/OpenFOAM-v2312.tgz.sha256 +++ b/sources/OpenFOAM-v2312.tgz.sha256 @@ -1 +1 @@ -f113183a4d027c93939212af8967053c5f8fe76fb62e5848cb11bbcf8e829552 OpenFOAM-v2312.tgz +f113183a4d027c93939212af8967053c5f8fe76fb62e5848cb11bbcf8e829552 sources/OpenFOAM-v2312.tgz From 40b684dc5f20c23d31dd5b9e15a6e6dfc7ef74ed Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Sun, 31 Dec 2023 01:05:04 -0300 Subject: [PATCH 08/29] Update scripts --- scripts/macho.py | 26 ++++++++++++++++++++++++++ scripts/relativize_install_names.py | 13 +++++++------ 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 scripts/macho.py diff --git a/scripts/macho.py b/scripts/macho.py new file mode 100644 index 0000000..2108813 --- /dev/null +++ b/scripts/macho.py @@ -0,0 +1,26 @@ +""" +Utility functions for working with macOS Mach-O files. +""" +import subprocess +import platform +import os + +from pathlib import Path + +def _codesign(file): + subprocess.run(["codesign", "--sign", "-", "--force", "--preserve-metadata=entitlements,requirements,flags,runtime", file], check=True) + +def get_install_names(file): + otool_stdout = subprocess.run(["otool", "-L", file], stdout=subprocess.PIPE, check=True).stdout.decode() + install_names = [Path(line.rpartition(" (compatibility version ")[0].strip()) for line in otool_stdout.splitlines()[1:]] + return install_names + +def change_install_name(file, old_install_name, new_install_name, *, relative=False): + file = Path(file) + if relative: + new_install_name = Path(new_install_name) + assert new_install_name.is_absolute() + new_install_name = Path("@loader_path") / os.path.relpath(new_install_name, start=file.parent) + subprocess.run(["install_name_tool", "-change", old_install_name, new_install_name, file], check=True) + if platform.machine() == "arm64": + _codesign(file) diff --git a/scripts/relativize_install_names.py b/scripts/relativize_install_names.py index 95a8796..b52a76f 100755 --- a/scripts/relativize_install_names.py +++ b/scripts/relativize_install_names.py @@ -1,21 +1,22 @@ #!/usr/bin/env python3 +""" +Replace absolute references to dylibs in OpenFOAM binaries with relative references. +""" -import os import subprocess from pathlib import Path +import macho + def relativize_install_names(file, lib_dirs): - otool_stdout = subprocess.run(["otool", "-L", file], stdout=subprocess.PIPE, check=True).stdout.decode() - install_names = [Path(line.split(" (compatibility version ")[0].strip()) for line in otool_stdout.splitlines()[1:]] - for install_name in install_names: + for install_name in macho.get_install_names(file): if install_name.is_absolute(): for lib_dir,new_lib_dir in lib_dirs.items(): lib_dir = lib_dir.absolute() if install_name.is_relative_to(lib_dir): new_install_name = new_lib_dir.absolute() / install_name.relative_to(lib_dir) - relative_install_name = Path("@loader_path") / os.path.relpath(new_install_name, start=file.parent) - subprocess.run(["install_name_tool", "-change", install_name, relative_install_name, file]) + macho.change_install_name(file, install_name, new_install_name, relative=True) break # Replace references to dependencies From 999834fa78386529b485917b6b8389c31e199711 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Tue, 2 Jan 2024 17:55:07 -0300 Subject: [PATCH 09/29] Update dependency bundling --- .github/workflows/build-test.yml | 17 ++++++ .github/workflows/ci.yml | 9 +++ .github/workflows/openfoam-dev-branches.yml | 11 +++- Makefile | 34 ++++------- scripts/bundle_deps.py | 63 +++++++++++++++++++++ scripts/macho.py | 5 ++ 6 files changed, 115 insertions(+), 24 deletions(-) create mode 100755 scripts/bundle_deps.py diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index ac4ec28..d6d8496 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -19,6 +19,10 @@ on: type: string default: '' required: false + deps-kind: + type: string + default: '' + required: false build-os: type: string default: '' @@ -52,6 +56,14 @@ on: default: '' required: false description: Build this OpenFOAM Git branch + deps-kind: + type: choice + required: false + description: Bundle dependencies in this manner + options: + - standalone + - bundled + - homebrew build-os: type: string default: '' @@ -74,6 +86,7 @@ env: ${{ inputs.app-version != '' && format('APP_VERSION={0}', inputs.app-version) || '' }} ${{ inputs.app-name != '' && format('APP_NAME={0}', inputs.app-name) || '' }} ${{ inputs.openfoam-git-branch != '' && format('OPENFOAM_GIT_BRANCH={0}', inputs.openfoam-git-branch) || '' }} + ${{ inputs.deps-kind != '' && format('DEPS_KIND={0}', inputs.deps-kind) || '' }} OPENFOAM: ${{ inputs.openfoam-version || inputs.openfoam-git-branch }} @@ -179,6 +192,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install Homebrew dependencies + if: inputs.deps-kind == 'homebrew' + run: | + brew bundle - name: Download app artifact uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 895c44a..690878e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,14 @@ on: default: '' required: false description: Build using this macOS image + deps-kind: + type: choice + required: false + description: Bundle dependencies in this manner + options: + - standalone + - bundled + - homebrew cache-build: type: boolean default: true @@ -37,5 +45,6 @@ jobs: with: openfoam-version: ${{ matrix.openfoam-version }} build-os: ${{ inputs.build-os }} + deps-kind: ${{ inputs.deps-kind }} use-cached: ${{ github.event_name == 'workflow_dispatch' && inputs.use-cached || github.event_name != 'workflow_dispatch' && github.event_name != 'schedule' }} cache-build: ${{ github.event_name != 'workflow_dispatch' && inputs.cache-build || github.event_name != 'workflow_dispatch' }} diff --git a/.github/workflows/openfoam-dev-branches.yml b/.github/workflows/openfoam-dev-branches.yml index 207320f..68db6fa 100644 --- a/.github/workflows/openfoam-dev-branches.yml +++ b/.github/workflows/openfoam-dev-branches.yml @@ -10,6 +10,14 @@ on: default: '' required: false description: Build using this macOS image + deps-kind: + type: choice + required: false + description: Bundle dependencies in this manner + options: + - standalone + - bundled + - homebrew jobs: openfoam-dev-branch: @@ -22,6 +30,7 @@ jobs: app-name: OpenFOAM-${{ matrix.openfoam-git-branch }} app-version: ${{ matrix.openfoam-git-branch }} openfoam-git-branch: ${{ matrix.openfoam-git-branch }} - build-os: ${{ github.event.inputs.build-os }} + build-os: ${{ inputs.build-os }} + deps-kind: ${{ inputs.deps-kind }} use-cached: false cache-build: false diff --git a/Makefile b/Makefile index 5dade8c..c84ad9f 100644 --- a/Makefile +++ b/Makefile @@ -21,13 +21,7 @@ DMG_FORMAT = UDRO APP_HOMEPAGE = https://github.com/gerlero/openfoam-app APP_VERSION = TEST_DIR = build/test-v$(OPENFOAM_VERSION) - -ifeq ($(DEPS_KIND),standalone) DIST_NAME = openfoam$(OPENFOAM_VERSION)-app-$(shell uname -m) -else -DIST_NAME = openfoam$(OPENFOAM_VERSION)-app-$(DEPS_KIND)-$(shell uname -m) -endif - INSTALL_DIR = /Applications ifndef OPENFOAM_GIT_BRANCH @@ -48,14 +42,6 @@ deps: | $(VOLUME) $(MAKE) $(VOLUME)/Brewfile.lock.json [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) fetch-source: $(OPENFOAM_TARBALL) - -ifeq ($(DEPS_KIND),both) -zip: - $(MAKE) zip DEPS_KIND=standalone - $(MAKE) clean-app - $(MAKE) zip DEPS_KIND=homebrew - $(MAKE) clean-app -endif zip: | $(VOLUME) $(MAKE) build/$(DIST_NAME).zip [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) @@ -135,15 +121,13 @@ build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg: $(VOLUME)/platforms Co rm -rf $(VOLUME)/build rm -rf -- $(VOLUME)/**/.git rm -f -- $(VOLUME)/**/.DS_Store -ifeq ($(DEPS_KIND),standalone) - rm $(VOLUME)/usr/bin/brew - rm $(VOLUME)/Brewfile - rm $(VOLUME)/Brewfile.lock.json -else ifeq ($(DEPS_KIND),homebrew) +ifeq ($(DEPS_KIND),homebrew) rm -rf $(VOLUME)/usr ln -s $(shell brew --prefix) $(VOLUME)/usr else - $(error Invalid value for DEPS_KIND) + rm -f $(VOLUME)/usr/bin/brew + rm $(VOLUME)/Brewfile + rm $(VOLUME)/Brewfile.lock.json endif rm -rf $(VOLUME)/.fseventsd mkdir -p build/$(APP_NAME).app/Contents/Resources @@ -182,10 +166,12 @@ $(VOLUME)/Brewfile.lock.json: $(VOLUME)/Brewfile | $(VOLUME)/usr ifeq ($(DEPS_KIND),standalone) HOMEBREW_RELOCATABLE_INSTALL_NAMES=1 $(VOLUME)/usr/bin/brew bundle --file $(VOLUME)/Brewfile --cleanup --verbose $(VOLUME)/usr/bin/brew list --versions -else ifeq ($(DEPS_KIND),homebrew) - brew bundle --file $(VOLUME)/Brewfile --no-upgrade else - $(error Invalid value for DEPS_KIND) + brew bundle --file $(VOLUME)/Brewfile --no-upgrade +endif +ifeq ($(DEPS_KIND),bundled) + rm -rf $(VOLUME)/usr + cd $(VOLUME) && "$(CURDIR)/scripts/bundle_deps.py" endif $(VOLUME)/usr: | $(VOLUME) @@ -195,6 +181,8 @@ ifeq ($(DEPS_KIND),standalone) ln -s ../../homebrew/bin/brew $(VOLUME)/usr/bin/ else ifeq ($(DEPS_KIND),homebrew) ln -s $(shell brew --prefix) $(VOLUME)/usr +else ifeq ($(DEPS_KIND),bundled) + mkdir $(VOLUME)/usr else $(error Invalid value for DEPS_KIND) endif diff --git a/scripts/bundle_deps.py b/scripts/bundle_deps.py new file mode 100755 index 0000000..8cf397a --- /dev/null +++ b/scripts/bundle_deps.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +""" +Copy Homebrew dependencies installed with Homebrew Bundle. +""" +import subprocess +import shutil + +from pathlib import Path + +import macho + +SRC_PREFIX = Path(subprocess.run(["brew", "--prefix"], stdout=subprocess.PIPE, check=True).stdout.decode().strip()) + +def bundle_list(): + return subprocess.run(["brew", "bundle", "list"], stdout=subprocess.PIPE, check=True).stdout.decode().splitlines() + +def deps(*formulae, union=False): + cmd = ["brew", "deps"] + if union: + cmd.append("--union") + return subprocess.run([*cmd, *formulae], stdout=subprocess.PIPE, check=True).stdout.decode().splitlines() + +def copy_installed_formula(formula, dst_prefix, *, relative_install_names=False): + dst_prefix = Path(dst_prefix) + + _, _, name = formula.rpartition("/") + + src_opt = SRC_PREFIX / "opt" / name + dst_opt = dst_prefix / "opt" / name + + src_cellar = SRC_PREFIX / "Cellar" / name + dst_cellar = dst_prefix / "Cellar" / name + + shutil.copytree(src_cellar, dst_cellar) + + dst_opt.parent.mkdir(exist_ok=True) + shutil.copy(src_opt, dst_opt, follow_symlinks=False) + + # Relocate binaries + for file in dst_cellar.rglob("*"): + if not file.is_file(): + continue + if (file.suffix == ".dylib" or file.suffix == ".so"): + macho.change_dylib_id(file, dst_opt.absolute() / Path(*file.relative_to(dst_cellar).parts[1:])) + if (file.suffix == "" or file.suffix == ".dylib" or file.suffix == ".so"): + for install_name in macho.get_install_names(file): + if install_name.is_absolute() and install_name.is_relative_to(SRC_PREFIX): + if install_name.is_relative_to(SRC_PREFIX): + new_install_name = dst_prefix.absolute() / install_name.relative_to(SRC_PREFIX) + macho.change_install_name(file, install_name, new_install_name, relative=relative_install_names) + + +dst_prefix = Path("usr") +formulae = bundle_list() + +for formula in formulae: + print(f"Bundling {formula}") + copy_installed_formula(formula, dst_prefix, relative_install_names=True) + +for formula in deps(*formulae, union=True): + if formula not in formulae: + print(f"Bundling {formula} (indirect dependency)") + copy_installed_formula(formula, dst_prefix, relative_install_names=True) diff --git a/scripts/macho.py b/scripts/macho.py index 2108813..8331b66 100644 --- a/scripts/macho.py +++ b/scripts/macho.py @@ -10,6 +10,11 @@ def _codesign(file): subprocess.run(["codesign", "--sign", "-", "--force", "--preserve-metadata=entitlements,requirements,flags,runtime", file], check=True) +def change_dylib_id(lib, id): + subprocess.run(["install_name_tool", "-id", id, lib], check=True) + if platform.machine() == "arm64": + _codesign(lib) + def get_install_names(file): otool_stdout = subprocess.run(["otool", "-L", file], stdout=subprocess.PIPE, check=True).stdout.decode() install_names = [Path(line.rpartition(" (compatibility version ")[0].strip()) for line in otool_stdout.splitlines()[1:]] From 201b37b9309f2bd5c90577687148c2a88d60e3ca Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Tue, 2 Jan 2024 19:15:00 -0300 Subject: [PATCH 10/29] Update workflows --- .github/workflows/build-test.yml | 3 ++- .github/workflows/ci.yml | 1 + .github/workflows/openfoam-dev-branches.yml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index d6d8496..f6a5495 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -61,6 +61,7 @@ on: required: false description: Bundle dependencies in this manner options: + - '' - standalone - bundled - homebrew @@ -108,7 +109,7 @@ jobs: - name: Generate cache restore keys id: caching run: | - DEPS_RESTORE_KEY="build-${{ env.OPENFOAM }}-${{ env.BUILD_OS }}-${{ hashFiles('make_deps.txt', 'Brewfile') }}" + DEPS_RESTORE_KEY="build-${{ env.OPENFOAM }}-${{ env.BUILD_OS }}-${{ inputs.deps-kind }}-${{ hashFiles('make_deps.txt', 'Brewfile', 'scripts/bundle_deps.py') }}" BUILD_RESTORE_KEY="$DEPS_RESTORE_KEY-${{ hashFiles('make_build.txt', 'scripts/configure.sh', 'scripts/relativize_install_names.py') }}" echo "DEPS_RESTORE_KEY=$DEPS_RESTORE_KEY" >> "$GITHUB_OUTPUT" echo "BUILD_RESTORE_KEY=$BUILD_RESTORE_KEY" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 690878e..591fffb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,7 @@ on: required: false description: Bundle dependencies in this manner options: + - '' - standalone - bundled - homebrew diff --git a/.github/workflows/openfoam-dev-branches.yml b/.github/workflows/openfoam-dev-branches.yml index 68db6fa..aa3747b 100644 --- a/.github/workflows/openfoam-dev-branches.yml +++ b/.github/workflows/openfoam-dev-branches.yml @@ -15,6 +15,7 @@ on: required: false description: Bundle dependencies in this manner options: + - '' - standalone - bundled - homebrew From 1c52ad398662f8e9a87ad4d6c6682f2a23f2e071 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Tue, 2 Jan 2024 19:27:36 -0300 Subject: [PATCH 11/29] Update Makefile --- Makefile | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index c84ad9f..7ca8650 100644 --- a/Makefile +++ b/Makefile @@ -117,18 +117,12 @@ build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg: $(VOLUME)/platforms Co uuidgen > $(VOLUME_ID_FILE) cat $(VOLUME_ID_FILE) rm -rf $(VOLUME)/homebrew - [ ! -L $(VOLUME)/usr ] || rm $(VOLUME)/usr - rm -rf $(VOLUME)/build - rm -rf -- $(VOLUME)/**/.git - rm -f -- $(VOLUME)/**/.DS_Store -ifeq ($(DEPS_KIND),homebrew) - rm -rf $(VOLUME)/usr - ln -s $(shell brew --prefix) $(VOLUME)/usr -else rm -f $(VOLUME)/usr/bin/brew rm $(VOLUME)/Brewfile rm $(VOLUME)/Brewfile.lock.json -endif + rm -rf $(VOLUME)/build + rm -rf $(VOLUME)/**/.git + rm -f $(VOLUME)/**/.DS_Store rm -rf $(VOLUME)/.fseventsd mkdir -p build/$(APP_NAME).app/Contents/Resources hdiutil create \ From af392fdf5a26330dbf2de8f2ce0fb72051627352 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 08:41:17 +0000 Subject: [PATCH 12/29] Bump actions/cache from 3 to 4 Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build-test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index f6a5495..2ac6b42 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -116,7 +116,7 @@ jobs: - name: Look up cached deps id: cache_deps if: inputs.use-cached - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: build/*.sparsebundle key: ignore @@ -129,7 +129,7 @@ jobs: make deps ${{ env.MAKE_VARS }} - name: Save deps to cache if: steps.cache_deps.outputs.cache-matched-key == '' - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 with: path: build/*.sparsebundle key: ${{ steps.caching.outputs.DEPS_RESTORE_KEY }}-${{ github.run_id }} @@ -143,7 +143,7 @@ jobs: - name: Restore cached build if available if: inputs.use-cached id: cache_build - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: build/*.sparsebundle key: ignore @@ -152,7 +152,7 @@ jobs: - name: Restore cached deps if: steps.cache_build.outputs.cache-matched-key == '' id: cache_deps - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: build/*.sparsebundle key: ignore @@ -167,7 +167,7 @@ jobs: make build ${{ env.MAKE_VARS }} - name: Save build to cache if: steps.cache_build.outputs.cache-matched-key == '' && inputs.cache-build - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 with: path: build/*.sparsebundle key: ${{ needs.deps.outputs.build-restore-key }}-${{ github.run_id }} From 332dde8887ad7b8ad8eaee12db9b15203eac0e42 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Wed, 31 Jan 2024 20:11:17 -0300 Subject: [PATCH 13/29] Update build workflow --- .github/workflows/build-test.yml | 22 +++++++------- .github/workflows/ci.yml | 19 ++++++++---- .github/workflows/openfoam-dev-branches.yml | 33 ++++++++++----------- .github/workflows/release.yml | 7 +---- 4 files changed, 40 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index f6a5495..7b359e8 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -41,6 +41,10 @@ on: required: false workflow_dispatch: inputs: + build-os: + type: string + required: true + description: Build using this macOS image openfoam-version: type: string default: '' @@ -65,11 +69,6 @@ on: - standalone - bundled - homebrew - build-os: - type: string - default: '' - required: false - description: Build using this macOS image use-cached: type: boolean default: true @@ -93,9 +92,7 @@ env: jobs: deps: - runs-on: ${{ inputs.build-os || 'macos-12' }} - env: - BUILD_OS: ${{ inputs.build-os || 'macos-12' }} + runs-on: ${{ inputs.build-os }} outputs: deps-restore-key: ${{ steps.caching.outputs.DEPS_RESTORE_KEY }} build-restore-key: ${{ steps.caching.outputs.BUILD_RESTORE_KEY }} @@ -109,7 +106,7 @@ jobs: - name: Generate cache restore keys id: caching run: | - DEPS_RESTORE_KEY="build-${{ env.OPENFOAM }}-${{ env.BUILD_OS }}-${{ inputs.deps-kind }}-${{ hashFiles('make_deps.txt', 'Brewfile', 'scripts/bundle_deps.py') }}" + DEPS_RESTORE_KEY="build-${{ env.OPENFOAM }}-${{ inputs.build-os }}-${{ inputs.deps-kind }}-${{ hashFiles('make_deps.txt', 'Brewfile', 'scripts/bundle_deps.py') }}" BUILD_RESTORE_KEY="$DEPS_RESTORE_KEY-${{ hashFiles('make_build.txt', 'scripts/configure.sh', 'scripts/relativize_install_names.py') }}" echo "DEPS_RESTORE_KEY=$DEPS_RESTORE_KEY" >> "$GITHUB_OUTPUT" echo "BUILD_RESTORE_KEY=$BUILD_RESTORE_KEY" >> "$GITHUB_OUTPUT" @@ -136,7 +133,9 @@ jobs: build: needs: deps - runs-on: ${{ inputs.build-os || 'macos-12' }} + runs-on: ${{ inputs.build-os }} + outputs: + arch: ${{ runner.arch }} steps: - name: Checkout uses: actions/checkout@v4 @@ -187,7 +186,7 @@ jobs: needs: build strategy: matrix: - os: [macos-12, macos-13] + os: [macos-12, macos-13, macos-14] fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -207,6 +206,7 @@ jobs: unzip *-app-*.zip working-directory: build - name: Test + if: needs.build.outputs.arch == runner.arch run: | make test ${{ env.MAKE_VARS }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 591fffb..8b7dd97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,16 @@ on: - main schedule: - cron: '0 6 * * 5' + workflow_call: + inputs: + app-version: + type: string + default: '' + required: false + release: + type: boolean + default: false + required: false workflow_dispatch: inputs: use-cached: @@ -16,11 +26,6 @@ on: default: false required: false description: Reuse cached build artifacts if available - build-os: - type: string - default: '' - required: false - description: Build using this macOS image deps-kind: type: choice required: false @@ -40,12 +45,14 @@ jobs: ci: strategy: matrix: + build-os: [macos-14, macos-12] openfoam-version: [2312, 2306] fail-fast: false uses: ./.github/workflows/build-test.yml with: openfoam-version: ${{ matrix.openfoam-version }} - build-os: ${{ inputs.build-os }} + build-os: ${{ matrix.build-os }} deps-kind: ${{ inputs.deps-kind }} + app-version: ${{ github.event_name == 'workflow_call' && inputs.app-version || '' }} use-cached: ${{ github.event_name == 'workflow_dispatch' && inputs.use-cached || github.event_name != 'workflow_dispatch' && github.event_name != 'schedule' }} cache-build: ${{ github.event_name != 'workflow_dispatch' && inputs.cache-build || github.event_name != 'workflow_dispatch' }} diff --git a/.github/workflows/openfoam-dev-branches.yml b/.github/workflows/openfoam-dev-branches.yml index aa3747b..392f239 100644 --- a/.github/workflows/openfoam-dev-branches.yml +++ b/.github/workflows/openfoam-dev-branches.yml @@ -4,34 +4,31 @@ on: schedule: - cron: '0 6 * * 5' workflow_dispatch: - inputs: - build-os: - type: string - default: '' - required: false - description: Build using this macOS image - deps-kind: - type: choice - required: false - description: Bundle dependencies in this manner - options: - - '' - - standalone - - bundled - - homebrew jobs: openfoam-dev-branch: strategy: matrix: - openfoam-git-branch: [master, develop] + include: + - build-os: macos-14 + openfoam-git-branch: master + deps-kind: bundled + - build-os: macos-12 + openfoam-git-branch: master + deps-kind: standalone + - build-os: macos-14 + openfoam-git-branch: develop + deps-kind: bundled + - build-os: macos-12 + openfoam-git-branch: develop + deps-kind: standalone fail-fast: false uses: ./.github/workflows/build-test.yml with: + build-os: ${{ matrix.build-os }} app-name: OpenFOAM-${{ matrix.openfoam-git-branch }} app-version: ${{ matrix.openfoam-git-branch }} openfoam-git-branch: ${{ matrix.openfoam-git-branch }} - build-os: ${{ inputs.build-os }} - deps-kind: ${{ inputs.deps-kind }} + deps-kind: ${{ matrix.deps-kind }} use-cached: false cache-build: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b690c45..a55a92a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,12 +18,7 @@ jobs: release: needs: get-version - strategy: - matrix: - openfoam-version: [2312, 2306] - fail-fast: false - uses: ./.github/workflows/build-test.yml + uses: ./.github/workflows/ci.yml with: - openfoam-version: ${{ matrix.openfoam-version }} app-version: ${{ needs.get-version.outputs.app-version }} release: true From ad6e054da2666e7c48e2822d8fc053cd76125d23 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Thu, 1 Feb 2024 13:27:57 -0300 Subject: [PATCH 14/29] Update default dependency bundling --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7ca8650..c909db1 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ OPENFOAM_GIT_REPO_URL = https://develop.openfoam.com/Development/openfoam.git OPENFOAM_GIT_BRANCH = VOLUME_FILESYSTEM = 'Case-sensitive APFS' WMAKE_NJOBS = -DEPS_KIND = standalone +DEPS_KIND = bundled DMG_FORMAT = UDRO APP_HOMEPAGE = https://github.com/gerlero/openfoam-app APP_VERSION = From 5aee72a4d7d573851ba47d8c7224ddf9b8259e86 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Thu, 1 Feb 2024 15:27:45 -0300 Subject: [PATCH 15/29] Fix build workflow --- .github/workflows/build-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 2355781..d380628 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -178,7 +178,7 @@ jobs: - name: Upload app artifact uses: actions/upload-artifact@v4 with: - name: app-${{ env.OPENFOAM }} + name: app-${{ env.OPENFOAM }}-${{ runner.arch }} path: build/*-app-*.zip if-no-files-found: error @@ -199,7 +199,7 @@ jobs: - name: Download app artifact uses: actions/download-artifact@v4 with: - name: app-${{ env.OPENFOAM }} + name: app-${{ env.OPENFOAM }}-${{ needs.build.outputs.arch }} path: build - name: Unzip app run: | From c1921e8a66d796349546c7bf578b928f5c022df9 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Thu, 1 Feb 2024 15:40:59 -0300 Subject: [PATCH 16/29] Use latest Scotch --- Brewfile | 4 +--- scripts/configure.sh | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Brewfile b/Brewfile index 87ae5f7..43847fa 100644 --- a/Brewfile +++ b/Brewfile @@ -1,5 +1,3 @@ -tap "gerlero/openfoam" - # Required dependencies brew "open-mpi" brew "libomp" @@ -10,7 +8,7 @@ brew "cgal" brew "fftw" brew "kahip" brew "metis" -brew "gerlero/openfoam/scotch-no-pthread" +brew "scotch" # Optional dependencies (uncomment to enable) # brew "adios2" diff --git a/scripts/configure.sh b/scripts/configure.sh index 3e12754..ab8afd1 100755 --- a/scripts/configure.sh +++ b/scripts/configure.sh @@ -13,7 +13,7 @@ bin/tools/foamConfigurePaths \ -fftw-path '$WM_PROJECT_DIR/usr/opt/fftw' \ -kahip-path '$WM_PROJECT_DIR/usr/opt/kahip' \ -metis-path '$WM_PROJECT_DIR/usr/opt/metis' \ - -scotch-path '$WM_PROJECT_DIR/usr/opt/scotch-no-pthread' + -scotch-path '$WM_PROJECT_DIR/usr/opt/scotch' # Set path to the MPI install From 52aabb8f95c01c8889c5d9ac3136ed4f489de308 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Fri, 2 Feb 2024 11:17:23 -0300 Subject: [PATCH 17/29] Update workflows --- .github/workflows/openfoam-dev-branches.yml | 27 ++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/openfoam-dev-branches.yml b/.github/workflows/openfoam-dev-branches.yml index 392f239..1b9e1e1 100644 --- a/.github/workflows/openfoam-dev-branches.yml +++ b/.github/workflows/openfoam-dev-branches.yml @@ -4,24 +4,23 @@ on: schedule: - cron: '0 6 * * 5' workflow_dispatch: + inputs: + deps-kind: + type: choice + required: false + description: Bundle dependencies in this manner + options: + - '' + - standalone + - bundled + - homebrew jobs: openfoam-dev-branch: strategy: matrix: - include: - - build-os: macos-14 - openfoam-git-branch: master - deps-kind: bundled - - build-os: macos-12 - openfoam-git-branch: master - deps-kind: standalone - - build-os: macos-14 - openfoam-git-branch: develop - deps-kind: bundled - - build-os: macos-12 - openfoam-git-branch: develop - deps-kind: standalone + build-os: [macos-14, macos-12] + openfoam-git-branch: [master, develop] fail-fast: false uses: ./.github/workflows/build-test.yml with: @@ -29,6 +28,6 @@ jobs: app-name: OpenFOAM-${{ matrix.openfoam-git-branch }} app-version: ${{ matrix.openfoam-git-branch }} openfoam-git-branch: ${{ matrix.openfoam-git-branch }} - deps-kind: ${{ matrix.deps-kind }} + deps-kind: ${{ inputs.deps-kind }} use-cached: false cache-build: false From 91d93b1e21b25eaad977570720e09317b50594db Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Sat, 3 Feb 2024 23:38:39 -0300 Subject: [PATCH 18/29] Update build workflow --- .github/workflows/build-test.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index d380628..ca754d8 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -3,6 +3,9 @@ name: Build and test on: workflow_call: inputs: + build-os: + type: string + required: true openfoam-version: type: string default: '' @@ -23,10 +26,6 @@ on: type: string default: '' required: false - build-os: - type: string - default: '' - required: false use-cached: type: boolean default: true @@ -42,9 +41,14 @@ on: workflow_dispatch: inputs: build-os: - type: string + type: choice required: true description: Build using this macOS image + options: + - macos-14 + - macos-13 + - macos-12 + - macos-11 openfoam-version: type: string default: '' @@ -97,6 +101,8 @@ jobs: deps-restore-key: ${{ steps.caching.outputs.DEPS_RESTORE_KEY }} build-restore-key: ${{ steps.caching.outputs.BUILD_RESTORE_KEY }} steps: + - name: Use Xcode Command Line Tools + run: sudo xcode-select --switch /Library/Developer/CommandLineTools - name: Checkout uses: actions/checkout@v4 - name: Get Make recipes for caching @@ -106,7 +112,7 @@ jobs: - name: Generate cache restore keys id: caching run: | - DEPS_RESTORE_KEY="build-${{ env.OPENFOAM }}-${{ inputs.build-os }}-${{ inputs.deps-kind }}-${{ hashFiles('make_deps.txt', 'Brewfile', 'scripts/bundle_deps.py') }}" + DEPS_RESTORE_KEY="build-${{ env.OPENFOAM }}-${{ inputs.build-os }}-${{ hashFiles('make_deps.txt', 'Brewfile', 'scripts/bundle_deps.py') }}" BUILD_RESTORE_KEY="$DEPS_RESTORE_KEY-${{ hashFiles('make_build.txt', 'scripts/configure.sh', 'scripts/relativize_install_names.py') }}" echo "DEPS_RESTORE_KEY=$DEPS_RESTORE_KEY" >> "$GITHUB_OUTPUT" echo "BUILD_RESTORE_KEY=$BUILD_RESTORE_KEY" >> "$GITHUB_OUTPUT" @@ -137,6 +143,8 @@ jobs: outputs: arch: ${{ runner.arch }} steps: + - name: Use Xcode Command Line Tools + run: sudo xcode-select --switch /Library/Developer/CommandLineTools - name: Checkout uses: actions/checkout@v4 - name: Restore cached build if available @@ -190,6 +198,8 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} steps: + - name: Use Xcode Command Line Tools + run: sudo xcode-select --switch /Library/Developer/CommandLineTools - name: Checkout uses: actions/checkout@v4 - name: Install Homebrew dependencies From 232d10e67ef2573be905bd10dbc1f2455a39bea5 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Sun, 4 Feb 2024 10:09:25 -0300 Subject: [PATCH 19/29] Revert "Update default dependency bundling" --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c909db1..7ca8650 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ OPENFOAM_GIT_REPO_URL = https://develop.openfoam.com/Development/openfoam.git OPENFOAM_GIT_BRANCH = VOLUME_FILESYSTEM = 'Case-sensitive APFS' WMAKE_NJOBS = -DEPS_KIND = bundled +DEPS_KIND = standalone DMG_FORMAT = UDRO APP_HOMEPAGE = https://github.com/gerlero/openfoam-app APP_VERSION = From 8e11fc8e21b9303b80e200416a69742798dd1f70 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Mon, 5 Feb 2024 09:05:29 -0300 Subject: [PATCH 20/29] Update build workflow --- .github/workflows/build-test.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index ca754d8..e30fcf7 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -140,8 +140,6 @@ jobs: build: needs: deps runs-on: ${{ inputs.build-os }} - outputs: - arch: ${{ runner.arch }} steps: - name: Use Xcode Command Line Tools run: sudo xcode-select --switch /Library/Developer/CommandLineTools @@ -195,11 +193,13 @@ jobs: strategy: matrix: os: [macos-12, macos-13, macos-14] + exclude: + - os: ${{ inputs.build-os == 'macos-14' && 'macos-12' || ''}} + - os: ${{ inputs.build-os == 'macos-14' && 'macos-13' || ''}} + - os: ${{ inputs.build-os != 'macos-14' && 'macos-14' || ''}} fail-fast: false runs-on: ${{ matrix.os }} steps: - - name: Use Xcode Command Line Tools - run: sudo xcode-select --switch /Library/Developer/CommandLineTools - name: Checkout uses: actions/checkout@v4 - name: Install Homebrew dependencies @@ -209,14 +209,13 @@ jobs: - name: Download app artifact uses: actions/download-artifact@v4 with: - name: app-${{ env.OPENFOAM }}-${{ needs.build.outputs.arch }} + name: app-${{ env.OPENFOAM }}-${{ runner.arch }} path: build - name: Unzip app run: | unzip *-app-*.zip working-directory: build - name: Test - if: needs.build.outputs.arch == runner.arch run: | make test ${{ env.MAKE_VARS }} From af40ca4a9b05318af5205d826769bedf8f75d809 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Mon, 5 Feb 2024 22:06:58 -0300 Subject: [PATCH 21/29] Update tests --- scripts/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test.sh b/scripts/test.sh index 5ba3484..2010c5f 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -10,7 +10,7 @@ cd .. rm -rf flange cp -r "$FOAM_TUTORIALS/basic/laplacianFoam/flange" flange cd flange -OMPI_MCA_rmaps_base_oversubscribe=1 ./Allrun-parallel +PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe ./Allrun-parallel reconstructPar cd .. From 2154793cde3c8457c09a2e198a4e10b429b1f0bb Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Mon, 5 Feb 2024 22:01:18 -0300 Subject: [PATCH 22/29] Update Makefile --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 7ca8650..781af90 100644 --- a/Makefile +++ b/Makefile @@ -108,6 +108,7 @@ build/$(APP_NAME).app/Contents/%: Contents/% build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg: $(VOLUME)/platforms Contents/Resources/icon.icns [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) + rm -f build/$(APP_NAME)-build.sparsebundle.shadow hdiutil attach \ build/$(APP_NAME)-build.sparsebundle \ -shadow From e4b54458c232e08cd296b10ff4b3343db6404bb0 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Mon, 5 Feb 2024 23:51:10 -0300 Subject: [PATCH 23/29] Update CI workflow --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b7dd97..ef4a5cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,5 +54,6 @@ jobs: build-os: ${{ matrix.build-os }} deps-kind: ${{ inputs.deps-kind }} app-version: ${{ github.event_name == 'workflow_call' && inputs.app-version || '' }} + release: ${{ github.event_name == 'workflow_call' && inputs.release || false }} use-cached: ${{ github.event_name == 'workflow_dispatch' && inputs.use-cached || github.event_name != 'workflow_dispatch' && github.event_name != 'schedule' }} cache-build: ${{ github.event_name != 'workflow_dispatch' && inputs.cache-build || github.event_name != 'workflow_dispatch' }} From cfdbc57cdaa525b2230fea229d55966eb6a3130d Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Tue, 6 Feb 2024 13:43:18 -0300 Subject: [PATCH 24/29] Update CI workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef4a5cb..b607066 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,6 @@ jobs: build-os: ${{ matrix.build-os }} deps-kind: ${{ inputs.deps-kind }} app-version: ${{ github.event_name == 'workflow_call' && inputs.app-version || '' }} - release: ${{ github.event_name == 'workflow_call' && inputs.release || false }} + release: ${{ github.event_name == 'workflow_call' && inputs.release }} use-cached: ${{ github.event_name == 'workflow_dispatch' && inputs.use-cached || github.event_name != 'workflow_dispatch' && github.event_name != 'schedule' }} cache-build: ${{ github.event_name != 'workflow_dispatch' && inputs.cache-build || github.event_name != 'workflow_dispatch' }} From e725e42ef3807cc7d018e40d2e5e955b14768f05 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Tue, 6 Feb 2024 13:56:11 -0300 Subject: [PATCH 25/29] Update workflows --- .github/workflows/ci.yml | 12 ------------ .github/workflows/release.yml | 9 ++++++++- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b607066..746b12e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,16 +9,6 @@ on: - main schedule: - cron: '0 6 * * 5' - workflow_call: - inputs: - app-version: - type: string - default: '' - required: false - release: - type: boolean - default: false - required: false workflow_dispatch: inputs: use-cached: @@ -53,7 +43,5 @@ jobs: openfoam-version: ${{ matrix.openfoam-version }} build-os: ${{ matrix.build-os }} deps-kind: ${{ inputs.deps-kind }} - app-version: ${{ github.event_name == 'workflow_call' && inputs.app-version || '' }} - release: ${{ github.event_name == 'workflow_call' && inputs.release }} use-cached: ${{ github.event_name == 'workflow_dispatch' && inputs.use-cached || github.event_name != 'workflow_dispatch' && github.event_name != 'schedule' }} cache-build: ${{ github.event_name != 'workflow_dispatch' && inputs.cache-build || github.event_name != 'workflow_dispatch' }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a55a92a..c5489d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,14 @@ jobs: release: needs: get-version - uses: ./.github/workflows/ci.yml + strategy: + matrix: + build-os: [macos-14, macos-12] + openfoam-version: [2312, 2306] + fail-fast: false + uses: ./.github/workflows/build-test.yml with: + openfoam-version: ${{ matrix.openfoam-version }} + build-os: ${{ matrix.build-os }} app-version: ${{ needs.get-version.outputs.app-version }} release: true From af64e9f9c3003c0bdbf75e41c31e91cab87a7aba Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Tue, 6 Feb 2024 14:19:25 -0300 Subject: [PATCH 26/29] Update configure.sh --- scripts/configure.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/configure.sh b/scripts/configure.sh index ab8afd1..1c92e47 100755 --- a/scripts/configure.sh +++ b/scripts/configure.sh @@ -115,7 +115,7 @@ EOF # Workaround for https://develop.openfoam.com/Development/openfoam/-/issues/3066 -[ $(bin/foamEtcFile -show-api) -lt 2312 ] || sed -i '' 's|max(len,|max(label(len),|' src/OpenFOAM/db/IOstreams/memory/memoryStreamBuffer.H +[ $(bin/foamEtcFile -show-api) -ne 2312 ] || sed -i '' 's|max(len,|max(label(len),|' src/OpenFOAM/db/IOstreams/memory/memoryStreamBuffer.H # Workaround for https://develop.openfoam.com/Development/openfoam/-/issues/2958 From 8a60bdbf27a9ee7013eab55f8c4630ba308ca593 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Wed, 7 Feb 2024 06:29:59 -0300 Subject: [PATCH 27/29] Update workflows --- .github/workflows/build-test.yml | 22 ---------------------- .github/workflows/release.yml | 24 ++++++++++++++++++++++-- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e30fcf7..a6c2fbf 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -34,10 +34,6 @@ on: type: boolean default: true required: false - release: - type: boolean - default: false - required: false workflow_dispatch: inputs: build-os: @@ -218,21 +214,3 @@ jobs: - name: Test run: | make test ${{ env.MAKE_VARS }} - - release: - needs: test - if: inputs.release - runs-on: ubuntu-latest - steps: - - name: Download app artifact - uses: actions/download-artifact@v4 - with: - name: app-${{ env.OPENFOAM }} - - name: Upload app to release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: '*-app-*.zip' - tag: ${{ github.ref }} - file_glob: true - overwrite: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5489d2..5fc1da9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: run: echo "VERSION_WITHOUT_V=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT" - release: + build: needs: get-version strategy: matrix: @@ -28,4 +28,24 @@ jobs: openfoam-version: ${{ matrix.openfoam-version }} build-os: ${{ matrix.build-os }} app-version: ${{ needs.get-version.outputs.app-version }} - release: true + + release: + needs: build + strategy: + matrix: + arch: [ARM64, x64] + openfoam-version: [2312, 2306] + runs-on: ubuntu-latest + steps: + - name: Download app artifact + uses: actions/download-artifact@v4 + with: + name: app-${{ matrix.openfoam-version }}-${{ matrix.arch }} + - name: Upload app to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: '*-app-*.zip' + tag: ${{ github.ref }} + file_glob: true + overwrite: false From 163c7a2459f8c934ace272537bc19f7f8de1a4fb Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Wed, 7 Feb 2024 08:41:48 -0300 Subject: [PATCH 28/29] Fix Release workflow --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fc1da9..2cd3d65 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: needs: build strategy: matrix: - arch: [ARM64, x64] + arch: [ARM64, X64] openfoam-version: [2312, 2306] runs-on: ubuntu-latest steps: From 48de393f88eb796df88730f3e938de6a4db8fe31 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Thu, 8 Feb 2024 11:58:26 -0300 Subject: [PATCH 29/29] Backport fix for #235 --- scripts/configure.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/configure.sh b/scripts/configure.sh index 1c92e47..edcb790 100755 --- a/scripts/configure.sh +++ b/scripts/configure.sh @@ -121,3 +121,8 @@ EOF # Workaround for https://develop.openfoam.com/Development/openfoam/-/issues/2958 [ $(uname -m) != 'arm64' ] || sed -i '' 's|-ftrapping-math|-ftrapping-math -ffp-contract=off|' wmake/rules/darwin64Clang/c [ $(uname -m) != 'arm64' ] || sed -i '' 's|-ftrapping-math|-ftrapping-math -ffp-contract=off|' wmake/rules/darwin64Clang/c++ + + +# Backport of https://develop.openfoam.com/Development/openfoam/-/issues/3098 +[ $(bin/foamEtcFile -show-api) -gt 2312 ] || sed -i '' 's|_foamAddLib "$FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN"|_foamAddLib "$FOAM_SITE_LIBBIN"\n_foamAddLib "$FOAM_USER_LIBBIN"|' etc/config.sh/setup +[ $(bin/foamEtcFile -show-api) -gt 2312 ] || sed -i '' 's|_foamAddLib "$FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN"|_foamAddLib "$FOAM_SITE_LIBBIN"\n_foamAddLib "$FOAM_USER_LIBBIN"|' etc/config.csh/setup