Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make test error on macos #16356

Closed
flexsurfer opened this issue Jun 22, 2023 · 13 comments · Fixed by #16359
Closed

make test error on macos #16356

flexsurfer opened this issue Jun 22, 2023 · 13 comments · Fixed by #16359
Assignees
Labels

Comments

@flexsurfer
Copy link
Member

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make[1]: Entering directory '/Users/andrey/Dev/status-react/build'
  CXX(target) Release/obj.target/status_nodejs_addon/modules/react-native-status/nodejs/status.o
../modules/react-native-status/nodejs/status.cpp:1169:11: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
          func->Call(isolate->GetCurrentContext(), v8::Null(isolate), argc, argv);
          ^~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
  SOLINK_MODULE(target) Release/status_nodejs_addon.node
ld: framework not found IOKit
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [status_nodejs_addon.target.mk:175: Release/status_nodejs_addon.node] Error 1
make[1]: Leaving directory '/Users/andrey/Dev/status-react/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/nix/store/4d4sar5gv82d7wn96lq1ddxq3vxfh7h1-nodejs-18.16.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 22.5.0
gyp ERR! command "/nix/store/4d4sar5gv82d7wn96lq1ddxq3vxfh7h1-nodejs-18.16.0/bin/node" "/nix/store/4d4sar5gv82d7wn96lq1ddxq3vxfh7h1-nodejs-18.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/andrey/Dev/status-react
gyp ERR! node -v v18.16.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok 
error Command failed with exit code 1.
@yakimant
Copy link
Member

yakimant commented Jun 22, 2023

Confirm the issue on macOS and it's relation to #14944.

Probably we need to add darwin.apple_sdk.frameworks to clojure shell.
Don't know, how it ran before, as gyp requires the following:

["OS=='mac'", {
"libraries": [
"-framework IOKit",
"-framework CoreFoundation",
"-framework CoreServices",
"-framework Security"
]
}]

make test also runs Software Install every time.

@yakimant
Copy link
Member

Adding darwin.apple_sdk.frameworks helps, will make a PR.

@yakimant
Copy link
Member

"The “gcc” command requires the command line developer tools. Would you like to install the tools now?”" still show up on every run.

@yakimant
Copy link
Member

yakimant commented Jun 22, 2023

gcc issue comes from yarn install, gyp dtrace-provider:

gcc -O2 -Wall -arch i386   -c -o usdt.o usdt.c
gcc: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk' (errno=No such file or directory)
gcc: error: sh -c '/Applications/Xcode-14.3.1.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -find gcc 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcode-select: Failed to locate 'gcc', requesting installation of command line developer tools.

It looks for MacOSX10.15.sdk, but I have MacOSX13.3.sdk and MacOSX13.sdk linking to MacOSX.sdk

This problem doesn't fail the dtrace-provider build though:

make[1]: Entering directory '/Users/status/work/status-mobile/node_modules/dtrace-provider/build'
  ACTION binding_gyp_ndtp_target_build_ndtp .
-----------------------------------------------------------------
Building dtrace-provider failed with exit code 2, falling back
on stub implementation.

Re-run install with V set in your environment to see the build
output, or NODE_DTRACE_PROVIDER_REQUIRE=hard to force an
installation failure.

Is it a problem for us?

@jakubgs
Copy link
Member

jakubgs commented Jun 22, 2023

I wonder if this dtrace-provicer which is pulled in by detox which is used by the run-visual-test-ios target:

status-mobile/Makefile

Lines 347 to 352 in 7260c23

run-visual-test-ios: export TARGET := clojure
run-visual-test-ios: XCODE_DERIVED_DATA := $(HOME)/Library/Developer/Xcode/DerivedData
run-visual-test-ios: APPLICATION_NAME := StatusIm-brfnruzfrkkycpbndmdoeyrigthc
run-visual-test-ios: export TEST_BINARY_PATH := $(XCODE_DERIVED_DATA)/$(APPLICATION_NAME)/Build/Products/Debug-iphonesimulator/StatusIm.app
run-visual-test-ios: ##@test Run tests once in NodeJS
detox test --configuration ios.sim.debug

I wonder if this is still being used for anything, or if it's part of the old app.

@jakubgs
Copy link
Member

jakubgs commented Jun 22, 2023

Not sure if related but I found this: https://developer.apple.com/forums/thread/716814

Which suggests this might be related to env variables. But your find of the patch for NodeJS in nixpkgs might be the reason.

@yakimant
Copy link
Member

Maybe we should enforce dtrace-provider in the future if needed:
https://github.com/chrisa/node-dtrace-provider#troubleshooting-build-issues

@yakimant
Copy link
Member

Checked before the upgrade - dtrace-provider was failing too, but with different error:

  CXX(target) Release/obj.target/clojure/dtrace_provider.o
