diff --git a/scripts/distribution/macOS-package/build.sh b/scripts/distribution/macOS-package/build.sh index 7f9c309fc8..9ad0aee5de 100755 --- a/scripts/distribution/macOS-package/build.sh +++ b/scripts/distribution/macOS-package/build.sh @@ -24,7 +24,7 @@ readonly collectorDir="$macPackageDir/../../../collector" readonly consensusDir="$macPackageDir/../../../concordium-consensus" readonly toolsDir="$macPackageDir/tools" -readonly macdylibbundlerDir="$toolsDir/macdylibbundler-1.0.0" +readonly macdylibbundlerDir="$toolsDir/macdylibbundler-1.0.5" readonly buildDir="$macPackageDir/build" readonly payloadDir="$buildDir/payload" @@ -226,7 +226,7 @@ function getDylibbundler() { logInfo " -- Downloading..." mkdir "$toolsDir" cd "$macPackageDir" - curl -sSL "https://github.com/auriamg/macdylibbundler/archive/refs/tags/1.0.0.zip" > "$toolsDir/dylibbundler.zip" \ + curl -sSL "https://github.com/auriamg/macdylibbundler/archive/refs/tags/1.0.5.zip" > "$toolsDir/dylibbundler.zip" \ && logInfo " -- Unzipping..." \ && cd "$toolsDir" \ && unzip "dylibbundler.zip" \ @@ -248,7 +248,11 @@ function collectDylibs() { local fileToFix=${1:?"Missing file to fix with dylibbundler"}; cd "$payloadDir/Library/Concordium Node" # Paths to search for dylibs are added with the '-s' flag. - "$macdylibbundlerDir/dylibbundler" --fix-file "$fileToFix" --bundle-deps --dest-dir "./libs" --install-path "@executable_path/libs/" --overwrite-dir \ + # We use `--create-dir` to ensure that the `./libs` folder exists. + # But we should not use `--overwrite-dir` even though it implies `--create-dir` + # because it will delete the libs folder if it already exists, which would delete + # the results of previous calls to `collectDylibsFor`. + "$macdylibbundlerDir/dylibbundler" --fix-file "$fileToFix" --bundle-deps --dest-dir "./libs" --install-path "@executable_path/libs/" --create-dir \ -s "$concordiumDylibDir" \ -s "$stackSnapshotDir" \ $stackLibDirs # Unquoted on purpose to use as arguments correctly