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

ci: use python:3.10 and run npm ci on PRs #1560

Merged
merged 6 commits into from
Jan 8, 2025

Conversation

v1v
Copy link
Member

@v1v v1v commented Jan 7, 2025

According to actions/runner-images#10636, it's not using ubuntu-22 but ubuntu-24

Therefore, the release is not working anymore and it fails with

npm error code 127
npm error path /home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/fibers
npm error command failed
npm error command sh -c node build.js || nodejs build.js
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | linux | x64
npm error gyp info find Python using Python version 3.12.3 found at "/usr/bin/python"
npm error gyp http GET https://nodejs.org/download/release/v18.20.5/node-v18.20.5-headers.tar.gz
npm error gyp http 200 https://nodejs.org/download/release/v18.20.5/node-v18.20.5-headers.tar.gz
npm error gyp http GET https://nodejs.org/download/release/v18.20.5/SHASUMS256.txt
npm error gyp http 200 https://nodejs.org/download/release/v18.20.5/SHASUMS256.txt
npm error (node:2275) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm error (Use `node --trace-deprecation ...` to show where the warning was created)
npm error gyp info spawn /usr/bin/python
npm error gyp info spawn args [
npm error gyp info spawn args   '/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args   'binding.gyp',
npm error gyp info spawn args   '-f',
npm error gyp info spawn args   'make',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/fibers/build/config.gypi',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args   '-I',
npm error gyp info spawn args   '/home/runner/.cache/node-gyp/18.20.5/include/node/common.gypi',
npm error gyp info spawn args   '-Dlibrary=shared_library',
npm error gyp info spawn args   '-Dvisibility=default',
npm error gyp info spawn args   '-Dnode_root_dir=/home/runner/.cache/node-gyp/18.20.5',
npm error gyp info spawn args   '-Dnode_gyp_dir=/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp',
npm error gyp info spawn args   '-Dnode_lib_file=/home/runner/.cache/node-gyp/18.20.5/<(target_arch)/node.lib',
npm error gyp info spawn args   '-Dmodule_root_dir=/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/fibers',
npm error gyp info spawn args   '-Dnode_engine=v8',
npm error gyp info spawn args   '--depth=.',
npm error gyp info spawn args   '--no-parallel',
npm error gyp info spawn args   '--generator-output',
npm error gyp info spawn args   'build',
npm error gyp info spawn args   '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error Traceback (most recent call last):
npm error   File "/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
npm error     sys.exit(gyp.script_main())
npm error              ^^^^^^^^^^^^^^^^^
npm error   File "/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
npm error     return main(sys.argv[1:])
npm error            ^^^^^^^^^^^^^^^^^^
npm error   File "/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
npm error     return gyp_main(args)
npm error            ^^^^^^^^^^^^^^
npm error   File "/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 520, in gyp_main
npm error     [generator, flat_list, targets, data] = Load(
npm error                                             ^^^^^
npm error   File "/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 136, in Load
npm error     result = gyp.input.Load(build_files, default_variables, includes[:],
npm error              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm error   File "/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2782, in Load
npm error     LoadTargetBuildFile(build_file, data, aux_data,
npm error   File "/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile
npm error     build_file_data = LoadOneBuildFile(build_file_path, data, aux_data,
npm error                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm error   File "/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 234, in LoadOneBuildFile
npm error     build_file_contents = open(build_file_path, 'rU').read()
npm error                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm error ValueError: invalid mode: 'rU' while trying to load binding.gyp
npm error gyp ERR! configure error 
npm error gyp ERR! stack Error: `gyp` failed with exit code: 1
npm error gyp ERR! stack     at ChildProcess.onCpExit (/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/node-gyp/lib/configure.js:351:16)
npm error gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
npm error gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm error gyp ERR! System Linux 6.8.0-1017-azure
npm error gyp ERR! command "/opt/hostedtoolcache/node/18.20.5/x64/bin/node" "/home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/.bin/node-gyp" "rebuild" "--release"
npm error gyp ERR! cwd /home/runner/work/apm-agent-rum-js/apm-agent-rum-js/node_modules/fibers
npm error gyp ERR! node -v v18.20.5
npm error gyp ERR! node-gyp -v v5.1.1
npm error gyp ERR! not ok 
npm error node-gyp exited with code: 1
npm error Please make sure you are using a supported platform and node version. If you
npm error would like to compile fibers on this machine please make sure you have setup your
npm error build environment--
npm error Windows + OS X instructions here: https://github.com/nodejs/node-gyp
npm error Ubuntu users please run: `sudo apt-get install g++ build-essential`
npm error RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'` 
npm error Alpine users please run: `sudo apk add python make g++`
npm error sh: 1: nodejs: not found
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/[202](https://github.com/elastic/apm-agent-rum-js/actions/runs/12643693924/job/35230082388#step:7:203)5-01-07T01_52_42_995Z-debug-0.log

nodejs/node-gyp#2219 is the issue.

And the workaround is pin the version for python to 3.10.

Test

See https://github.com/elastic/apm-agent-rum-js/actions/runs/12647873070 and https://github.com/elastic/apm-agent-rum-js/actions/runs/12648168801

@v1v
Copy link
Member Author

v1v commented Jan 7, 2025

UTs failures

    ✗ should set metadata from config along with defaults
	[object Object] thrown
Chrome Headless 131.0.0.0 (Linux x86_64): Executed 13 of 390 (1 FAILED) (0.173 secs / 0.167 secs)
TOTAL: 1 FAILED, 12 SUCCESS
1) should set metadata from config along with defaults
     ApmServer
     [object Object] thrown
Chrome Headless 131.0.0.0 (Linux x86_64) failed specs:
  ApmServer > should set metadata from config along with defaults
	[object Object] thrown
lerna ERR! npm run test:unit exited 1 in '@elastic/apm-rum-core'
Error: Process completed with exit code 1.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@v1v v1v requested review from a team January 7, 2025 08:52
@v1v v1v changed the title ci: use ubuntu:22 and run npm ci ci: use python:3.10 and run npm ci on PRs Jan 7, 2025
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
Copy link
Member

@vigneshshanmugam vigneshshanmugam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @v1v

@v1v v1v merged commit c972753 into main Jan 8, 2025
16 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants