Skip to content

dev: compile integration artifacts into their own directory #758

Description

@0xisk

Raised by @andrew-fleming in #717.

Problem

compile:integration writes into the same contracts/artifacts/ tree as src, and the compiler names each artifact directory after the source basename. Two sources sharing a basename silently overwrite each other, last compile wins.

Already happened: ConfidentialFungibleTokenPublicSupply.compact existed under both src/token/extensions and test/integration/_mocks. It surfaced as a wrong-contract arity error, invisible to lint, typecheck, and the truncated-key scan, and was worked around by renaming the mock (f453342d).

Proposed

Give the mocks their own output tree. The compiler already supports it:

-"compile:integration": "compact-compiler --src test/integration/_mocks"
+"compile:integration": "compact-compiler --src test/integration/_mocks --out artifacts/integration"

Then:

  • turbo.jsoncompile:integration outputs become artifacts/integration/**/
  • the three test/integration/fixtures/*.ts imports move under artifacts/integration/
  • contracts/test-utils/harness/LiveSimulatorBackend.ts:116 hardcodes contracts/artifacts/<name>/ for ZK key loading, so the root has to come from SimulatorConfig instead
  • emptyKeyArtifacts's variadic sourceRoots, INTEGRATION_MOCKS (scripts/live/paths.ts), and the #integration conditional in ArtifactCompiler exist only because the trees are shared, and can go

Caveats

Cheaper interim

A scripts unit test asserting no basename appears under both src/**/*.compact and test/integration/_mocks/*.compact catches the collision in CI with no live-path change. Worth doing whether or not the move happens.

Refs #716.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions