Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing ./tools/node_modules/eslint/eslint.js on make test? #39709

Closed
ChrisRus opened this issue Aug 8, 2021 · 9 comments · Fixed by #54231
Closed

Missing ./tools/node_modules/eslint/eslint.js on make test? #39709

ChrisRus opened this issue Aug 8, 2021 · 9 comments · Fixed by #54231
Labels
build Issues and PRs related to build files or the CI. test Issues and PRs related to the tests.

Comments

@ChrisRus
Copy link

ChrisRus commented Aug 8, 2021

Version

14.17.4 and 16.6.1

Platform

Linux alpental 5.10.0-0.bpo.5-amd64 #1 SMP Debian 5.10.24-1~bpo10+1 (2021-03-29) x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

Hello, I was trying to upgrade my local devenv to Node 16.6.1 and typically compile / test / install from sources tar.gz as follows below. Everything seems fine. But, the make ultimately fails due to a missing eslint.js module?

I do not appear blocked by this; I can continue on to install the version I have built w/out problem. However, I am not exactly sure what I have left unfinished in the build.

Any insight into this would be appreciated.

$ cd ~/devenv
$ wget https://nodejs.org/dist/v16.6.1/node-v16.6.1.tar.gz
$ tar -xvf node-v16.6.1.tar.gz 
$ cd node-v16.6.1
$ apt-get update
$ apt-get upgrade
$ ./configure
Node.js configure: Found Python 3.7.2...
INFO: configure completed successfully
$ make -j16 test
.
.
.

----------------------------------------------------------------------
Ran 6 tests in 0.001s

OK
make -s test-doc
Running JS linter...
Running Markdown linter...
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '/home/cdr/devenv/node-v16.6.1/tools/node_modules/eslint/bin/eslint.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
make[1]: *** [Makefile:1266: lint-js-doc] Error 1
make[1]: *** Waiting for unfinished jobs....

added 105 packages, and audited 106 packages in 2s

82 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
make: *** [Makefile:299: test] Error 2

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

make test completes w/out error (at least not due what seems like a missing dependency).

What do you see instead?

build break due to seeming missing eslint.js dependency

Additional information

Thanks!

@Trott
Copy link
Member

Trott commented Aug 8, 2021

@nodejs/releasers @nodejs/build Possible issue in the tar.gz source file generation? Or intentional decision?

@ChrisRus Quick fix might be to run these three commands:

mkdir tools/node_modules
tools/update-eslint.sh
echo "process.exit(0);" > .eslintrc.js

This will bypass (rather than run) ESLint.

@richardlau
Copy link
Member

richardlau commented Aug 8, 2021

I don't know why (to save space?) but it is intentional -- we remove a lot of things for the source tarball, including everything under tools/node_modules and the .eslint files:

node/Makefile

Lines 1064 to 1100 in 6145113

$(TARBALL): release-only doc-only
git checkout-index -a -f --prefix=$(TARNAME)/
mkdir -p $(TARNAME)/doc/api
cp doc/node.1 $(TARNAME)/doc/node.1
cp -r out/doc/api/* $(TARNAME)/doc/api/
$(RM) -r $(TARNAME)/.editorconfig
$(RM) -r $(TARNAME)/.git*
$(RM) -r $(TARNAME)/.mailmap
$(RM) -r $(TARNAME)/deps/openssl/openssl/demos
$(RM) -r $(TARNAME)/deps/openssl/openssl/doc
$(RM) -r $(TARNAME)/deps/openssl/openssl/test
$(RM) -r $(TARNAME)/deps/uv/docs
$(RM) -r $(TARNAME)/deps/uv/samples
$(RM) -r $(TARNAME)/deps/uv/test
$(RM) -r $(TARNAME)/deps/v8/samples
$(RM) -r $(TARNAME)/deps/v8/tools/profviz
$(RM) -r $(TARNAME)/deps/v8/tools/run-tests.py
$(RM) -r $(TARNAME)/doc/images # too big
$(RM) -r $(TARNAME)/test*.tap
$(RM) -r $(TARNAME)/tools/cpplint.py
$(RM) -r $(TARNAME)/tools/eslint-rules
$(RM) -r $(TARNAME)/tools/license-builder.sh
$(RM) -r $(TARNAME)/tools/node_modules
$(RM) -r $(TARNAME)/tools/osx-*
$(RM) -r $(TARNAME)/tools/osx-pkg.pmdoc
find $(TARNAME)/deps/v8/test/* -type d ! -regex '.*/test/torque$$' | xargs $(RM) -r
find $(TARNAME)/deps/v8/test -type f ! -regex '.*/test/torque/.*' | xargs $(RM)
find $(TARNAME)/deps/zlib/contrib/* -type d ! -regex '.*/contrib/optimizations$$' | xargs $(RM) -r
find $(TARNAME)/ -name ".eslint*" -maxdepth 2 | xargs $(RM)
find $(TARNAME)/ -type l | xargs $(RM)
tar -cf $(TARNAME).tar $(TARNAME)
$(RM) -r $(TARNAME)
gzip -c -f -9 $(TARNAME).tar > $(TARNAME).tar.gz
ifeq ($(XZ), 1)
xz -c -f -$(XZ_COMPRESSION) $(TARNAME).tar > $(TARNAME).tar.xz
endif
$(RM) $(TARNAME).tar

