From 66a350eb534aa30bfb89860be6a5c5e00dd3a7ae Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Sat, 8 Aug 2026 17:14:54 -0400 Subject: [PATCH 1/4] test --- scripts/lipo | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/lipo b/scripts/lipo index eea1eea..b27b8f2 100755 --- a/scripts/lipo +++ b/scripts/lipo @@ -1,15 +1,15 @@ #!/bin/sh -# Workaround for NixOS/nixpkgs#405066: frameworks copied from the Nix store -# stay read-only, so lipo can't write its temporary output file when Flutter -# thins them during the build. Make the framework writable before delegating -# to the real lipo. + for arg in "$@"; do case "$arg" in - */*.framework/*) + *.framework/*) fw_dir="${arg%.framework/*}.framework" - chmod -R +w "$fw_dir" 2>/dev/null + chmod -R u+w "$fw_dir" 2>/dev/null + ;; + *.lipo) + chmod u+w "$(dirname "$arg")" 2>/dev/null ;; esac done -exec /usr/bin/lipo "$@" +exec /usr/bin/lipo "$@" \ No newline at end of file From 7eab09585bd1f56425d87c8d9e95cbecee70dbfd Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Sat, 8 Aug 2026 17:51:00 -0400 Subject: [PATCH 2/4] Revert "move lipo wrapper" This reverts commit 56dbd91c963e3684ed2f4c4c21e4d6112d69b044. --- {scripts => ios/scripts}/lipo | 0 macos/scripts/lipo | 15 +++++++++++++++ 2 files changed, 15 insertions(+) rename {scripts => ios/scripts}/lipo (100%) create mode 100755 macos/scripts/lipo diff --git a/scripts/lipo b/ios/scripts/lipo similarity index 100% rename from scripts/lipo rename to ios/scripts/lipo diff --git a/macos/scripts/lipo b/macos/scripts/lipo new file mode 100755 index 0000000..9e32655 --- /dev/null +++ b/macos/scripts/lipo @@ -0,0 +1,15 @@ +#!/bin/sh +# Workaround for NixOS/nixpkgs#405066: frameworks copied from the Nix store +# stay read-only, so lipo can't write its temporary output file when Flutter +# thins FlutterMacOS.framework during the build. Make the framework writable +# before delegating to the real lipo. +for arg in "$@"; do + case "$arg" in + */*.framework/*) + fw_dir="${arg%.framework/*}.framework" + chmod -R +w "$fw_dir" 2>/dev/null + ;; + esac +done + +exec /usr/bin/lipo "$@" From 185c1d2714c1a9eb3faaf4bf22d4f13e693ab914 Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Sat, 8 Aug 2026 17:53:58 -0400 Subject: [PATCH 3/4] undo lipo changes --- ios/Runner.xcodeproj/project.pbxproj | 4 ++-- ios/scripts/lipo | 15 --------------- macos/Runner.xcodeproj/project.pbxproj | 2 +- macos/scripts/lipo | 15 --------------- 4 files changed, 3 insertions(+), 33 deletions(-) delete mode 100755 ios/scripts/lipo delete mode 100755 macos/scripts/lipo diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 57b889d..ddd29ee 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -336,7 +336,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export PATH=\"$PROJECT_DIR/scripts:$PATH\"\n/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + shellScript = "ebin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; @@ -351,7 +351,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export PATH=\"$PROJECT_DIR/scripts:$PATH\"\n/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; EE82EC529EB6C0F1FA480659 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; diff --git a/ios/scripts/lipo b/ios/scripts/lipo deleted file mode 100755 index eea1eea..0000000 --- a/ios/scripts/lipo +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# Workaround for NixOS/nixpkgs#405066: frameworks copied from the Nix store -# stay read-only, so lipo can't write its temporary output file when Flutter -# thins them during the build. Make the framework writable before delegating -# to the real lipo. -for arg in "$@"; do - case "$arg" in - */*.framework/*) - fw_dir="${arg%.framework/*}.framework" - chmod -R +w "$fw_dir" 2>/dev/null - ;; - esac -done - -exec /usr/bin/lipo "$@" diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 3dbb24b..57f7241 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -349,7 +349,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export PATH=\"$PROJECT_DIR/scripts:$PATH\"\necho \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; }; 33CC111E2044C6BF0003C045 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; diff --git a/macos/scripts/lipo b/macos/scripts/lipo deleted file mode 100755 index 9e32655..0000000 --- a/macos/scripts/lipo +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# Workaround for NixOS/nixpkgs#405066: frameworks copied from the Nix store -# stay read-only, so lipo can't write its temporary output file when Flutter -# thins FlutterMacOS.framework during the build. Make the framework writable -# before delegating to the real lipo. -for arg in "$@"; do - case "$arg" in - */*.framework/*) - fw_dir="${arg%.framework/*}.framework" - chmod -R +w "$fw_dir" 2>/dev/null - ;; - esac -done - -exec /usr/bin/lipo "$@" From a5f42fe56e2ba0062690332d079296b57d3efcf4 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Sat, 8 Aug 2026 17:56:01 -0400 Subject: [PATCH 4/4] add workaround for lipo issues with Flutter from Nix on MacOS --- .github/workflows/ios.yml | 12 +++++++++++- .github/workflows/macos.yml | 13 +++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 015cd13..734deb6 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -22,7 +22,17 @@ jobs: extra_nix_config: experimental-features = nix-command flakes flake-self-attrs - name: Build app - run: nix develop --command bash -c "flutter pub get && dart scripts/generate.dart && flutter pub run build_runner build && flutter build ios --release --no-codesign" + run: | + nix develop --command bash -c ' + set -e + flutter pub get + dart scripts/generate.dart + flutter pub run build_runner build + # Nix-provided Flutter'"'"'s bundled frameworks are read-only, which + # breaks lipo when Flutter thins them into build/ (NixOS/nixpkgs#405066). + find "$(dirname "$(dirname "$(readlink -f "$(command -v flutter)")")")" -type d -iname "*.framework" -exec chmod -R u+w {} + 2>/dev/null || true + flutter build ios --release --no-codesign + ' # Unsigned IPA: SideStore/AltStore re-sign this on-device with the # user's own Apple ID at install time, so no certificate is needed here. diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e7040fa..ccbd70e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -21,8 +21,17 @@ jobs: with: extra_nix_config: experimental-features = nix-command flakes flake-self-attrs - - name: Build app - run: nix develop --command bash -c "flutter pub get && dart scripts/generate.dart && flutter pub run build_runner build && flutter build macos --release" + - run: | + nix develop --command bash -c ' + set -e + flutter pub get + dart scripts/generate.dart + flutter pub run build_runner build + # Nix-provided Flutter'"'"'s bundled frameworks are read-only, which + # breaks lipo when Flutter thins them into build/ (NixOS/nixpkgs#405066). + find "$(dirname "$(dirname "$(readlink -f "$(command -v flutter)")")")" -type d -iname "*.framework" -exec chmod -R u+w {} + 2>/dev/null || true + flutter build macos --release + ' - name: Upload installer artifact uses: actions/upload-artifact@v6