Skip to content

build(make): add build-local for both binaries from one Cargo invocation - #1324

Merged
huichen merged 1 commit into
mainfrom
pr/dev-huichen
Oct 23, 2026
Merged

huichen merged 1 commit into
mainfrom
pr/dev-huichen

Conversation

@huichen

@huichen huichen commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

make install already builds future and futureos in a single Cargo invocation through scripts/build/build-desktop.mjs, so the two share one dependency graph and one feature unification — but it runs the release profile, and release carries lto = "thin", which recompiles the whole graph under LTO on every edit. build-local gives the same package selection on the LTO-free local profile:

cargo build --profile local -p future-cli -p futureos --bin future --bin futureos

One invocation matters for the same reason it matters in build-desktop.mjs: selecting both packages at once keeps shared crates compiled once and keeps feature unification aligned with the shipping build, instead of two runs that disagree and recompile each other's dependencies. Measured cold in a fresh worktree: 327 s for both binaries; afterwards a one-line CLI edit rebuilds them in 3.7-3.8 s.

It writes target/local/{future,futureos} only. It does not install into PREFIX, stage the Desktop sidecar, build the frontend or bundle — make install* and make package-desktop keep owning those, unchanged.

Commits

  • build(make): add build-local for both binaries from one Cargo invocation (50d859b96)

Verification

Only the Makefile is touched:

Notes

  • Opt-in only: no existing target selects it, and release is untouched, so what ships cannot drift.
  • Rust binaries land under target/local/; the frontend build and the Tauri bundle are out of scope.

…ation

`make install` already builds `future` and `futureos` together — through
scripts/build/build-desktop.mjs, so they share one dependency graph and one
feature unification — but it runs the release profile, and release carries
`lto = "thin"`, which makes every edit recompile the graph under LTO.

`build-local` gives the same selection on the LTO-free `local` profile:

    cargo build --profile local -p future-cli -p futureos --bin future --bin futureos

One invocation matters for the same reason it matters in build-desktop.mjs:
selecting both packages at once keeps shared crates compiled once and keeps
feature unification aligned with the shipping build, instead of two runs that
disagree and recompile each other's dependencies.

It writes target/local/{future,futureos} only. It does not install into PREFIX,
stage the Desktop sidecar, build the frontend or bundle — `make install*` and
`make package-desktop` keep owning those, unchanged.

Measured in a fresh worktree: 327 s cold for both binaries; afterwards a
one-line CLI edit rebuilds both in 3.7-3.8 s and a one-line Desktop edit in
3.4 s.

No platform-specific syntax: the target is the same three lines on Windows,
macOS and Linux, and `profile.local` lives in the root Cargo.toml.
@huichen
huichen enabled auto-merge (squash) October 23, 2026 14:43
@huichen
huichen merged commit 3d3dbf2 into main Oct 23, 2026
10 checks passed
@huichen
huichen deleted the pr/dev-huichen branch October 23, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant