Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Rebuild source dependencies when package output settings change

Offen
#8,539 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
ocaml

Rechercherichtung

Beginne damit, die bestehende Ungültigmachung von Abhängigkeiten für Root-Source-Map-Argumente während der Initialisierung nachzuverfolgen, und untersuche compiler-info.json zusammen mit den generierten .cmj-Artefakten. Untersuche anschließend das Setup des Integrationstests für die beiden Projekte, die eine Quellabhängigkeit gemeinsam nutzen. Als abgeschlossen gilt die Aufgabe, wenn Änderungen an den Paket-Ausgabeeinstellungen dazu führen, dass Rewatch die Abhängigkeit neu erstellt und beide Szenarien zur Modulreihenfolge erfolgreich kompiliert werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Problem

Rewatch can reuse stale dependency build artifacts when projects with different package-specs build the same source dependency.

We encountered this while working on moving Belt into the separate @rescript/belt package in the ReScript compiler repository:

  1. The regular analysis tests build @rescript/belt through a CommonJS test project.
  2. The reanalyze tests subsequently use the same package through an ES module test project.
  3. Both projects reference the same source dependency and therefore share its build artifacts.
  4. Rewatch considers the existing Belt artifacts current and does not rebuild them for the second project.
  5. The reanalyze tests fail with a misleading Missing dependency Belt_* error.

This is not a particularly common project setup, but the compiler repository exposes the underlying invalidation problem because multiple test projects with different output formats build the same source dependency in sequence.

Dependencies are compiled using the consuming root project's package output settings. However, these settings are not recorded in lib/bs/compiler-info.json. Belt's .cmj files therefore still contain only the CommonJS package-output metadata when the ES module project is built.

The dependency files and compiler search path are present; it is the package-output metadata inside the .cmj files that is stale.

Proposed solution

Include the effective root package output settings in each package's compiler-info.json.

The stored value should contain a normalized representation of every effective package spec, including:

  • Module format
  • in-source
  • Resolved suffix, including the root-level suffix fallback

During initialization, compare the current package output settings with those stored in compiler-info.json. If they differ, clean and rebuild the affected dependency.

This follows the existing mechanism that invalidates dependency builds when root source-map arguments change.

Testing

Add an integration test with two projects sharing a source dependency:

  1. Build the dependency through a CommonJS project.
  2. Build it through an ES module project without explicitly cleaning the dependency.
  3. Verify that Rewatch rebuilds the dependency and that the second project compiles successfully.

Ideally, test the reverse order as well.

Vorherrschende Sprache
OCaml
Sterne
7.5k
Forks
485
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
55

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus rescript-lang/rescript

Alle Issues in rescript-lang/rescript

Ähnliche Issues

Weitere Issues zu Build System

Neue Issues direkt in Ihr Postfach

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