Skip to content
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

Get exit code of 0 with --only-downloads option #714

Merged

Conversation

klalumiere
Copy link
Contributor

Without this fix

#697 changed vcpkg's behavior.

It used to be possible to call $VCPKG_ROOT/vcpkg install --only-downloads and get an exit code of 0. This could be useful to, for instance, download dependencies' sources in order to scan them with Snyk.

After #697, the exit code is now 1, and the GitHub Workflow fails before the Snyk scan.

With this fix

I do not change the behavior of --keep-going, but I re-establish the original behavior of --only-downloads. Hence, $VCPKG_ROOT/vcpkg install --only-downloads succeeds with the exit code 0.

I tested that the fix behaves as expected manually, making sure that I get an exit code of 1 without the fix and an exit code of 0 with the fix.

c.c. @ras0219-msft from #697 and @BillyONeal from our discussion on Discord.

@ras0219-msft
Copy link
Contributor

Thanks for the PR! I think the direction of this change is broadly good (--only-downloads clearly shouldn't consider "I only downloaded" as a failure) -- though I also want to suggest the workaround of ./vcpkg || true

@klalumiere
Copy link
Contributor Author

Yeah, I thought about ./vcpkg || true, but it would be a bit problematic, so I see it as a last resort (that would have to come with a bit of hacking).

The problem is that there is some good reasons for vcpkg install --only-downloads to fail, and we sometimes encounter some of these failures. For instance, people sometimes use overrides that are not available within the context in which we run vcpkg install --only-downloads. Hence, we get a failure in those cases, which is a good thing. I'm confident that there are other reasons why the command could fail that I can't imagine right now.

If I were to use the last resort || true, I guess I would add a script that would do a check along the lines of is there at least 100 subfolders in the folder buildtrees. That would be in order to know that the only-downloads step worked. This is not ideal (it doesn't really check if the only-download step worked).

@BillyONeal BillyONeal merged commit 0b8db7e into microsoft:main Sep 26, 2022
@BillyONeal
Copy link
Member

Thanks!

@klalumiere klalumiere deleted the only_downloads_succeeds_when_keep_going branch September 28, 2022 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants