diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eff906ca09e..565a9557250 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: runs-on: ${{ matrix.runs-on }} no-wasm-simd: '1' secrets: inherit - + test-without-intl: name: Test with Node.js ${{ matrix.node-version }} compiled --without-intl strategy: @@ -172,6 +172,79 @@ jobs: - name: Run tests run: npm run test:javascript:without-intl + test-without-ssl: + name: Test with Node.js ${{ matrix.node-version }} compiled --without-ssl + strategy: + fail-fast: false + max-parallel: 0 + matrix: + node-version: ['20', '22', '24', '25'] + runs-on: ubuntu-latest + timeout-minutes: 120 + steps: + - name: Checkout Repository + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + with: + persist-credentials: false + submodules: recursive + + # Setup node, install deps, and build undici prior to building icu-less node and testing + - name: Setup Node.js@${{ matrix.node-version }} + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: npm install + + - name: Build undici + run: npm run build:node + + - name: Determine latest release + id: release + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + result-encoding: string + script: | + const req = await fetch('https://nodejs.org/download/release/index.json') + const releases = await req.json() + + const latest = releases.find((r) => r.version.startsWith('v${{ matrix.node-version }}')) + return latest.version + + - name: Download and extract source + run: curl https://nodejs.org/download/release/${{ steps.release.outputs.result }}/node-${{ steps.release.outputs.result }}.tar.xz | tar xfJ - + + - name: Install ninja + run: sudo apt-get install ninja-build + + - name: ccache + uses: hendrikmuhs/ccache-action@bfa03e1de4d7f7c3e80ad9109feedd05c4f5a716 #v1.2.19 + with: + key: node${{ matrix.node-version }} + + - name: Build node + working-directory: ./node-${{ steps.release.outputs.result }} + run: | + export CC="ccache gcc" + export CXX="ccache g++" + ./configure --without-ssl --ninja --prefix=./final + make + make install + echo "$(pwd)/final/bin" >> $GITHUB_PATH + + - name: Print version information + run: | + echo OS: $(node -p "os.version()") + echo Node.js: $(node --version) + echo "Node.js built-in dependencies: $(node -p "'\r\n' + (Object.entries(process.versions).map(([k, v], i, arr) => (i !== arr.length - 1 ? '├──' : '└──') + k + '@' + v)).join('\r\n')")" + echo npm: $(npm --version) + echo git: $(git --version) + echo icu config: $(node -e "console.log(process.config)" | grep icu) + + - name: Try loading Node.js without Crypto + run: node index.js + test-fuzzing: name: Fuzzing runs-on: ubuntu-latest diff --git a/lib/util/runtime-features.js b/lib/util/runtime-features.js index f76ba6b0ffe..3e62dc004d3 100644 --- a/lib/util/runtime-features.js +++ b/lib/util/runtime-features.js @@ -20,7 +20,7 @@ function detectRuntimeFeatureByNodeModule (moduleName) { lazyLoaders[moduleName]() return true } catch (err) { - if (err.code !== 'ERR_UNKNOWN_BUILTIN_MODULE') { + if (err.code !== 'ERR_UNKNOWN_BUILTIN_MODULE' && err.code !== 'ERR_NO_CRYPTO') { throw err } return false