From 3ad345519b534cd4f486e6864d373b31e48e5b96 Mon Sep 17 00:00:00 2001 From: Siddarth Kumar Date: Thu, 7 Dec 2023 15:36:08 +0530 Subject: [PATCH] nix: bump clang to 15 & patch Glog for CC,CXX flag (#18108) After upgrading MacOS to Sonoma and Xcode to 15, pod install stage would fail with clang errors. Turns out that react-native's configure glog script sets 2 additional flags, CC and CXX which conflicts with flags already set in nix iOS shell. In this commit we : - bump clang from 10.0.0 to 15.0.7 - patch glog configure script to avoid setting those flags This fixes the iOS builds. --- nix/deps/nodejs-patched/default.nix | 9 +++++++++ nix/overlay.nix | 1 + 2 files changed, 10 insertions(+) diff --git a/nix/deps/nodejs-patched/default.nix b/nix/deps/nodejs-patched/default.nix index 24577f4a13..84c2f922e7 100644 --- a/nix/deps/nodejs-patched/default.nix +++ b/nix/deps/nodejs-patched/default.nix @@ -14,6 +14,7 @@ stdenv.mkDerivation { "patchJavaPhase" "patchReactNativePhase" "patchPodPhase" + "patchGlogPhase" "installPhase" ]; @@ -98,6 +99,14 @@ stdenv.mkDerivation { '[RCTConvert UIColor:options.tintColor() ? @(*options.tintColor()) : nil];' ''; + # Fix pod issue after upgrading to MacOS Sonoma and Xcode 15 + # https://github.com/status-im/status-mobile/issues/17682 + patchGlogPhase = '' + substituteInPlace ./node_modules/react-native/scripts/ios-configure-glog.sh \ + --replace 'export CC="' '#export CC="' \ + --replace 'export CXX="' '#export CXX="' + ''; + # The ELF types are incompatible with the host platform, so let's not even try # TODO: Use Android NDK to strip binaries manually dontPatchELF = true; diff --git a/nix/overlay.nix b/nix/overlay.nix index 41a8c9b991..1a910c0d55 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -73,6 +73,7 @@ in { allowHigher = true; }; go = super.go_1_19; + clang = super.clang_15; buildGoPackage = super.buildGo119Package; buildGoModule = super.buildGo119Module; gomobile = (super.gomobile.overrideAttrs (old: {