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

Race condition during build causing errors with default Python 2.x #39456

Closed
mscdex opened this issue Jul 19, 2021 · 1 comment
Closed

Race condition during build causing errors with default Python 2.x #39456

mscdex opened this issue Jul 19, 2021 · 1 comment
Labels
build Issues and PRs related to build files or the CI.

Comments

@mscdex
Copy link
Contributor

mscdex commented Jul 19, 2021

Version

master

Platform

Linux foo 5.4.0-58-generic #64~18.04.1-Ubuntu SMP Wed Dec 9 17:11:11 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

build

What steps will reproduce the bug?

No response

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

No response

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

There is a race condition occurring when building node where one or more build steps are executed before the python environment is properly set up (e.g. modifying PATH to include a path in out/ containing a symlink to the detected Python 3.x binary). I have Python 2.x as /usr/bin/python but Python 3.6 is also installed (as /usr/bin/python3 and /usr/bin/python3.6).

When the environment isn't set up properly first the build (using make -j 8 for example) fails with:

Traceback (most recent call last):
  File "tools/js2c.py", line 234, in <module>
    main()
  File "tools/js2c.py", line 219, in main
    js_files = utils.SearchFiles(options.directory, 'js')
  File "/home/foo/git/node/tools/utils.py", line 112, in SearchFiles
    list = glob.glob(dir+ '/**/*.' + ext, recursive=True)
TypeError: glob() got an unexpected keyword argument 'recursive'
  touch e6bf3e61ac02f989b2a33f551be26b7ec4082ec4.intermediate
libnode.target.mk:13: recipe for target '/home/foo/git/node/out/Release/obj/gen/node_javascript.cc' failed

At this point if I perform make (without a -j argument), then it works fine and once it gets past the part it was failing on I can abort the build and re-run make -j xxx and everything works fine from then on.

If I had to guess the command it's failing on it might be:

LD_LIBRARY_PATH=/home/foo/git/node/out/Release/lib.host:/home/foo/git/node/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; mkdir -p /home/foo/git/node/out/Release/obj/gen; python tools/js2c.py --directory lib --target "/home/foo/git/node/out/Release/obj/gen/node_javascript.cc" config.gypi deps/v8/tools/splaytree.mjs deps/v8/tools/codemap.mjs deps/v8/tools/consarray.mjs deps/v8/tools/csvparser.mjs deps/v8/tools/profile.mjs deps/v8/tools/profile_view.mjs deps/v8/tools/logreader.mjs deps/v8/tools/arguments.mjs deps/v8/tools/tickprocessor.mjs deps/v8/tools/sourcemap.mjs deps/v8/tools/tickprocessor-driver.mjs deps/acorn/acorn/dist/acorn.js deps/acorn/acorn-walk/dist/walk.js deps/cjs-module-lexer/lexer.js deps/cjs-module-lexer/dist/lexer.js
@mscdex mscdex added the build Issues and PRs related to build files or the CI. label Jul 19, 2021
@legendecas
Copy link
Member

@mscdex As the comment #39465 (comment) suggests, can you check out the content of ./config.mk (which is generated by ./configure), and if out/tool/bin/python presents and where does it linking to? I tested on a Linux system with both python2 and python3 installed and python in PATH is linking to python2, sadly the problem didn't present.

targos pushed a commit that referenced this issue Aug 2, 2021
PR-URL: #39465
Fixes: #39408
Fixes: #39456
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
targos pushed a commit that referenced this issue Aug 2, 2021
PR-URL: #39465
Fixes: #39408
Fixes: #39456
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
targos pushed a commit that referenced this issue Sep 4, 2021
PR-URL: #39465
Fixes: #39408
Fixes: #39456
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants