infs build projects#223
Merged
Merged
Conversation
There was a problem hiding this comment.
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>toinfc, bump compiler ABI minor to1.1, and add integration tests for output redirection semantics. - Implement project discovery/loading in
infs(walk up forInference.toml), plus a shared project-build helper used by bothbuildandrun. - Extend manifest/scaffolding to include explicit
[build] mode, honor[verification] output-dirin 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.
Signed-off-by: Georgii Plotnikov <accembler@gmail.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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 --> WComments Outside Diff (1)
apps/infs/tests/cli_integration.rs, line 3102-3129 (link)project_build_manifest_proof_writes_under_proofs,project_build_proof_honors_custom_output_dir,project_build_cli_proof_on_default_manifest_uses_proofs, andproject_build_cli_compile_overrides_manifest_proofall trigger the--out-dirforwarding path. They are gated only onrequire_infc()(infc present), not on the ABI version. If run against aninfcthat reports ABI 1.0 — e.g. a developer pointingINFC_PATHat an older local build —run_project_buildwill 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 ifminor < 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