-
Notifications
You must be signed in to change notification settings - Fork 339
Editable in manifest mode #1868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@microsoft-github-policy-service agree company="Adobe" |
To allow incremental builds, it is important to touch only files (especially headers) that have been effectively modified. To do so, this commit does the following changes: - when executing the install plan, do not fully remove a package if it is planned to be reinstalled right after. Instead, compute the diff of files to remove only those that are not present in the new version. - when copying files to the install tree, use a new mode update_if_different similar to copy_if_different, which copies a file only if its contents differ from the destination file. This behavior should be gated behind an option (maybe enabled only for editable ports) as it can lead to incorrect behavior since ports could end up including headers from the install tree rather than their source tree.
2639150 to
1c5bfcc
Compare
Working Proof of Concept (POC)Here is a working POC demonstrating the proposed workflow. By adding the following to "editable-ports": {
"path": "editable-ports",
"ports": [
"libpng"
]
}You get a directory in
Internal LogicWe defined 3 new internal variables:
This is a POC to drive future discussions and enhancements, but it proves the feasibility of this approach and outlines what is needed. Capabilities
Current Limitations
All of these cases can be enhanced, but the priority was to demonstrate that this is a viable technical direction. |
By staging the removed files in a temporary folder, restoring them after install if they are unchanged.
Better initial abi hash for editable source Cleanups
Updates
This fixes the Dirty Install State and Global Flag point described before. |
Updates
Limitations left:
|
Proposed Workflow ("Editable Mode")
I propose a formal "Editable" workflow integrated into Manifest Mode.
This is an ongoing draft of my initial experimentations and is not (yet) a functional proposal.
1. Setup
I am working on
MyProjdefined byvcpkg.json.2. Materialization
I signal to vcpkg that
zlibshould be editable (via a command, environment variable, or configuration).Expected outcome:
zlibbased on the current manifest, fetches the source (preferably viagit cloneto preserve history, or source extraction), and places it in a local user-writable directory (e.g.,./vcpkg_edits/zlib).zlibport, effectively creating a temporary local overlay.3. Iteration
./vcpkg_edits/zlib.MyProj(e.g.,cmake --build .).Crucial Change (The "Dirty Build"):
MyProj) that a dependency has changed, triggering a non-standard incremental build/re-link of the consumer project against the updated binary.4. Completion
I validate my changes. I can then commit the changes (if git history was preserved or added) or generate a patch. I disable the editable state, and vcpkg returns to strict manifest compliance.
The Golden Rule: "Whatever happens in editable mode, stays in editable mode." No impact on CI, registry, shared code. Local only.