Skip to content

Commit 90a5fc2

Browse files
committed
build: remove lint/dotfiles from release tarball
This removes the ability to run linting from the source tarball, rationale being that developers should use a git clone instead. Also, fix the path of removing artifacts from the openssl dependency since it now lives in `deps/openssl/openssl/`. Tarballs shrink with ~10%. PR-URL: #5695 Fixes: #5618 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: thefourtheye <thechargingvolcano@gmail.com> Reviewed-By: James Snell <jasnell@gmail.com>
1 parent ba16a12 commit 90a5fc2

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

Makefile

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ test-timers:
211211
test-timers-clean:
212212
$(MAKE) --directory=tools clean
213213

214+
215+
ifneq ("","$(wildcard deps/v8/tools/run-tests.py)")
214216
test-v8:
215217
# note: performs full test unless QUICKCHECK is specified
216218
deps/v8/tools/run-tests.py --arch=$(V8_ARCH) \
@@ -234,6 +236,12 @@ test-v8-benchmarks:
234236

235237
test-v8-all: test-v8 test-v8-intl test-v8-benchmarks
236238
# runs all v8 tests
239+
else
240+
test-v8 test-v8-intl test-v8-benchmarks test-v8-all:
241+
@echo "Testing v8 is not available through the source tarball."
242+
@echo "Use the git repo instead:" \
243+
"$ git clone https://github.com/nodejs/node.git"
244+
endif
237245

238246
apidoc_sources = $(wildcard doc/api/*.markdown)
239247
apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \
@@ -427,12 +435,15 @@ $(TARBALL): release-only $(NODE_EXE) doc
427435
mkdir -p $(TARNAME)/doc/api
428436
cp doc/node.1 $(TARNAME)/doc/node.1
429437
cp -r out/doc/api/* $(TARNAME)/doc/api/
430-
rm -rf $(TARNAME)/deps/v8/{test,samples,tools/profviz} # too big
438+
rm -rf $(TARNAME)/deps/v8/{test,samples,tools/profviz,tools/run-tests.py}
431439
rm -rf $(TARNAME)/doc/images # too big
432440
rm -rf $(TARNAME)/deps/uv/{docs,samples,test}
433-
rm -rf $(TARNAME)/deps/openssl/{doc,demos,test}
441+
rm -rf $(TARNAME)/deps/openssl/openssl/{doc,demos,test}
434442
rm -rf $(TARNAME)/deps/zlib/contrib # too big, unused
435-
rm -rf $(TARNAME)/.github # github issue templates
443+
rm -rf $(TARNAME)/.{editorconfig,git*,mailmap}
444+
rm -rf $(TARNAME)/tools/{eslint,eslint-rules,osx-pkg.pmdoc,pkgsrc}
445+
rm -rf $(TARNAME)/tools/{osx-*,license-builder.sh,cpplint.py}
446+
find $(TARNAME)/ -name ".eslint*" -maxdepth 2 | xargs rm
436447
find $(TARNAME)/ -type l | xargs rm # annoying on windows
437448
tar -cf $(TARNAME).tar $(TARNAME)
438449
rm -rf $(TARNAME)
@@ -583,7 +594,7 @@ bench-idle:
583594

584595
jslint:
585596
$(NODE) tools/eslint/bin/eslint.js benchmark lib src test tools/doc \
586-
tools/eslint-rules --rulesdir tools/eslint-rules
597+
tools/eslint-rules --rulesdir tools/eslint-rules
587598

588599
CPPLINT_EXCLUDE ?=
589600
CPPLINT_EXCLUDE += src/node_lttng.cc
@@ -610,7 +621,14 @@ CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \
610621
cpplint:
611622
@$(PYTHON) tools/cpplint.py $(CPPLINT_FILES)
612623

624+
ifneq ("","$(wildcard tools/eslint/bin/eslint.js)")
613625
lint: jslint cpplint
626+
else
627+
lint:
628+
@echo "Linting is not available through the source tarball."
629+
@echo "Use the git repo instead:" \
630+
"$ git clone https://github.com/nodejs/node.git"
631+
endif
614632

615633
.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean \
616634
check uninstall install install-includes install-bin all staticlib \

vcbuild.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,16 @@ goto jslint
261261

262262
:jslint
263263
if not defined jslint goto exit
264+
if not exist tools\eslint\bin\eslint.js goto no-lint
264265
echo running jslint
265266
%config%\node tools\eslint\bin\eslint.js benchmark lib src test tools\doc tools\eslint-rules --rulesdir tools\eslint-rules
266267
goto exit
267268

269+
:no-lint
270+
echo Linting is not available through the source tarball.
271+
echo Use the git repo instead: $ git clone https://github.com/nodejs/node.git
272+
goto exit
273+
268274
:create-msvs-files-failed
269275
echo Failed to create vc project files.
270276
goto exit

0 commit comments

Comments
 (0)