../dtrace_provider.cc:35:13: error: no matching member function for call to 'Set'
    target->Set(Nan::New<String>(\"DTraceProvider\").ToLocalChecked(), Nan::GetFunction(t).ToLocalChecked());
    ~~~~~~~~^~~
/Users/status/Library/Caches/node-gyp/18.9.1/include/node/v8-object.h:244:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/status/Library/Caches/node-gyp/18.9.1/include/node/v8-object.h:247:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
../dtrace_provider.cc:94:10: error: no matching member function for call to 'Set'
    obj->Set(Nan::To<v8::String>(info[0]).ToLocalChecked(), pd);
    ~~~~~^~~
/Users/status/Library/Caches/node-gyp/18.9.1/include/node/v8-object.h:244:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/status/Library/Caches/node-gyp/18.9.1/include/node/v8-object.h:247:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,

Maybe related: chrisa/node-dtrace-provider#132

@yakimant
Copy link
Member

@erikseppanen, @J-Son89, can we remove dependency to detox temporary?
Looks like visual tests added in #14329 are not running and dtrace-provider, detox dependency has build issues.

@J-Son89
Copy link
Contributor

J-Son89 commented Jun 23, 2023

@yakimant - no problem. that work to add visual tests has been delayed due to some CI complications. Let me know if you need any help removing this. 👍

@yakimant
Copy link
Member

yakimant commented Jun 23, 2023

Removing patch
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/web/nodejs/bypass-darwin-xcrun-node16.patch
from nodejs helped with Failed to locate 'gcc' issue.

This nixpkgs PR introduced the issue: NixOS/nixpkgs#193759

@yakimant
Copy link
Member

yakimant commented Jun 23, 2023

Removing detox for now: #16372

Please take into account NODE_DTRACE_PROVIDER_REQUIRE option, when returning it back.

@yakimant
Copy link
Member

Created an issue for nixpkgs to fix the patch causing node-gyp issues on macOS: NixOS/nixpkgs#239371

yakimant added a commit that referenced this issue Jun 26, 2023
After the nixpkgs upgrade we started to have Xcode command line tools installation popup on each make test, dtrace-provider was failing meanwhile: #16356

It appeared, that it was failing before the upgrade with different issue: #16356

dtrace-provider is a dependency for detox, which was added for visiual tests in #14329
These tests don't run.

This build issues didn't cause any problems, because it was not obligatary.
See NODE_DTRACE_PROVIDER_REQUIRE option, which can enforce this requirement.

See #16356 for more details.

In this PR we disable detox dependency for now.
And also Visual Tests.
yakimant added a commit that referenced this issue Jun 26, 2023
After the nixpkgs upgrade we started to have Xcode command line tools installation popup on each make test, dtrace-provider was failing meanwhile: #16356

It appeared, that it was failing before the upgrade with different issue: #16356

dtrace-provider is a dependency for detox, which was added for visiual tests in #14329
These tests don't run.

This build issues didn't cause any problems, because it was not obligatary.
See NODE_DTRACE_PROVIDER_REQUIRE option, which can enforce this requirement.

See #16356 for more details.

In this PR we disable detox dependency for now.
And also Visual Tests.
yakimant added a commit that referenced this issue Jun 26, 2023
After the nixpkgs upgrade we started to have Xcode command line tools installation popup on each make test, dtrace-provider was failing meanwhile: #16356

It appeared, that it was failing before the upgrade with different issue: #16356

dtrace-provider is a dependency for detox, which was added for visiual tests in #14329
These tests don't run.

This build issues didn't cause any problems, because it was not obligatary.
See NODE_DTRACE_PROVIDER_REQUIRE option, which can enforce this requirement.

See #16356 for more details.

In this PR we disable detox dependency for now.
And also Visual Tests.
codemaster115 pushed a commit that referenced this issue Jul 7, 2023
Fixes following error:
```
ld: framework not found IOKit
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [status_nodejs_addon.target.mk:175: Release/status_nodejs_addon.node] Error 1
```
The `make test` target started to fail on macOS after #14944.

This PR adds 2 Apple SDK frameworks to default shell: `IOKit` and `CoreServices`

The other 2 mentioned in `binding.gyp` are not added, but build is ok.

Resolves: #16356

Signed-off-by: Jakub Sokołowski <[email protected]>
codemaster115 pushed a commit that referenced this issue Jul 7, 2023
After the nixpkgs upgrade we started to have Xcode command line tools installation popup on each make test, dtrace-provider was failing meanwhile: #16356

It appeared, that it was failing before the upgrade with different issue: #16356

dtrace-provider is a dependency for detox, which was added for visiual tests in #14329
These tests don't run.

This build issues didn't cause any problems, because it was not obligatary.
See NODE_DTRACE_PROVIDER_REQUIRE option, which can enforce this requirement.

See #16356 for more details.

In this PR we disable detox dependency for now.
And also Visual Tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants