Repository navigation
Conversation
tmigone
left a comment
There was a problem hiding this comment.
There is an issue with arm64 when building the images:
28.48 [5/5] Building fresh packages...
30.03 error /opt/indexer/node_modules/@parcel/watcher: Command failed.
30.03 Exit code: 1
30.03 Command: node-gyp-build
30.03 Arguments:
30.03 Directory: /opt/indexer/node_modules/@parcel/watcher
30.03 Output:
30.03 gyp info it worked if it ends with ok
30.03 gyp info using node-gyp@9.4.1
30.03 gyp info using node@22.23.5 | linux | arm64
30.03 (node:77) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
30.03 (Use `node --trace-deprecation ...` to show where the warning was created)
30.03 gyp info find Python using Python version 3.13.5 found at "/usr/bin/python3"
30.03 gyp http GET https://nodejs.org/download/release/v22.23.5/node-v22.23.5-headers.tar.gz
30.03 gyp http 200 https://nodejs.org/download/release/v22.23.5/node-v22.23.5-headers.tar.gz
30.03 gyp http GET https://nodejs.org/download/release/v22.23.5/SHASUMS256.txt
30.03 gyp http 200 https://nodejs.org/download/release/v22.23.5/SHASUMS256.txt
30.03 gyp info spawn /usr/bin/python3
30.03 gyp info spawn args [
30.03 gyp info spawn args '/opt/indexer/node_modules/node-gyp/gyp/gyp_main.py',
30.03 gyp info spawn args 'binding.gyp',
30.03 gyp info spawn args '-f',
30.03 gyp info spawn args 'make',
30.03 gyp info spawn args '-I',
30.03 gyp info spawn args '/opt/indexer/node_modules/@parcel/watcher/build/config.gypi',
30.03 gyp info spawn args '-I',
30.03 gyp info spawn args '/opt/indexer/node_modules/node-gyp/addon.gypi',
30.03 gyp info spawn args '-I',
30.03 gyp info spawn args '/root/.cache/node-gyp/22.23.5/include/node/common.gypi',
30.03 gyp info spawn args '-Dlibrary=shared_library',
30.03 gyp info spawn args '-Dvisibility=default',
30.03 gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/22.23.5',
30.03 gyp info spawn args '-Dnode_gyp_dir=/opt/indexer/node_modules/node-gyp',
30.03 gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/22.23.5/<(target_arch)/node.lib',
30.03 gyp info spawn args '-Dmodule_root_dir=/opt/indexer/node_modules/@parcel/watcher',
30.03 gyp info spawn args '-Dnode_engine=v8',
30.03 gyp info spawn args '--depth=.',
30.03 gyp info spawn args '--no-parallel',
30.03 gyp info spawn args '--generator-output',
30.03 gyp info spawn args 'build',
30.03 gyp info spawn args '-Goutput_dir=.'
30.03 gyp info spawn args ]
30.03 Traceback (most recent call last):
30.03 File "/opt/indexer/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
30.03 import gyp # noqa: E402
30.03 ^^^^^^^^^^
30.03 File "/opt/indexer/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
30.03 import gyp.input
30.03 File "/opt/indexer/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
30.03 from distutils.version import StrictVersion
30.03 ModuleNotFoundError: No module named 'distutils'
30.03 gyp ERR! configure error
30.03 gyp ERR! stack Error: `gyp` failed with exit code: 1
30.03 gyp ERR! stack at ChildProcess.onCpExit (/opt/indexer/node_modules/node-gyp/lib/configure.js:325:16)
30.03 gyp ERR! stack at ChildProcess.emit (node:events:519:28)
30.03 gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
30.03 gyp ERR! System Linux 6.12.76-linuxkit
30.03 gyp ERR! command "/usr/local/bin/node" "/opt/indexer/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
30.03 gyp ERR! cwd /opt/indexer/node_modules/@parcel/watcher
30.03 gyp ERR! node -v v22.23.5
30.03 gyp ERR! node-gyp -v v9.4.1
30.03 gyp ERR! not ok
Looks like on arm64, @parcel/watcher dependency has no prebuilt binary, so it gets compiled by node-gyp 9, which relies on Python's distutils module, and Debian trixie's Python 3.13 no longer includes that module.
Adding python3-setuptools to the apt-get install on the toolchain stage fixes the issue on both images.
|
Thanks @tmigone, good catch. Added |
…e images - Base node:20.11-bookworm-slim (Node 20 is end of life) -> node:22-trixie-slim pinned by digest, the newest Node in the CI matrix. - python3/build-essential move to a toolchain stage; the production 'yarn --production' install runs there and the runtime copies the result, so the runtime images carry no compilers, git, curl or yarn cache. - indexer-cli no longer installs Rust (only needed by the removed indexer-native). Entrypoints, NODE_OPTIONS, the graph symlink and the CLI user are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
node-gyp 9 imports distutils, which Python 3.13 (trixie) no longer ships. On arm64 @parcel/watcher has no prebuilt binary and is compiled, so the build failed there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3eeaca7 to
2a8a02b
Compare
Summary
The
indexer-agentandindexer-cliimages are built onnode:20.11-bookworm-slim(Node 20 reached end of life in April 2026; Debian 12.5 base never refreshed) and installpython3 build-essential git curlin the runtime stage; the CLI image also installs Rust, last needed by the removed indexer-native. The v0.25.13 images are 1.7 GB (agent) and 3.1 GB (CLI), including a 754 MB yarn cache.node:22-trixie-slim(Node 22.23.5, Debian 13.7), pinned by multi-arch index digest via anARG NODE_IMAGE. Node 22 is the newest version in the CI matrix (tests.yml: 20, 22) and is LTS until April 2027.toolchain(python3, build-essential) →build(unchanged dev install and compile) →deps(the sameyarn --frozen-lockfile --production=truethe runtime stage ran before, now with the toolchain present, thenyarn cache clean) → runtime (clean base +COPY --from=deps /opt/indexer).yarn install, which now happens indeps), git (no git dependencies inyarn.lock, no exec of git), curl (only used to fetch rustup), Rust in the CLI image, the yarn cache.NODE_OPTIONS,ETHEREUM, thegraphsymlink and the CLI'sgraphuser (uid 10001).Native modules (keccak,
@nomicfoundation/edr, solidity-analyzer) are N-API with linux-x64 prebuilds. keccak has no linux-arm64 prebuild; on arm64 it compiles in thedepsstage, where the toolchain is (not tested here — no arm64 builder).Testing
Built both images from this branch (amd64) and compared with the published v0.25.13 images:
node --version, OS--help/start --help@nomicfoundation/edr, solidity-analyzer); keccak digestgraph indexer --help,graph --version,graph indexer statuswithout configyarn test:cion Node 22 (node:22-trixie-slim, postgres:13 as in CI): indexer-common 196 passed (43 skipped as in repo), indexer-agent 11, indexer-cli 82Trivy 0.76.1 (same vulnerability DB for all rows):
The remaining criticals come from lockfile pins, not the image: sequelize 6.33.0 (root
resolutions; fixed in 6.37.4), form-data 4.0.2 (4.0.4), proxy-addr 2.0.7 (2.0.8), and in the CLI ejs 2.7.4 via gluegun (3.1.7). Those are separateyarn.lock/resolutionsbumps, not in this PR.🤖 Generated with Claude Code