-
Notifications
You must be signed in to change notification settings - Fork 287
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
Don't fail on non-existant already installed ports. #516
Don't fail on non-existant already installed ports. #516
Conversation
Error msg was also wrong.
Do you have ideas on writing an end to end test for this to ensure we don't break it again in the future? |
Yesterday vcpkg failed for me on non-existent already installed port feature... |
@BillyONeal
but you could just have empty ports A and B without any dependencies.
@dg0yt: |
For testing non-existant ports: They also come when first installing from overlay-ports, then installing a regular port.
Just reported this for completeness. |
@BillyONeal: What is the internal status of this PR? |
No specific / different "internal" state. (The only internal things going on here are those which touch code signing for hopefully apparent reasons :) ) I didn't merge this before because I didn't have a good understanding of the impact: this effectively completely removes error handling out from underneath all dependency resolution etc. which may be important. It is likely that the correct fix is to prevent getting to this place in the first place rather than yanking the error handling. An e2e test would be helpful if you'd be willing to add one although I don't think that's the limiting "reactant" right now. |
That would be a bug in vcpkg using this function. Since the return value is
If you tell me which case you are afraid of. |
Right, but that makes the impact of this review on a ton of code that is not in the review, which is difficult to analyze without a good understanding of the surrounding code, which I do not have.
I mean for the bug you're actually fixing. |
I don't understand. The test is already there?:
|
Ah I thought that was just fixing my stupidity since we talked about that in this thread 😅 |
Ok, with this change (44b6add) on Linux I get:
A design question we need to answer is where (if anywhere) should vcpkg behave differently between malformed ports versus missing ports? Today, overlays have this difference (missing port means go to next overlay, malformed port means halt with error). Overlays don't call this API so it doesn't directly impact the needed contract, but I'm not confident that this is always the case. Assuming that baselines should never act differently in this case, I think the right fix is that |
I think from the errors it is clear that you still get: |
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.
I think it's very important that the specific error information is properly propagated. It's pretty user hostile to say "unable to get baseline for port zlib; pass --debug to get the actual error message" when we have it right there and there's no compelling reason to not display it.
I've pushed a change that does this:
$ vcpkg install curl
Computing installation plan...
Error: while loading control file for zlib:x64-linux:
Error: while loading /workspaces/vcpkg-tool/vcpkg/ports/zlib/vcpkg.json:
:6:38: error: Trailing comma in an object
on expression: "homepage": "https://www.zlib.net/",
^
Please run "./vcpkg remove zlib:x64-linux" and re-attempt.
note: updating vcpkg by rerunning bootstrap-vcpkg may resolve this failure.
And it removes the non-essential error messages in unrelated paths:
$ vcpkg install rapidjson
Computing installation plan...
The following packages are already installed:
rapidjson[core]:x64-linux -> 2020-09-14#2
rapidjson:x64-linux is already installed
Plus a test to ensure that there are no error messages displayed on the unrelated path. LGTM with this additional testing and change.
993d67b
to
6e1fed0
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.
LGTM provided that the loop actually is tested to work
Thanks everyone! I actually made sure to exercise the code and it works now :) |
The error msg is also never helpful.
fixes microsoft/vcpkg#24302
fixes microsoft/vcpkg#15836 (again)