-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Add VCPKG_(PRE|POST)_PORTFILE_INCLUDES for code injection before/after the portfile #25847
Add VCPKG_(PRE|POST)_PORTFILE_INCLUDES for code injection before/after the portfile #25847
Conversation
Now that we have |
bb632f9
to
94b9e2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BillyONeal
@data-queue
@JavierMatosD
@ras0219-msft
@vicroms
We discussed this PR during our meeting and have the following comments to make:
-
Post-portfile injection is interesting for the example use case you mentioned (reproducible builds).
-
Pre-portfile injection we don't see a motivation right now. Do you have a definitive use case in mind? Otherwise, we would like to wait until we have a use case for it.
-
We noticed that pre-injection runs after port configs are included. So it might be used to override helper functions (but that can be done already with port overlays).
-
All files included in
VCPKG_POST_PORTFILE_INCLUDES
should be "laundered" and hashed through the tool. The vcpkg tool should read the variable to validate the files, hash them, and then reinject them into the process (maybe using aZ_VCPKG_UGLY_NAME
variable) so that the specified files are not changed during the build (for example, byportfile.cmake
). -
This needs the usual documentation and tests.
Installing https://cmake.org/cmake/help/latest/command/variable_watch.html Lines 24 to 125 in 14b9179
without needing to use --x-scripts-root and copying all of the scripts to a different directory.
Wasn't the idea. The idea was to inject directly before/after the portfile as the name of the variable suggest. Some stuff does not work in the triplet (e.g. using |
Can you show an example where someone would want to do that? |
I cannot show an example I also noticed that overriding |
Overriding |
Can be done in the triplet. |
Thanks! |
This is basically needed for reproduceable builds. This allows injection of code which changes the created binaries to not have timestamps etc or implement further user controlled checks and policies.
The pre part is needed if the triplet ever gets changed to something easier to parse which is not cmake ;)
probably needs changes to vcpkg-tool to hash these additional files.
docs pr: microsoft/vcpkg-docs#336
tool pr: microsoft/vcpkg-tool#1417
Z_VCPKG_POST_PORTFILE_INCLUDES
in ports.cmake after tool has been updated.