nodejs / nodejs/node

Makefile dependency tree is incomplete, makefiles do not build only as necessary

Offen
#25,135 4 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

build confirmed-bug
Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.3k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
283

Beschreibung

  • Version: master
  • Platform:Linux samtu 4.18.0-12-generic #13-Ubuntu SMP Wed Nov 14 15:17:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: gyp/make

The makefiles generated by gyp are not working for development (they work better for single-shot CI builds). Perhaps I'm missing something, please tell me if I am, but I've done some asking around to people who know the gyp system, and have some agreement on these points.

  • make node; make node Make should do nothing if no source code has been changed, but make node relinks both node and cctest (!?) every time it is run.

  • make -C out node is faster, but and builds just node, not cctest, but it does it even if no source has changed. However, its build/dependency tree is incomplete! It doesn't run js2c so if any js source files are changed they will not be built-in with js2c. Fast and wrong is worse than slow.

  • make -C out/Release node as above

  • make -j4 node; make -j1 test often required. parallel make is not working for test. Various symptoms of brokenness occur (irc has some discussion). Sounds like this could be related to the dependency relationships not being correctly specified, causing build rules to run in parallel when they cannot, and thus be racy.

  • ./configure --shared-openssl-includes will cause openssl include paths to be passed to dependencies that don't use openssl. This might appear harmless, but it (for example) causes ccache to rebuild icu, even though icu doesn't use openssl. Possible fix: https://github.com/nodejs/node/blob/eef6504cf7b95ada170ec9878089ce57fde551d8/common.gypi#L549-L560, add OPENSSL_THREADS to the else clause (I haven't tried yet).

Ninja notes:

Ninja (./configure --ninja) doesn't have the above problems for building, its dependency tree is correct (it builds nothing when nothing has changed, and it reruns js2c when js files have changed).

However, it is either incomplete or not integrated with the rest of the build (I'm not sure how its intended to work). It doesn't make the top-level node symlink (at least test-doc relies on this), so a ln -s out/Release/node node is required for make test-doc. As for make test, it won't use the ninja build output, because it relies on .PHONY targets, so it always (effectively) does a make -C out all.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Führe die aufgeführten make- und Ninja-Befehle aus dem Repository-Root erneut aus und untersuche anschließend die generierten Makefiles sowie die Abhängigkeitseinstellungen in common.gypi. Vergleiche die Abhängigkeitsbäume von Make und Ninja, einschließlich js2c und des node-Symlinks auf oberster Ebene. Als erledigt gilt die Aufgabe, wenn unveränderte Builds No-ops sind, Änderungen an JavaScript js2c erneut ausführen, parallele Test-Builds zuverlässig sind und die Ninja-Ausgabe mit den dokumentierten Testbefehlen funktioniert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
build-system
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.