-
Notifications
You must be signed in to change notification settings - Fork 283
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 new ways to report build failures and giving hint messages from portfile.cmake #1016
base: main
Are you sure you want to change the base?
Add new ways to report build failures and giving hint messages from portfile.cmake #1016
Conversation
src/vcpkg/build.cpp
Outdated
result.user_required_interaction = fs.read_contents(user_required_path, VCPKG_LINE_INFO); | ||
} | ||
const auto user_hints_path = buildpath / Strings::concat("user-hints-", action.spec.triplet(), ".txt"); | ||
if (fs.exists(user_hints_path, VCPKG_LINE_INFO)) |
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.
Better make sure that it's a regular file
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.
Since it is only an internal interface I think it is ok here. Crashing in case of an folder is a good thing. And I don't care if someone wants to use symbolic links in the future.
# Conflicts: # src/vcpkg/build.cpp
First, I strongly agree we need to improve these cases. Better build error messages for users has tons of potential. I have a few different areas I wanted to comment on, so apologies in advance for the length. Restating CasesListing out some more error cases that the user can fix, along with the diagnostic difficulty:
Under this lens, I think your proposed mechanisms are intended to handle:
Instead of separating these two cases entirely, what about only having hints and, if hints are provided, reduce the prominence of the issue message? Implementation: Port vs ToolI see a design decision between putting the port in charge versus creating heuristics in the vcpkg tool. Port-based approaches are more easily iterated on, but are also very limiting. It is quite painful to try to regex through build logs from an "error handler" inside CMake (as we've done for some things). On the other hand, in the tool itself progress is slower and it often wouldn't be "worth it" to handle highly exceptional cases. A bonus of implementing things in the tool is that they get localized :). Port-approach Communication ChannelI'm not convinced that raw text known-paths in
Fortunately all these should be retrofit-able underneath a CMake function call interface (as you've implemented). |
Probably I should not hide the description in the docs PR: microsoft/vcpkg-docs#60 The motivation/difference of these two functions is the following:
|
Motivation 1: In cases like microsoft/vcpkg#30744 users should not create issues (problem was insufficient disk space). In
vcpkg_execute_build_process
we could add a call tovcpkg_fail_with_user_interaction_required
with a proper error message saying the disk is full.Motivation 2: increase visibility or warnings since users report issues like this: microsoft/vcpkg#30592 (comment) (
Could not find make. Please install it through your package manager.
) =>vcpkg_fail_with_user_interaction_required
. Another example would be microsoft/vcpkg#31276 or microsoft/vcpkg#31312 or microsoft/vcpkg#35151 or microsoft/vcpkg#36541 or microsoft/vcpkg#35991 or microsoft/vcpkg#36011Motivation 3: Many ports emits warnings like the following
This is confusing if the libs are already installed and the build is successful. These messages should only be printed when the build fails and they should be printed after the "how to report an issue" block to be more visible. =>
vcpkg_user_hint_on_failure
Also see docs PR microsoft/vcpkg-docs#60