mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
tools: add an option to generate lighter archives
PR-URL: https://github.com/nodejs/node/pull/60294 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
parent
27892ec461
commit
3c8c1efe1e
52
.github/workflows/test-shared.yml
vendored
52
.github/workflows/test-shared.yml
vendored
|
|
@ -35,8 +35,35 @@ permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-tarball:
|
||||||
if: github.event.pull_request.draft == false
|
if: github.event.pull_request.draft == false
|
||||||
|
name: ${{ github.event_name == 'workflow_dispatch' && 'Skipped job' || 'Build slim tarball' }}
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Make tarball
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||||
|
run: |
|
||||||
|
export DATESTRING=$(date "+%Y-%m-%d")
|
||||||
|
export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA")
|
||||||
|
./configure && make tar -j4 SKIP_XZ=1 SKIP_SHARED_DEPS=1
|
||||||
|
env:
|
||||||
|
DISTTYPE: nightly
|
||||||
|
|
||||||
|
- name: Upload tarball artifact
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||||
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
|
with:
|
||||||
|
name: tarballs
|
||||||
|
path: '*.tar.gz'
|
||||||
|
compression-level: 0
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: build-tarball
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -52,9 +79,17 @@ jobs:
|
||||||
name: '${{ matrix.system }}: with shared libraries'
|
name: '${{ matrix.system }}: with shared libraries'
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
name: tarballs
|
||||||
|
path: tarballs
|
||||||
|
|
||||||
|
- name: Extract tarball
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||||
|
run: |
|
||||||
|
tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
|
||||||
|
echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- uses: cachix/install-nix-action@7be5dee1421f63d07e71ce6e0a9f8a4b07c2a487 # v31.6.1
|
- uses: cachix/install-nix-action@7be5dee1421f63d07e71ce6e0a9f8a4b07c2a487 # v31.6.1
|
||||||
with:
|
with:
|
||||||
|
|
@ -69,11 +104,18 @@ jobs:
|
||||||
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
|
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
|
||||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
||||||
|
|
||||||
|
- name: Load shell.nix
|
||||||
|
if: github.event_name != 'workflow_dispatch'
|
||||||
|
run: |
|
||||||
|
mv "$TAR_DIR"/*.nix .
|
||||||
|
mkdir tools
|
||||||
|
mv "$TAR_DIR"/tools/nix tools/.
|
||||||
|
|
||||||
- name: Build Node.js and run tests
|
- name: Build Node.js and run tests
|
||||||
run: |
|
run: |
|
||||||
nix-shell \
|
nix-shell \
|
||||||
-I nixpkgs=./tools/nix/pkgs.nix \
|
-I nixpkgs=./tools/nix/pkgs.nix \
|
||||||
--pure --keep FLAKY_TESTS \
|
--pure --keep TAR_DIR --keep FLAKY_TESTS \
|
||||||
--keep SCCACHE_GHA_VERSION --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
|
--keep SCCACHE_GHA_VERSION --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
|
||||||
--arg loadJSBuiltinsDynamically false \
|
--arg loadJSBuiltinsDynamically false \
|
||||||
--arg ccache '(import <nixpkgs> {}).sccache' \
|
--arg ccache '(import <nixpkgs> {}).sccache' \
|
||||||
|
|
@ -81,5 +123,5 @@ jobs:
|
||||||
--arg benchmarkTools '[]' \
|
--arg benchmarkTools '[]' \
|
||||||
${{ endsWith(matrix.system, '-darwin') && '--arg extraConfigFlags ''["--without-inspector"]'' \' || '\' }}
|
${{ endsWith(matrix.system, '-darwin') && '--arg extraConfigFlags ''["--without-inspector"]'' \' || '\' }}
|
||||||
--run '
|
--run '
|
||||||
make run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
|
make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
|
||||||
'
|
'
|
||||||
|
|
|
||||||
26
Makefile
26
Makefile
|
|
@ -399,7 +399,7 @@ ADDONS_HEADERS_PREREQS := tools/install.py \
|
||||||
$(wildcard deps/uv/include/*/*.h) \
|
$(wildcard deps/uv/include/*/*.h) \
|
||||||
$(wildcard deps/v8/include/*.h) \
|
$(wildcard deps/v8/include/*.h) \
|
||||||
$(wildcard deps/v8/include/*/*.h) \
|
$(wildcard deps/v8/include/*/*.h) \
|
||||||
deps/zlib/zconf.h deps/zlib/zlib.h \
|
$(wildcard deps/zlib/z*.h) \
|
||||||
src/node.h src/node_api.h src/js_native_api.h src/js_native_api_types.h \
|
src/node.h src/node_api.h src/js_native_api.h src/js_native_api_types.h \
|
||||||
src/node_api_types.h src/node_buffer.h src/node_object_wrap.h \
|
src/node_api_types.h src/node_buffer.h src/node_object_wrap.h \
|
||||||
src/node_version.h
|
src/node_version.h
|
||||||
|
|
@ -1032,6 +1032,11 @@ override DESTCPU=x86
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TARNAME=node-$(FULLVERSION)
|
TARNAME=node-$(FULLVERSION)
|
||||||
|
# Supply SKIP_SHARED_DEPS=1 to explicitly skip all dependencies that can be included as shared deps
|
||||||
|
SKIP_SHARED_DEPS ?= 0
|
||||||
|
ifeq ($(SKIP_SHARED_DEPS), 1)
|
||||||
|
TARNAME:=$(TARNAME)-slim
|
||||||
|
endif
|
||||||
TARBALL=$(TARNAME).tar
|
TARBALL=$(TARNAME).tar
|
||||||
# Custom user-specified variation, use it directly
|
# Custom user-specified variation, use it directly
|
||||||
ifdef VARIATION
|
ifdef VARIATION
|
||||||
|
|
@ -1215,12 +1220,31 @@ $(TARBALL): release-only doc-only
|
||||||
$(RM) -r $(TARNAME)/.mailmap
|
$(RM) -r $(TARNAME)/.mailmap
|
||||||
$(RM) -r $(TARNAME)/deps/corepack
|
$(RM) -r $(TARNAME)/deps/corepack
|
||||||
$(RM) $(TARNAME)/test/parallel/test-corepack-version.js
|
$(RM) $(TARNAME)/test/parallel/test-corepack-version.js
|
||||||
|
ifeq ($(SKIP_SHARED_DEPS), 1)
|
||||||
|
$(RM) -r $(TARNAME)/deps/ada
|
||||||
|
$(RM) -r $(TARNAME)/deps/brotli
|
||||||
|
$(RM) -r $(TARNAME)/deps/cares
|
||||||
|
$(RM) -r $(TARNAME)/deps/icu-small
|
||||||
|
$(RM) -r $(TARNAME)/deps/icu-tmp
|
||||||
|
$(RM) -r $(TARNAME)/deps/llhttp
|
||||||
|
$(RM) -r $(TARNAME)/deps/nghttp2
|
||||||
|
$(RM) -r $(TARNAME)/deps/ngtcp2
|
||||||
|
find $(TARNAME)/deps/openssl -maxdepth 1 -type f ! -name 'nodejs-openssl.cnf' -exec $(RM) {} +
|
||||||
|
find $(TARNAME)/deps/openssl -mindepth 1 -maxdepth 1 -type d -exec $(RM) -r {} +
|
||||||
|
$(RM) -r $(TARNAME)/deps/simdjson
|
||||||
|
$(RM) -r $(TARNAME)/deps/sqlite
|
||||||
|
$(RM) -r $(TARNAME)/deps/uv
|
||||||
|
$(RM) -r $(TARNAME)/deps/uvwasi
|
||||||
|
$(RM) -r $(TARNAME)/deps/zlib
|
||||||
|
$(RM) -r $(TARNAME)/deps/zstd
|
||||||
|
else
|
||||||
$(RM) -r $(TARNAME)/deps/openssl/openssl/demos
|
$(RM) -r $(TARNAME)/deps/openssl/openssl/demos
|
||||||
$(RM) -r $(TARNAME)/deps/openssl/openssl/doc
|
$(RM) -r $(TARNAME)/deps/openssl/openssl/doc
|
||||||
$(RM) -r $(TARNAME)/deps/openssl/openssl/test
|
$(RM) -r $(TARNAME)/deps/openssl/openssl/test
|
||||||
$(RM) -r $(TARNAME)/deps/uv/docs
|
$(RM) -r $(TARNAME)/deps/uv/docs
|
||||||
$(RM) -r $(TARNAME)/deps/uv/samples
|
$(RM) -r $(TARNAME)/deps/uv/samples
|
||||||
$(RM) -r $(TARNAME)/deps/uv/test
|
$(RM) -r $(TARNAME)/deps/uv/test
|
||||||
|
endif
|
||||||
$(RM) -r $(TARNAME)/deps/v8/samples
|
$(RM) -r $(TARNAME)/deps/v8/samples
|
||||||
$(RM) -r $(TARNAME)/deps/v8/tools/profviz
|
$(RM) -r $(TARNAME)/deps/v8/tools/profviz
|
||||||
$(RM) -r $(TARNAME)/deps/v8/tools/run-tests.py
|
$(RM) -r $(TARNAME)/deps/v8/tools/run-tests.py
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user