From cb9a620f40e554c1e1ac6d55a40e791a855933d2 Mon Sep 17 00:00:00 2001 From: Siddarth Kumar Date: Fri, 10 May 2024 17:58:49 +0530 Subject: [PATCH] fix: hack fix for contract tests on MacOS (#19965) fixes #19802 Contract Tests are failing with missing symbols runtime error on `MacOS` after `golang` version was upgraded to 1.20 A simple hack fix such a case is to use `go 1.19` only to build the status-go library that is used specifically for these integration tests. Its ugly but it works and unblocks devs from running tests locally. - execute `make test-contract` on MacOS and it should not fail. not needed since this impacts only the integration tests. - macOS status: ready --- modules/react-native-status/nodejs/status.cpp | 8 ++++++-- nix/status-go/library/default.nix | 11 ++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/react-native-status/nodejs/status.cpp b/modules/react-native-status/nodejs/status.cpp index 35222390e0..620d77032c 100644 --- a/modules/react-native-status/nodejs/status.cpp +++ b/modules/react-native-status/nodejs/status.cpp @@ -1,5 +1,9 @@ -// DO NOT EDIT: code is autogenerated by go2nodebinding from Go code. -// https://github.com/divan/go2nodebinding +// This code has pieces that were autogenerated but is now managed manually +// Here lies the node bindings used for integration tests +// These are basically C calls to exported status-go functions +// Along 1 additional Poll function to get signals to work +// function names registered here in init() are used in various places +// ref -> status-mobile/src/tests/test_utils.cljs #include #include diff --git a/nix/status-go/library/default.nix b/nix/status-go/library/default.nix index 5fa833f923..3a49a98a78 100644 --- a/nix/status-go/library/default.nix +++ b/nix/status-go/library/default.nix @@ -1,8 +1,9 @@ -{ buildGoPackage -# object with source attributes -, meta, source}: - -buildGoPackage { +{ stdenv, meta, source, buildGo119Package, buildGo120Package }: +let + # https://github.com/status-im/status-mobile/issues/19802 + # only for Darwin to fix Integration Tests failing with missing symbols on go 1.20 + buildGoPackageIntegrationTest = if stdenv.isDarwin then buildGo119Package else buildGo120Package; +in buildGoPackageIntegrationTest { pname = source.repo; version = "${source.cleanVersion}-${source.shortRev}";