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

[vcpkg_download_distfile] always display output for downloading #40804

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/cmake/vcpkg_download_distfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,9 @@ If you do not know the SHA512, add it as 'SHA512 0' and re-run this command.")
WORKING_DIRECTORY "${DOWNLOADS}"
)

message("${output}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better instead to just not redirect output in the first place? (That is, remove OUTPUT_VARIABLE and ERROR_VARIABLE above entirely rather than reprinting it here?)

Should we get rid of the message call on line 239 now?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BillyONeal Thanks for the suggestion.

I think line 239 is still necessary and we can enclose the output like this, which could be better.

Suggested change
message("${output}")
if((NOT vcpkg_download_distfile_QUIET) OR (NOT "${error_code}" EQUAL "0"))
message("${output}")
endif()

After such a change, the log output is displayed when vcpkg_download_distfile_QUIET is off or error code is not zero.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After such a change, the log output is displayed when vcpkg_download_distfile_QUIET is off or error code is not zero.

Isn't the whole point of this change that we always want to display the output, even when the exit code is zero?


if(NOT "${error_code}" EQUAL "0")
message("${output}")
z_vcpkg_download_distfile_show_proxy_and_fail("${error_code}")
endif()
endif()
Expand Down