Skip to content

bugfix - bound run command generated target cache (#797)#798

Merged
dannymeijer merged 1 commit into
release/v0.4from
bugfix/run-command-cache-footprint
Jun 19, 2026
Merged

bugfix - bound run command generated target cache (#797)#798
dannymeijer merged 1 commit into
release/v0.4from
bugfix/run-command-cache-footprint

Conversation

@dannymeijer

Copy link
Copy Markdown
Member

Summary

This PR fixes incan run -c artifact growth by replacing timestamped inline command project names with stable content-keyed identities. Repeated identical inline snippets from the same working directory now reuse the same generated project and Cargo binary, while different snippets still get separate stable targets so parallel run -c invocations cannot execute the wrong binary.

Type of change

  • Bug fix
  • New feature
  • Refactor / maintenance
  • Documentation
  • CI / tooling
  • RFC (adds/updates docs/RFCs/*)

Area(s)

Select the primary areas touched (used for review routing; labels are managed separately):

  • Incan Language (syntax/semantics)
  • Compiler (frontend/backend/codegen)
  • Tooling (CLI/formatter/test runner)
  • Editor integration (LSP/VS Code extension)
  • Runtime / Core crates (stdlib/core/derive)
  • Documentation

Key details

  • User-facing behavior: repeated incan run -c calls no longer mint new incan_cmd_* generated Cargo targets for the same inline source.
  • Internals: inline execution now uses the build/run command layer instead of constructing timestamped temp files in the top-level CLI dispatcher. The generated project identity is keyed by working directory and wrapped inline source, then routed through the same prepared-project runner as file execution.
  • Risks: inline command cache identity changed. The implementation deliberately includes source content in the key to avoid collisions between concurrent different snippets from the same working directory.

Testing / verification

  • make test / cargo test
  • make examples (if relevant)
  • incan fmt --check . (if relevant)
  • Manual verification described below

Manual verification notes:

  • cargo test --locked inline_command --lib passed: 6 focused unit tests.
  • cargo test --locked test_run_c_import_this --test integration_tests passed: 2 existing run -c integration tests.
  • cargo build --locked --bin incan passed.
  • Manual incan run -c 'import this' twice from the same throwaway directory reused the existing debug binary on the second run.
  • Manual incan run -c with a different snippet from the same directory created a different stable incan_inline_command_<digest> crate instead of colliding with the first snippet.
  • find <throwaway-target> -name 'incan_cmd_*' returned no results.
  • make pre-commit passed: 2,682 nextest tests, clippy, cargo-deny and smoke-test-fast.

Docs impact

  • No docs changes needed
  • Docs updated
  • Docs follow Divio intent (tutorial/how-to/reference/explanation) where applicable

If docs updated:

  • Link(s): …

Checklist

  • I kept public docs user-focused and moved internals to contributing docs when appropriate
  • I avoided duplicating canonical install/run instructions in multiple places
  • I added/updated tests where it materially reduces regressions

Closes #797

@incan-triage-bot incan-triage-bot Bot added the tooling Suggestions, features, or bugs related to the Tooling (CLI/formatter/test runner) label Jun 19, 2026
@dannymeijer dannymeijer self-assigned this Jun 19, 2026
@dannymeijer dannymeijer added this to the 0.4 Release milestone Jun 19, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in @Incan Jun 19, 2026
@dannymeijer dannymeijer moved this from Backlog to In Review in @Incan Jun 19, 2026
@dannymeijer dannymeijer marked this pull request as ready for review June 19, 2026 17:17
@dannymeijer dannymeijer merged commit 2568a78 into release/v0.4 Jun 19, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in @Incan Jun 19, 2026
@dannymeijer dannymeijer deleted the bugfix/run-command-cache-footprint branch June 19, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling Suggestions, features, or bugs related to the Tooling (CLI/formatter/test runner)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant