Skip to content

fix: build a single engine for multiple projects using the same toolchain versions#509

Draft
doorgan wants to merge 1 commit intomainfrom
doorgan/deduplicate-engine-builder
Draft

fix: build a single engine for multiple projects using the same toolchain versions#509
doorgan wants to merge 1 commit intomainfrom
doorgan/deduplicate-engine-builder

Conversation

@doorgan
Copy link
Collaborator

@doorgan doorgan commented Mar 13, 2026

Fix #466

When resuming a session on Expert itself, I would regularly see issues due to multiple engine builders trying to modify the same files. This PR introduces a coordinator that keeps track of finished and in-flight builds, and ensures that:

  • An engine for an elixir+otp pair is built once during the lifetime of the Expert instance, and reused upon project restarts
  • If multiple projects using the same versions request an engine at the same time, or while that version is being built, they all wait for the same, single builder to finish instead of starting new ones
  • Additionally, ensures engines for different versions can be built concurrently

Besides fixing that issue, it also cuts down startup time for Expert by a lot, since we builds the engine once instead of thrice(forge, engine, expert), once one engine finishes building the rest are instant.

@doorgan doorgan force-pushed the doorgan/deduplicate-engine-builder branch from 46c2f06 to bd7a165 Compare March 13, 2026 18:35
@doorgan doorgan force-pushed the doorgan/deduplicate-engine-builder branch from bd7a165 to 204b219 Compare March 13, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Build the engine once for every elixir+otp combination

1 participant