Skip to content

fix(#4834)!: compose an open buffer's build request as the project snapshot does - #4846

Merged
octalide merged 2 commits into
devfrom
fix/4834
Oct 23, 2026
Merged

octalide merged 2 commits into
devfrom
fix/4834

Conversation

@octalide

@octalide octalide commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #4834

An open buffer under a project now composes its build request through the same code as the project snapshot, so the editor has one composition of a project's request.

Plan

  • project_build composes a project's request from its manifest and a ProjectSelection with request.compose for the check goal, as mach check does. snapshot_load and the buffer path (proj_ensure) both call it.
  • AnalysisRequest.build becomes selection: ProjectSelection. The loaded project is keyed on that selection (ProjKey holds owned copies of artifact, target and profile), and its request borrows those copies. That way the request stays the composed one across analyses, and the post-analysis reset to request.defaults() and the driver.reconfigure on reuse are deleted.
  • Regenerated doc/mach/lang/editor.md.

Target resolution is not involved. The selection's target is passed through as the snapshot already does, so manifest.resolve_declared is not touched.

Decisions

  • A file under no manifest keeps explicit options. A loose file has no profile to compose from, so AnalysisRequest keeps standalone_build (default request.defaults()) beside standalone_target. A project's options are never taken from it. The one test that set build.opt on a standalone buffer now sets standalone_build.opt.
  • Breaking, labelled major. Composition runs profiles_check and the selected profile's pass, skip and relax lists. So an open buffer's analysis now refuses a manifest that mach check refuses, such as an unknown pass name in any profile, where the default request accepted it.
  • Key on the selection, not the composed request. The composed request depends only on the manifest and the selection, and the manifest is read again whenever the project reloads.

Ran

b check . was clean. b test . --filter lang.editor --timeout 5m passed 50 of 50. b fmt --check . and the committed-reference diff were also clean.

…apshot does

An open buffer under a project was analyzed under request.defaults(), so it
ignored the selected profile while the project snapshot applied it. Both now
compose through project_build, which runs request.compose for the check goal
as `mach check` does. AnalysisRequest carries a ProjectSelection in place of
a BuildRequest, the loaded project is keyed on that selection, and its
request stays the composed one across analyses, so the post-analysis reset
to defaults and the reconfigure on reuse are gone. A file under no manifest
keeps its explicit options as standalone_build.

Breaking: an open buffer's analysis now refuses a manifest whose profiles
`mach check` refuses, which the default request accepted.
@octalide octalide added the major Breaking change requiring consumer updates label Oct 23, 2026
@octalide octalide changed the title fix(#4834): compose an open buffer's build request as the project snapshot does fix(#4834)!: compose an open buffer's build request as the project snapshot does Oct 23, 2026
@octalide octalide added fix Bug fix or defect resolution tooling Build systems, workflows, CI/CD, and developer tooling labels Oct 23, 2026
@octalide
octalide marked this pull request as ready for review October 23, 2026 22:56
@octalide
octalide marked this pull request as draft October 23, 2026 22:56
@octalide
octalide marked this pull request as ready for review October 23, 2026 23:08
@octalide
octalide added this pull request to the merge queue Oct 23, 2026
Merged via the queue into dev with commit b9bcd09 Oct 23, 2026
6 checks passed
@octalide
octalide deleted the fix/4834 branch October 23, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix or defect resolution major Breaking change requiring consumer updates tooling Build systems, workflows, CI/CD, and developer tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor: an open buffer is analyzed under default settings while the project snapshot takes the profile's

1 participant