The lint targets have escape paths for the source tarball -- maybe we need to do the same elsewhere:

node/Makefile

Lines 1424 to 1428 in 6145113

else
lint lint-ci:
$(info Linting is not available through the source tarball.)
$(info Use the git repo instead: $$ git clone https://github.com/nodejs/node.git)
endif

@targos
Copy link
Member

targos commented Aug 9, 2021

I think make test-only is supposed to work with the source tarball.

@targos
Copy link
Member

targos commented Aug 9, 2021

Similar issues: #34005 #32765

@targos targos added build Issues and PRs related to build files or the CI. test Issues and PRs related to the tests. labels Aug 9, 2021
@ChrisRus
Copy link
Author

ChrisRus commented Aug 9, 2021

Thank you for the replies. I will try $ make test-only

  • I first noticed this when compiling / testing / installing v14.17.4 IIRC.
  • Up until then (for years) have used the basic script from OP w/out error.
  • Could be that I need to re-read the README for latest build/testing instruction? I admit I have not checked...
  • Thinking back, when I 1st encountered w/v14.17.4 but was rushed so executed $ make install and used it. Seemed okay except for the CLI:
    • Empirically, if you $ make test, hit the error above, and then go ahead and $ make install then I am seeing that the installed Node.js version will not autocomplete on when using the interactive CLI (e.g. for adhoc testing)
    • This seems odd - I presume that the build process has to prepare / register assets to affect auto-complete. But, it's surprising to me that the make targets would not have already been evaluated prior to evaluation of any Makefile test target(s)?
    • If I $ make clean && make && make install then I see no issue w/auto-complete in the CLI (14.17.4 + 16.6.1).

@Trott
Copy link
Member

Trott commented Aug 9, 2021

  • Could be that I need to re-read the README for latest build/testing instruction? I admit I have not checked...

It should probably be added to BUILDING.md. A short section on building from source tar might be a good addition. I'm willing to do it myself, but I'd rather have someone who, you know, actually builds from the source tar write it up.

@ChrisRus
Copy link
Author

ChrisRus commented Aug 9, 2021

Not having any luck getting $ make test-only to exit cleanly either:

Lots of ERR_SSL_EE_KEY_TOO_SMALL errors. And, ultimately the following error that stops the build:

WAIT-ACCEPT
error setting certificate
139670488794944:error:0909006C:PEM routines:get_name:no start line:../deps/openssl/openssl/crypto/pem/pem_lib.c:745:Expecting: DH PARAMETERS
139670488794944:error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small:../deps/openssl/openssl/ssl/ssl_rsa.c:301:
(node:6833) [DEP0064] DeprecationWarning: tls.createSecurePair() is deprecated. Please use tls.TLSSocket instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
node:assert:123
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

1 !== 0

    at process.<anonymous> (/home/cdr/devenv/node-v16.6.1/test/sequential/test-tls-securepair-client.js:178:12)
    at process.emit (node:events:406:35) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: 1,
  expected: 0,
  operator: 'strictEqual'
}
Command: out/Release/node /home/cdr/devenv/node-v16.6.1/test/sequential/test-tls-securepair-client.js
[02:07|% 100|+ 3227|- 169]: Done                                           
make[1]: *** [Makefile:278: jstest] Error 1
make: *** [Makefile:312: test-only] Error 2
root@alpental:/home/cdr/devenv/node-v16.6.1# 

@richardlau
Copy link
Member

You're probably running into #27862.

@ChrisRus
Copy link
Author

ChrisRus commented Aug 9, 2021

It should probably be added to BUILDING.md. A short section on building from source tar might be a good addition. I'm willing to do it myself, but I'd rather have someone who, you know, actually builds from the source tar write it up.

The BUILDING.md document says use $ make test-only to "verify the build". And, then goes on to talk about $ make test "does a full check on the codebase, including running linters and documentation tests".

So, perhaps this guidance is okay? And, that in the case of $ make test there's some loose end wrt eslist? And, for $ make test-only the issue currently is as @richardlau helpfully points out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants