Skip to content

Conversation

@XL-Zhao-23
Copy link
Contributor

Background

This PR fixes the compatibility issue reported in apache/skywalking#13517,
where the make license-dep command fails under Node.js 24 due to incorrect handling of platform-specific npm packages.

Root Cause

The SkyWalking Eyes tool failed to correctly recognize platform-specific npm packages
(e.g., @parcel/watcher-linux-x64-musl, @parcel/watcher-win32-arm64),
resulting in license parsing errors under newer Node.js versions.

Solution

  • Added precise cross-platform package pattern recognition in the npm resolver.
  • Implemented OS/architecture matching via regex (e.g., -linux-x64-musl$, -win32-arm64$).
  • Updated logic to skip unsupported or non-current platform packages before license parsing.

Verification

  • Tested with Node.js 24.6.0 and npm 11.5.1 on Linux and macOS.
  • All licenses are now correctly identified when running make license-dep in the banyandb project.

Related Issue

Fixes apache/skywalking#13517

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a compatibility issue with Node.js 24 where the make license-dep command fails due to incorrect handling of platform-specific npm packages. The solution adds intelligent platform detection to skip packages that are not compatible with the current OS/architecture before attempting license parsing.

Key Changes:

  • Added platform-specific package detection using regex patterns for various OS/architecture combinations (Linux, macOS, Windows, FreeBSD, Android)
  • Implemented architecture compatibility logic to handle variations like x64/amd64/x86_64
  • Added SkippedReason field to track why packages are skipped

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
pkg/deps/result.go Added SkippedReason field to Result struct to track why packages are skipped during resolution
pkg/deps/npm.go Core implementation: added platform pattern recognition (39 patterns), platform detection logic in isForCurrentPlatform, architecture compatibility checking in isArchCompatible, and updated resolution flow to skip non-matching platform packages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wu-sheng
Copy link
Member

Please fix CI and take a look at Copilot review comments.

@XL-Zhao-23
Copy link
Contributor Author

Sorry for the long delay. I've completed the revisions. Could you please help rerun the CI and review the code?

@XL-Zhao-23
Copy link
Contributor Author

I fixed the CI errors.

@wu-sheng
Copy link
Member

@kezhenxu94 Please take a look.

@hanahmily I think you could build a local version, and have a try?

kezhenxu94
kezhenxu94 previously approved these changes Dec 2, 2025
Copy link
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

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

It’d be better if you can add a test case

Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
ning666meng added a commit to ning666meng/skywalking-eyes that referenced this pull request Dec 15, 2025
ning666meng added a commit to ning666meng/skywalking-eyes that referenced this pull request Dec 16, 2025
XL-Zhao-23 and others added 5 commits December 20, 2025 18:22
Detect npm packages that declare an OS suffix without a CPU architecture
(e.g. -linux, -darwin) and emit a friendly warning instead of treating
them as universal packages.
ning666meng and others added 4 commits December 22, 2025 18:56
Co-authored-by: ning666meng <ning666meng@users.noreply.github.com>
Merge branch 'skipping-cross-platform-packages' of https://github.com/XL-Zhao-23/skywalking-eyes into skipping-cross-platform-packages
@XL-Zhao-23 XL-Zhao-23 force-pushed the skipping-cross-platform-packages branch from 8057ebf to 0ed30bf Compare December 22, 2025 11:34
@wu-sheng wu-sheng requested a review from kezhenxu94 December 22, 2025 12:28
@kezhenxu94 kezhenxu94 merged commit 5537368 into apache:main Dec 22, 2025
1 check passed
@wu-sheng
Copy link
Member

@XL-Zhao-23 Would you like to try this in BanyanDB repo to adopt this new feature? cc @hanahmily

@XL-Zhao-23
Copy link
Contributor Author

No problem, I will test it again. (I have tested it in BanyanDB, but it was before adding the test cases.)

@XL-Zhao-23
Copy link
Contributor Author

This is the validation result for the current version:
zxl@zxl-HP-ZHAN-66-Pro-15-G2:~/GoProjects/skywalking-banyandb/ui$ make license-dep
/home/zxl/GoProjects/skywalking-eyes/license-eye dep resolve -o ui-licenses -s LICENSE.tpl
INFO Loading configuration from file: .licenserc.yaml
INFO Try to install nodejs packages in 5 seconds, press [s/S] and ENTER to skip
INFO Time out, try to install packages
INFO Run command: /home/zxl/.nvm/versions/node/v24.6.0/bin/npm ci, please wait
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: 'ui@0.1.0',
npm warn EBADENGINE required: { node: '20.12.2' },
npm warn EBADENGINE current: { node: 'v24.6.0', npm: '11.5.1' }
npm warn EBADENGINE }

added 218 packages, and audited 219 packages in 5s

52 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
npm warn config production Use --omit=dev instead.
WARNING Skipping cross-platform package @parcel/watcher-android-arm64 (not for current platform linux amd64)
WARNING Skipping cross-platform package @parcel/watcher-darwin-arm64 (not for current platform linux amd64)
WARNING Skipping cross-platform package @parcel/watcher-darwin-x64 (not for current platform linux amd64)
WARNING Skipping cross-platform package @parcel/watcher-freebsd-x64 (not for current platform linux amd64)
WARNING Skipping cross-platform package @parcel/watcher-linux-arm-glibc (not for current platform linux amd64)
WARNING Skipping cross-platform package @parcel/watcher-linux-arm-musl (not for current platform linux amd64)
WARNING Skipping cross-platform package @parcel/watcher-linux-arm64-glibc (not for current platform linux amd64)
WARNING Skipping cross-platform package @parcel/watcher-linux-arm64-musl (not for current platform linux amd64)
WARNING Skipping cross-platform package @parcel/watcher-win32-arm64 (not for current platform linux amd64)
WARNING Skipping cross-platform package @parcel/watcher-win32-ia32 (not for current platform linux amd64)
WARNING Skipping cross-platform package @parcel/watcher-win32-x64 (not for current platform linux amd64)

Dependency License Version
@babel/helper-string-parser MIT 7.27.1
@babel/helper-validator-identifier MIT 7.28.5
@babel/parser MIT 7.28.5
@babel/types MIT 7.28.5
@ctrl/tinycolor MIT 3.6.1
@element-plus/icons-vue MIT 2.3.2
@floating-ui/core MIT 1.7.3
@floating-ui/dom MIT 1.7.4
@floating-ui/utils MIT 0.2.10
@jridgewell/sourcemap-codec MIT 1.5.5
@parcel/watcher MIT 2.5.1
@parcel/watcher-linux-x64-glibc MIT 2.5.1
@parcel/watcher-linux-x64-musl MIT 2.5.1
@popperjs/core MIT 2.11.7
@tanstack/match-sorter-utils MIT 8.19.4
@tanstack/query-core MIT 5.90.10
@tanstack/vue-query MIT 5.91.2
@types/lodash MIT 4.17.20
@types/lodash-es MIT 4.17.12
@types/web-bluetooth MIT 0.0.16
@vue/compiler-core MIT 3.5.24
@vue/compiler-dom MIT 3.5.24
@vue/compiler-sfc MIT 3.5.24
@vue/compiler-ssr MIT 3.5.24
@vue/devtools-api MIT 6.6.4
@vue/reactivity MIT 3.5.24
@vue/runtime-core MIT 3.5.24
@vue/runtime-dom MIT 3.5.24
@vue/server-renderer MIT 3.5.24
@vue/shared MIT 3.5.24
@vueuse/core MIT 9.13.0
@vueuse/metadata MIT 9.13.0
@vueuse/shared MIT 9.13.0
argparse Python-2.0 2.0.1
async-validator MIT 4.2.5
braces MIT 3.0.3
chokidar MIT 4.0.3
codemirror MIT 5.65.20
core-util-is MIT 1.0.3
csstype MIT 3.2.3
dayjs MIT 1.11.19
detect-libc Apache-2.0 1.0.3
echarts Apache-2.0 5.6.0
element-plus MIT 2.11.8
entities BSD-2-Clause 4.5.0
estree-walker MIT 2.0.2
fill-range MIT 7.1.1
graceful-fs ISC 4.2.11
immediate MIT 3.0.6
immutable MIT 5.1.4
inherits ISC 2.0.4
is-extglob MIT 2.1.1
is-glob MIT 4.0.3
is-number MIT 7.0.0
isarray MIT 1.0.0
js-yaml MIT 4.1.1
jsonfile MIT 6.2.0
jszip (MIT OR GPL-3.0-or-later) 3.10.1
lie MIT 3.3.0
lodash MIT 4.17.21
lodash-es MIT 4.17.21
lodash-unified MIT 1.0.3
magic-string MIT 0.30.21
memoize-one MIT 6.0.0
micromatch MIT 4.0.8
mitt MIT 3.0.1
nanoid MIT 3.3.11
node-addon-api MIT 7.1.1
normalize-wheel-es BSD-3-Clause 1.2.0
pako (MIT AND Zlib) 1.0.11
picocolors ISC 1.1.1
picomatch MIT 2.3.1
pinia MIT 2.3.1
postcss MIT 8.5.6
process-nextick-args MIT 2.0.1
readable-stream MIT 2.3.8
readdirp MIT 4.1.2
remove-accents MIT 0.5.0
safe-buffer MIT 5.1.2
sass MIT 1.94.2
semver ISC 7.7.3
setimmediate MIT 1.0.5
source-map-js BSD-3-Clause 1.2.1
string_decoder MIT 1.1.1
to-regex-range MIT 5.0.1
tslib 0BSD 2.3.0
universalify MIT 2.0.1
util-deprecate MIT 1.0.2
vue MIT 3.5.24
vue-demi MIT 0.14.10
vue-router MIT 4.6.3
yaml ISC 2.8.1
zrender BSD-3-Clause 5.6.1

XL-Zhao-23 added a commit to XL-Zhao-23/skywalking-eyes that referenced this pull request Dec 22, 2025
@wu-sheng
Copy link
Member

You should be able to remove ui from here, and make UI scanned, and update the LICENSE accordingly, also make CI passed.

@XL-Zhao-23
Copy link
Contributor Author

👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Compatibility Issue with Node 24

4 participants