Skip to content

infs build projects#223

Merged
0xGeorgii merged 9 commits into
mainfrom
222-manifest-semantics
Jun 8, 2026
Merged

infs build projects#223
0xGeorgii merged 9 commits into
mainfrom
222-manifest-semantics

Conversation

@0xGeorgii

@0xGeorgii 0xGeorgii commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Closes #222

Confidence Score: 5/5

Safe to merge — the new project-mode dispatch, ABI handshake, and output-dir forwarding logic are well-structured and thoroughly tested.

All new code paths have both unit tests and integration tests exercising success and failure branches. The only gap is the exists() vs is_file() inconsistency in the single-file guards, a UX quality issue on uncommon input rather than a correctness regression.

apps/infs/src/commands/build.rs and apps/infs/src/commands/run.rs — the single-file path.exists() guards are inconsistent with the is_file() guard established in project_build.rs.

Important Files Changed

Filename Overview
apps/infs/src/commands/project_build.rs New shared project-build helper: resolves entry point with is_file(), drives the ABI handshake, and gates --out-dir forwarding on CompilerCompat::supports_out_dir(). Well-structured and thoroughly unit-tested.
apps/infs/src/commands/build.rs Gains project-mode dispatch; execute_single_file still uses path.exists() instead of path.is_file(), inconsistent with the is_file() guard established in project_build.rs.
apps/infs/src/commands/run.rs Gains project-mode dispatch via run_project_build(None, None); same path.exists() inconsistency as build.rs in the single-file guard.
apps/infs/src/project/manifest.rs Adds BuildConfig.mode, VerificationConfig.output_dir, and thorough validation/normalization logic. Path-traversal and absolute-path guards in normalized_output_dir are correct and well-tested.
apps/infs/tests/cli_integration.rs Comprehensive new integration tests covering project build, project run, manifest semantics, ABI capability gating, and scaffolding round-trips.
core/compiler-interface/src/lib.rs ABI minor bumped from 0 to 1 to advertise --out-dir support; clear backward-compatibility note in the doc comment.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["infs build / infs run"] --> B{path arg present?}
    B -- yes --> C[execute_single_file]
    B -- no --> D[discover_and_load cwd]
    D --> E{Inference.toml found?}
    E -- no --> F[error: manifest not found]
    E -- yes --> G[ProjectContext]
    G --> H[run_project_build]
    H --> I{src/main.inf is_file?}
    I -- no --> J[error: missing entry point]
    I -- yes --> K[probe_compiler_compatibility]
    K --> L{commit hash match?}
    L -- yes --> M[CompilerCompat commit_matched=true]
    L -- no --> N[probe --abi-version]
    N --> O{major mismatch?}
    O -- yes --> P[hard error: rebuild toolchain]
    O -- no --> Q[CompilerCompat with abi]
    M --> R{out_dir requested?}
    Q --> R
    R -- no --> U[infc default out/]
    R -- yes --> T{supports_out_dir?}
    T -- no --> S[hard error: ABI too old]
    T -- yes --> V[infc --out-dir dir]
    V --> W[propagate exit code]
    U --> W
    C --> X[path.exists check]
    X --> Y[find_infc + check_compat]
    Y --> Z[infc subprocess]
    Z --> W
Loading

Comments Outside Diff (1)

  1. apps/infs/tests/cli_integration.rs, line 3102-3129 (link)

    P2 Proof-mode tests implicitly require infc ABI ≥ 1.1

    project_build_manifest_proof_writes_under_proofs, project_build_proof_honors_custom_output_dir, project_build_cli_proof_on_default_manifest_uses_proofs, and project_build_cli_compile_overrides_manifest_proof all trigger the --out-dir forwarding path. They are gated only on require_infc() (infc present), not on the ABI version. If run against an infc that reports ABI 1.0 — e.g. a developer pointing INFC_PATH at an older local build — run_project_build will hard-error with the capability message rather than succeed, and these tests fail instead of being skipped. Adding an ABI-version pre-check (query --abi-version, parse it, skip if minor < 1) would make the skip behaviour consistent with the rest of the conditional test pattern.

Reviews (3): Last reviewed commit: "update docs" | Re-trigger Greptile

@0xGeorgii 0xGeorgii self-assigned this Jun 7, 2026
@0xGeorgii 0xGeorgii added the infs Inference Start related label Jun 7, 2026
@0xGeorgii 0xGeorgii requested a review from Copilot June 7, 2026 09:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes infs build / infs run project-aware (cargo-style): when no .inf path is provided, it discovers Inference.toml, builds src/main.inf from the project root, and (for run) executes out/main.wasm. To support project-root output placement and manifest-driven proof artifacts, it adds an infc --out-dir <path> flag and bumps the compiler ABI minor version.

Changes:

  • Add --out-dir <path> to infc, bump compiler ABI minor to 1.1, and add integration tests for output redirection semantics.
  • Implement project discovery/loading in infs (walk up for Inference.toml), plus a shared project-build helper used by both build and run.
  • Extend manifest/scaffolding to include explicit [build] mode, honor [verification] output-dir in proof builds, and add broad CLI integration coverage for project mode.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
core/compiler-interface/src/lib.rs Bumps ABI minor to 1 and documents the new additive flag.
core/cli/src/parser.rs Adds --out-dir CLI flag to infc.
core/cli/src/main.rs Uses out_dir (or default out/) when writing artifacts.
core/cli/tests/cli_integration.rs Adds integration tests for ABI string and --out-dir behavior.
apps/infs/src/project/manifest.rs Adds [build] mode, manifest load/discovery helpers, and output-dir normalization.
apps/infs/src/project/mod.rs Introduces ProjectContext and discover_and_load.
apps/infs/src/project/scaffold.rs Scaffolds explicit [build] mode = "compile" and ignores generated proof artifacts.
apps/infs/src/commands/project_build.rs New shared helper for project-mode build: warnings, handshake, spawning infc from project root.
apps/infs/src/commands/build.rs Makes path optional (project mode), resolves effective mode/output-dir, delegates to project helper.
apps/infs/src/commands/run.rs Makes path optional (project mode), project-run pipeline builds then runs <root>/out/main.wasm.
apps/infs/src/commands/mod.rs Registers the new project_build module.
apps/infs/src/commands/new.rs Updates “next steps” to infs build (project mode).
apps/infs/src/commands/init.rs Updates “next steps” to infs build (project mode).
apps/infs/src/main.rs Updates CLI help text to describe project-mode run behavior.
apps/infs/tests/cli_integration.rs Adds extensive project-mode build/run + manifest semantics integration tests.
.gitignore Ignores /scratch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/infs/src/project/manifest.rs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.

Comment thread apps/infs/src/commands/run.rs
Comment thread apps/infs/src/commands/build.rs Outdated
Comment thread apps/infs/src/project/mod.rs
Comment thread apps/infs/src/commands/project_build.rs
Comment thread apps/infs/src/commands/project_build.rs Outdated
0xGeorgii added 2 commits June 8, 2026 15:13
Signed-off-by: Georgii Plotnikov <accembler@gmail.com>
@0xGeorgii 0xGeorgii marked this pull request as ready for review June 8, 2026 07:35
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

@0xGeorgii 0xGeorgii merged commit 74964c3 into main Jun 8, 2026
6 checks passed
@0xGeorgii 0xGeorgii deleted the 222-manifest-semantics branch June 8, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infs Inference Start related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project-aware infs build and infs run: build the project from Inference.toml, not a single file

2 participants