Skip to content

Commit

Permalink
Bug 1925601 - Fix the iOS build (again)
Browse files Browse the repository at this point in the history
The last hack didn't fix the iOS build.  I looked through xcframework
zip from the nightly build artifacts
(https://firefoxci.taskcluster-artifacts.net/dHGArzP3R0Cmwcr56RPQJA/0/public/build/nightly.json)
and it seems like it was correctly copying the `RustViaductFFI.h` file,
but not correctly updating module.modulemap.

The main issue was the `awk` command was printing out the updated
contents to STDOUT, but not actually modifying `module.modulemap`.  I
fixed that and also moved away from `awk`, since I'm worried about
differences between gawk and nawk.
  • Loading branch information
bendk committed Oct 21, 2024
1 parent 6e93be3 commit 23618bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion megazords/ios-rust/generate-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ CARGO="$HOME/.cargo/bin/cargo"

# Hack to copy in the RustViaductFFI.h (https://bugzilla.mozilla.org/show_bug.cgi?id=1925601)
cp "$THIS_DIR/../../components/viaduct/ios/RustViaductFFI.h" "$COMMON/Headers"
awk '/MozillaRustComponents/ { print; print " header \"RustViaductFFI.h\""; next }1' "$COMMON/Modules/module.modulemap"
echo "original modulemap"
cat "$COMMON/Modules/module.modulemap"
TWEAKED_MODULEMAP=$(cat <(head -n1 "$COMMON/Modules/module.modulemap") <(echo " header \"RustViaductFFI.h\"") <(tail -n +2 "$COMMON/Modules/module.modulemap"))
echo "$TWEAKED_MODULEMAP" > "$COMMON/Modules/module.modulemap"

0 comments on commit 23618bb

Please sign in to comment.