nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
104.27k stars 28.06k forks source link

build: rewrite makefile in python #52788

Closed RedYetiDev closed 1 week ago

RedYetiDev commented 2 weeks ago

This pull request introduces a Python build file to replace the Node.js Makefile. In my opinion, maintaining both vcbuild and Makefile (and keeping them feature-compatible) seems difficult. This change should, in my opinion, make maintenance easier, but there may be a learning curve.

The Python version assumes that the user, even on Windows, has Make installed. However, it doesn't rely on Unix commands except in the v8 target (which I aim to change soon) and MacOS-specific cases.

nodejs-github-bot commented 2 weeks ago

Review requested:

RedYetiDev commented 2 weeks ago

This PR is a draft, as it will probably take time to prepare and implement.

tniessen commented 2 weeks ago

Is there a discussion/issue leading up to this? I wasn't aware that the Makefile was introducing additional requirements that aren't already there due to dependencies, native addons, or so.

In any case, I assume that various external build processes depend on the Node.js Makefile.

RedYetiDev commented 2 weeks ago

Is there a discussion/issue leading up to this? I wasn't aware that the Makefile was introducing additional requirements that aren't already there due to dependencies, native addons, or so.

There wasn't a discussion around this previously, I wanted to start a discussion, and get some opinions. In my opinion, the makefile is hard to read (maybe I'm just inexperienced with makefiles). I also think that the vcbuild file is confusing to use, as IIRC it's not feature-equal to the makefile.

In any case, I assume that various external build processes depend on the Node.js Makefile.

I would imagine that would be a concern, but this is still a draft for now, and the issues can be worked out.

RedYetiDev commented 2 weeks ago

What motivated you to do this prior to asking/opening an issue?

It wasn't a big project, just a curious idea. I wondered if Makefiles could work in Python, so I tested it with Node.js. After finishing, I decided to open PR, because there really isn't anything to lose from opening one.

MoLow commented 2 weeks ago

+1 on opening an issue to discuss before such big changes