Skip to content

Optimize install.sh to avoid unnecessary rebuilds and reuse unchanged build artifacts #22

Description

@OpenCodeEngineer

Problem

./install.sh already skips installation-time rebuilds in some cases, but it still leaves obvious build-speed wins on the table.

Current behavior in install.sh:

  • it uses a coarse stale check based on git describe and file mtimes under codex-rs/
  • it forces CARGO_INCREMENTAL=0, which prevents reuse of incremental artifacts during local rebuilds
  • it only decides whether to rebuild the final binary, not whether unchanged intermediate artifacts can be reused more aggressively

The result is slower local install/build loops than necessary, especially when only a small subset of files changed.

Goal

Make ./install.sh faster for iterative local use by avoiding unnecessary rebuild work and reusing build outputs when inputs have not changed.

Acceptance Criteria

  • Audit the current rebuild decision logic in install.sh and identify avoidable full rebuild paths.
  • Propose or implement a caching/reuse strategy for unchanged inputs and build artifacts.
  • Preserve correctness: modified sources must still trigger rebuilds, and stale binaries must not be installed.
  • Document any new env knobs or behavior changes in ./install.sh --help.
  • Add validation that demonstrates the optimized path skips redundant rebuild work when inputs are unchanged.

Notes

Likely areas to investigate:

  • whether CARGO_INCREMENTAL=0 is still the right default for local install flows
  • whether the stale check should use a more precise fingerprint than broad file mtime scanning
  • whether build metadata can be cached to distinguish source changes from no-op installs
  • whether release/profile tradeoffs should differ for first build vs repeat local installs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions