Skip to content

fix(#4849): own a project snapshot's selection strings - #4853

Merged
octalide merged 2 commits into
devfrom
fix/4849
Oct 24, 2026
Merged

octalide merged 2 commits into
devfrom
fix/4849

Conversation

@octalide

@octalide octalide commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #4849

The snapshot owns copies of what its loaded project keeps past project_open: the artifact, target and profile strings (a ProjKey, shared with the loaded-project path through proj_key_capture and proj_key_free, which now take an allocator) and the root. driver.begin_build_impl sets p.req.project_root = project_root, and root_analyze sets rooted.project_root = root, so the project held the caller's req.root. The request is now built from the copies, all freed in project_dnit. The buffer array and buffer paths stay borrowed only during the call.

Ran: bootstrap.sh build, mach check . and mach fmt --check . clean. No new tests.

Decisions

  • key is a private ProjKey and root a plain owned str beside it. The loaded-project path already owns its root separately, so the root is not folded into ProjKey. No new pub declaration.
  • The copies are made in project_open before the load and freed in project_dnit after the project.

@octalide
octalide marked this pull request as ready for review October 24, 2026 01:35
@octalide
octalide added this pull request to the merge queue Oct 24, 2026
Merged via the queue into dev with commit e820858 Oct 24, 2026
6 checks passed
@octalide
octalide deleted the fix/4849 branch October 24, 2026 01:54
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.

Editor: a project snapshot borrows its selection strings past project_open

1 participant