Fix macOS/iOS CI: chmod needs sudo, Nix store frameworks are root-owned

This commit is contained in:
Erwan Leboucher 2026-08-08 23:53:09 +02:00
commit 12d552e4a6
Signed by: eleboucher
SSH key fingerprint: SHA256:fjyYE6Mo6r2wpEtyYKFfGpX8fmR9bjL0NxWBHosnOgk
9 changed files with 39 additions and 39 deletions

View file

@ -22,7 +22,18 @@ jobs:
extra_nix_config: experimental-features = nix-command flakes flake-self-attrs extra_nix_config: experimental-features = nix-command flakes flake-self-attrs
- name: Build app - 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
FLUTTER_ROOT="$(dirname "$(dirname "$(readlink -f "$(command -v flutter)")")")"
sudo find -L "$FLUTTER_ROOT" -type d -iname "*.framework" -exec chmod -R u+w {} +
flutter build ios --release --no-codesign
'
# Unsigned IPA: SideStore/AltStore re-sign this on-device with the # 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. # user's own Apple ID at install time, so no certificate is needed here.

View file

@ -22,10 +22,21 @@ jobs:
extra_nix_config: experimental-features = nix-command flakes flake-self-attrs extra_nix_config: experimental-features = nix-command flakes flake-self-attrs
- name: Build app - 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
FLUTTER_ROOT="$(dirname "$(dirname "$(readlink -f "$(command -v flutter)")")")"
sudo find -L "$FLUTTER_ROOT" -type d -iname "*.framework" -exec chmod -R u+w {} +
flutter build macos --release
'
- name: Upload installer artifact - name: Upload installer artifact
uses: actions/upload-artifact@v6 uses: actions/upload-artifact@v6
with: with:
name: App name: App
path: build/macos/Build/Products/Release/Nexus.app path: build/macos/Build/Products/Release/Nexus.app

5
.gitignore vendored
View file

@ -41,4 +41,7 @@ key.properties
password.txt password.txt
# Nix # Nix
/result /result
# Local IPA builds
*.ipa

View file

@ -336,7 +336,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; 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 = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
@ -351,7 +351,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; 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 */ = { EE82EC529EB6C0F1FA480659 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;

View file

@ -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 "$@"

View file

@ -234,7 +234,10 @@ class Composer extends HookConsumerWidget {
child: TextField( child: TextField(
maxLines: 12, maxLines: 12,
minLines: 1, minLines: 1,
autofocus: true, autofocus:
Platform.isLinux ||
Platform.isMacOS ||
Platform.isWindows,
decoration: .new( decoration: .new(
hintText: "Your message here...", hintText: "Your message here...",
border: .none, border: .none,

View file

@ -467,6 +467,8 @@ class RoomChat extends HookConsumerWidget {
AsyncData(:final value?) || AsyncData(:final value?) ||
AsyncLoading(:final value?) => CustomScrollView( AsyncLoading(:final value?) => CustomScrollView(
controller: scrollController, controller: scrollController,
keyboardDismissBehavior:
ScrollViewKeyboardDismissBehavior.onDrag,
slivers: [ slivers: [
SliverToBoxAdapter( SliverToBoxAdapter(
child: Padding( child: Padding(

View file

@ -349,7 +349,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; 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 */ = { 33CC111E2044C6BF0003C045 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
@ -369,7 +369,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "export PATH=\"$PROJECT_DIR/scripts:$PATH\"\n\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
}; };
446C82D5FE82BD05F78EDA6A /* [CP] Check Pods Manifest.lock */ = { 446C82D5FE82BD05F78EDA6A /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;

View file

@ -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 "$@"