[vcpkg_execute_required_process] check log file existence before reading#18290
Closed
alberthdev wants to merge 1 commit intomicrosoft:masterfrom
Closed
[vcpkg_execute_required_process] check log file existence before reading#18290alberthdev wants to merge 1 commit intomicrosoft:masterfrom
alberthdev wants to merge 1 commit intomicrosoft:masterfrom
Conversation
Check for the output log file existence before trying to read it. This edge case was hit in this scenario: if the command critically fails (e.g. the executable doesn't exist), the stdout file may be missing. When this occurs, CMake stops prematurely due to not being able to read the missing file. Desired behavior instead is to have this output its error message on process failure.
Contributor
|
It has been fixed in master now, see https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_execute_required_process.cmake#L113. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check for the output log file existence before trying to read it.
This edge case was hit in this scenario: if the command critically fails (e.g. the executable doesn't exist), the stdout file may be missing. When this occurs, CMake stops prematurely due to not being able to read the missing file.
Sample output of the behavior being addressed:
Desired behavior instead is to have this output its error message on process failure. Expected output instead:
Describe the pull request
What does your PR fix?
Helps with debugging issues reported in vcpkg_from_git fails when downloads folder does not exist #18291 - mainly addresses the above corner case and allows failing gracefully from it.
Which triplets are supported/not supported? Have you updated the CI baseline?
Supported for all (no specific platform changes here), No
Does your PR follow the maintainer guide?
Yes
If you have added/updated a port: Have you run
./vcpkg x-add-version --alland committed the result?Not applicable
Leaving as draft PR for now until discussion on this completes in related issue: #18291. Uncertain if this is the "right" place to fix this, or if the problem itself (not writing stdout on critical errors) needs to be addressed elsewhere.