Skip to content

tools, build: make v8 build pythonic #58304

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

avivkeller
Copy link
Member

@avivkeller avivkeller commented May 13, 2025

While investigating #57964, I noticed that some of our tooling assumes a POSIX environment. To enhance cross-platform compatibility, this PR replaces make-v8.sh with build_v8.py, allowing the build process to run more reliably across different systems.

I've tested this on my Windows setup.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/tsc

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency. labels May 13, 2025
@aduh95
Copy link
Contributor

aduh95 commented May 13, 2025

I noticed that some of our tooling assumes a Linux environment

I don't think that's accurate, sh scripts should work on any POSIX-compliant platform

@avivkeller
Copy link
Member Author

Yea, that's what I meant. I've updated the description.

@bnoordhuis
Copy link
Member

I'm lukewarm on changes like these. This PR adds more lines of code than it removes, while the current script works fine, no one is complaining.

@avivkeller
Copy link
Member Author

while the current script works fine, no one is complaining.

I wouldn't really say the current script "works fine": it only works on POSIX terminals, whereas on other terminals, like PowerShell, it won't execute.

@tniessen
Copy link
Member

On a side note, the Windows prerequisites section explicitly lists a POSIX-compatible shell as a prerequisite, even if only for tests:

Basic Unix tools required for some tests, Git for Windows includes Git Bash and tools which can be included in the global PATH.

Is it common to install Python and Git on Windows but not Git Bash? Or will the existing script fail in Git Bash?

@anonrig
Copy link
Member

anonrig commented May 22, 2025

cc @guybedford might have some opinions on this, since he's the only one I know personally who builds node.js on windows

@guybedford
Copy link
Contributor

Seems to work, although when I tried python tools/build_v8.py without any arguments and that seemed to error.

@avivkeller
Copy link
Member Author

Seems to work, although when I tried python tools/build_v8.py without any arguments and that seemed to error.

FWIW The original script also expected arguments

@joyeecheung
Copy link
Member

make-v8.sh is mostly used by make test-v8 and not for building Node.js but for building v8 to run V8 tests on our V8 fork - starting a V8 testing CI: https://ci.nodejs.org/job/node-test-commit-v8-linux/6576/

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung
Copy link
Member

joyeecheung commented May 23, 2025

I like the idea of using more of Python for specific scripts that we use - and specifically try to avoid relying on node for the tasks because with the current dependency management, we end up having to build both release and debug builds to build and run the entire test suites instead of just the debug builds (as some tasks rely on the release build), doubling the waiting time - but personally I am not a fan of replacing Makefile with Python since that would incur having to re-invent the wheels for dependency management whereas using Makefile give us that out of the box. Sure there are other tools for dependency management but arguably none of them has a syntax as well known as the one supported by Makefile and none of them has as much cross-platform support as Makefile. I think it's more viable to keep Makefile for dependency management but use Python scripts for the heavy lifting of the actual tasks.

I am not sure PowerShell support is worthy of a goal, we already require Git Bash on Windows. I'd be more optimistic about supporting Make run in e.g. MSYS2 shell/Git Bash instead, considering PowerShell is yet another tool that most people aren't familiar with.

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. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants