Skip to content

Commit ce611f6

Browse files
jappeace-slothclaude
andcommitted
Fix ios.nix header filename and bundle assets in simulator test
The nix path expression ${../include/HaskellMobile.h} evaluates to a store path like /nix/store/HASH-HaskellMobile.h. When cp'd to a directory, the hash prefix is preserved in the filename, so the file ended up as HASH-HaskellMobile.h instead of HaskellMobile.h. Fix by explicitly naming the destination file in ios.nix. Also bundle the library and header directly into the simulator test derivation at build time for a self-contained output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d9ffdc4 commit ce611f6

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎nix/ios.nix‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ in pkgs.stdenv.mkDerivation {
4949
mkdir -p $out/lib $out/include
5050
${mac2ios}/bin/mac2ios ${if simulator then "-s" else ""} libHaskellMobile.a
5151
cp libHaskellMobile.a $out/lib/
52-
cp ${../include/HaskellMobile.h} $out/include/
52+
cp ${../include/HaskellMobile.h} $out/include/HaskellMobile.h
5353
'';
5454
}

‎nix/simulator.nix‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ in pkgs.stdenv.mkDerivation {
2222
dontUnpack = true;
2323

2424
buildPhase = ''
25-
mkdir -p $out/bin $out/share/ios
25+
mkdir -p $out/bin $out/share/ios/lib $out/share/ios/include
2626
27-
# Bundle the iOS Swift sources and project config so the test script
28-
# can stage a complete Xcode project without depending on the repo checkout.
27+
# Bundle everything the test script needs: Swift sources, project config,
28+
# and the pre-built simulator library + header.
2929
cp -r ${../ios}/HaskellMobile $out/share/ios/
3030
cp ${../ios/project.yml} $out/share/ios/project.yml
31+
cp ${iosLib}/lib/libHaskellMobile.a $out/share/ios/lib/
32+
cp ${iosLib}/include/HaskellMobile.h $out/share/ios/include/
3133
3234
cat > $out/bin/test-lifecycle-ios << 'SCRIPT'
3335
#!/usr/bin/env bash
@@ -37,7 +39,6 @@ set -euo pipefail
3739
BUNDLE_ID="me.jappie.haskellmobile"
3840
SCHEME="HaskellMobile"
3941
DEVICE_TYPE="iPhone 16"
40-
IOS_LIB="${iosLib}"
4142
SHARE_DIR="$(cd "$(dirname "$0")/../share/ios" && pwd)"
4243
4344
# --- Temp working directory ---
@@ -64,8 +65,8 @@ echo "Working directory: $WORK_DIR"
6465
# --- Stage library and sources ---
6566
echo "=== Staging Xcode project ==="
6667
mkdir -p "$WORK_DIR/ios/lib" "$WORK_DIR/ios/include"
67-
cp "$IOS_LIB/lib/libHaskellMobile.a" "$WORK_DIR/ios/lib/"
68-
cp "$IOS_LIB/include/HaskellMobile.h" "$WORK_DIR/ios/include/"
68+
cp "$SHARE_DIR/lib/libHaskellMobile.a" "$WORK_DIR/ios/lib/"
69+
cp "$SHARE_DIR/include/HaskellMobile.h" "$WORK_DIR/ios/include/"
6970
cp -r "$SHARE_DIR/HaskellMobile" "$WORK_DIR/ios/"
7071
cp "$SHARE_DIR/project.yml" "$WORK_DIR/ios/"
7172

0 commit comments

Comments
 (0)