Skip to content

Migrate the generator drivers' per-package manifest logic to consume hydra.build.manifest #607

Description

@joshsh

Following #560 (routing driver migration — the proven consume-then-delete pattern), promote the next pure-core unit under #559: per-package manifest field logic.

Each host driver still hand-codes the manifest-writing logic that assembles a package's fields (mainModules / testModules / mainDslModules / mainEncodingModules / package) into its manifest.json:

  • Java: Generation.writePackageManifests (heads/java/src/main/java/hydra/Generation.java:968)
  • Python: write_package_manifests (heads/python/src/main/python/hydra/generation.py:834)
  • Haskell: the equivalent in the Haskell driver.

The generated hydra.build.manifest module (packages/hydra-build/src/main/haskell/Hydra/Sources/Build/Manifest.hs, already landed in the hydra-build package) encodes this field-assembly/serialization logic translingually — the drivers should consume it rather than duplicate it.

Scope

Flip the three drivers to consume hydra.build.manifest for the manifest field-assembly + serialization decision logic, deleting the hand-coded duplication — same two-part pattern as #560 (Haskell shim delegating to generated -> Java -> Python), with the same hard constraints:

  1. dist/json byte-identical. writePackageManifests's emitted manifest.json (alphabetized fields, sorted namespace arrays) must not move a byte. Drift elimination, not behavior change.
  2. Both Java compile paths validated — the local (json-driver/build.gradle) and the published (:hydra-java:compileHeadsExtrasJava) compiles must pass. This is the coverage gap that caused Migrate the three generator drivers to consume hydra.build.routing; delete the legacy static prefix tables #560's RED-MAIN (CI runs the published cold-clone compile, which local /test java doesn't exercise). If the driver newly references a hydra.build.manifest symbol, wire it into both paths.
  3. Driver-level fail-loud tests for any Either-to-exception wrappers, per host (mirroring Migrate the three generator drivers to consume hydra.build.routing; delete the legacy static prefix tables #560's Step 5).

Sequencing

Pure-core, touches hydra.build.* + the drivers only — orthogonal to hydra.lib.*, so drivable now around #417's breaking wave (still out). Natural continuation of #560 (writePackageManifests was one of #560's rewired call sites).

Relates to: #416, #559, #560. Lesson applied from #560: validate the published compile path, not just local /test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions