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

Build failure when pulling deps #1113

Open
guyzmo opened this issue Nov 13, 2023 · 2 comments
Open

Build failure when pulling deps #1113

guyzmo opened this issue Nov 13, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@guyzmo
Copy link

guyzmo commented Nov 13, 2023

Bug description

After upgrading expo to SDK-49, it has become impossible to build the application, or at least on linux.
The build passes on macOS instances.

[4/4] Building fresh packages...
warning Error running install script for optional dependency: "/builds/guyzmo/zaas-driver/node_modules/cpu-features: Command failed.
Exit code: 1
Command: node buildcheck.js > buildcheck.gypi && node-gyp rebuild
Arguments: 
Directory: /builds/guyzmo/zaas-driver/node_modules/cpu-features
Output:
/builds/guyzmo/zaas-driver/node_modules/buildcheck/lib/index.js:115
  throw new Error('Unable to detect compiler type');
  ^
Error: Unable to detect compiler type
    at BuildEnvironment.getKind (/builds/guyzmo/zaas-driver/node_modules/buildcheck/lib/index.js:115:9)
    at BuildEnvironment.tryCompile (/builds/guyzmo/zaas-driver/node_modules/buildcheck/lib/index.js:537:15)
    at BuildEnvironment.checkHeader (/builds/guyzmo/zaas-driver/node_modules/buildcheck/lib/index.js:423:25)
    at Object.<anonymous> (/builds/guyzmo/zaas-driver/node_modules/cpu-features/buildcheck.js:16:4)
    at Module._compile (node:internal/modules/cjs/loader:[125](https://gitlab.com/guyzmo/zaas-driver/-/jobs/5525334153#L125)6:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:[131](https://gitlab.com/guyzmo/zaas-driver/-/jobs/5525334153#L131)0:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
    at node:internal/main/run_main_module:23:47
Node.js v18.18.2"
info This module is OPTIONAL, you can safely ignore this error
info This package requires node-gyp, which is not currently installed. Yarn will attempt to automatically install it. If this fails, you can run "yarn global add node-gyp" to manually install it.
error An unexpected error occurred: "/builds/guyzmo/zaas-driver/node_modules/ssh2: Cannot read properties of undefined (reading 'getOption')".
info If you think this is a bug, please open a bug report with the information provided in "/usr/local/share/.config/yarn/global/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[1/4] Resolving packages...
warning Error running install script for optional dependency: "/builds/guyzmo/zaas-driver/node_modules/dtrace-provider: Failed to auto-install node-gyp. Please run \"yarn global add node-gyp\" manually. Error: \"Couldn't find any versions for \\\"node-gyp\\\" that matches \\\"latest\\\" in our cache (possible versions are \\\"\\\"). This is usually caused by a missing entry in the lockfile, running Yarn without the --offline flag may help fix this issue.\""
info This module is OPTIONAL, you can safely ignore this error

N.B.: on CI I run yarn --frozen-lockfile --prefer-offline.

After uninstalling all datadog deps and reinstalling them, the gitlab-ci error above happened again, but the scripts passed for EAS android.

Describe what you expected

a successful build.

Steps to reproduce the issue

setup an expo project and add datadog related stuff:

yarn add expo-datadog @datadog/mobile-react-native @datadog/mobile-react-navigation
yarn add -D  @datadog/datadog-ci

and then, on a linux machine (my CI), just run

yarn

I'm doing it on CI on linux.

Additional context

  • container (ran by gitlab-ci) node:18-alpine
  • node 18.18.2
  • yarn 1.22.19
  • @datadog/datadog-ci@^2.23.1
  • expo-datadog@^49.0.1
  • @datadog/mobile-react-native@^2.0.1
  • @datadog/mobile-react-navigation@^2.0.1

Command

None

@guyzmo guyzmo added the bug Something isn't working label Nov 13, 2023
@louiszawadzki
Copy link
Contributor

Hi @guyzmo, thanks for reaching out!

So far we've not been able to reproduce your issue with a bare Expo 49 repo following your steps.
Could you try to provide us with a minimal reproducible example?

If this is not possible, the error log you provided mentions a Command: node buildcheck.js > buildcheck.gypi && node-gyp rebuild.
Could you include a copy of your buildcheck.js file and anything related to your buildcheck configuration so we can try to replicate it on our end?

Finally, a more complete error log seems to be available at /usr/local/share/.config/yarn/global/yarn-error.log, could you include this as well?

Thanks a lot!

@tamlyn
Copy link

tamlyn commented Jan 9, 2024

We're also seeing this issue. I can't reproduce it with the steps shown above, but here's an alternative minimal repro:

  1. Start a fresh cimg/node:18.18 container
  2. Create a package.json containing:
    {
      "dependencies": {
        "@datadog/mobile-react-native": "^1.8.2",
        "@datadog/mobile-react-navigation": "^1.8.2",
        "expo": "^48.0.0",
        "expo-local-authentication": "~13.3.0",
        "expo-secure-store": "~12.1.1",
        "jest-expo": "^48.0.0",
        "react": "18.2.0",
        "react-native": "0.71.14"
      },
      "devDependencies": {
        "@babel/core": "^7.21.8",
        "@babel/runtime": "^7.21.5",
        "@datadog/datadog-ci": "^2.25.0",
        "@storybook/addon-actions": "^6.5.16",
        "@storybook/addon-controls": "^7.0.22",
        "@storybook/addon-ondevice-actions": "^6.5.7",
        "@storybook/addon-ondevice-controls": "^6.5.7",
        "@storybook/addons": "^7.0.22",
        "@storybook/core-common": "^6.5.16",
        "@storybook/react-native": "^6.5.7",
        "apollo-server-errors": "^3.3.1",
        "babel-jest": "^29.7.0",
        "babel-loader": "^9.0.1",
        "detox": "^20.13.5",
        "jest": "^29.7.0",
        "jest-junit": "^14.0.1",
        "metro-react-native-babel-preset": "^0.73.10",
        "react-dom": "^18.2.0",
        "react-test-renderer": "18.2.0",
        "ts-node": "^10.9.1",
        "typescript": "^5.0.4"
      }
    }
    
  3. Run yarn

The output is a bit confusing as it says both failed and succeeded. But the key issue is that Yarn exits with a non-zero code which is causing our pipeline to fail.

A workaround for the time being is to run yarn global add node-gyp on the container before running yarn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants