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 scripts] enable patchelf on windows for cross-compiling toolchains #41578

Merged
merged 1 commit into from
Oct 17, 2024
Merged
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
13 changes: 12 additions & 1 deletion scripts/cmake/vcpkg_find_acquire_program(PATCHELF).cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(program_name patchelf)
set(program_version 0.14.5)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
set(program_version 0.14.5)
Copy link
Contributor

Choose a reason for hiding this comment

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

Note for reviewers: the previous update attempt was in #31107 and no new releases happened after that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i didn't try any update for linux, this is the previous version confirmed.

the windows version (newer) is still untested, i am building the pipeline and upstreaming everything possible as soon as i can

vcpkg_execute_in_download_mode(COMMAND "uname" "-m" OUTPUT_VARIABLE HOST_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
if(HOST_ARCH STREQUAL "aarch64")
set(patchelf_platform "aarch64")
Expand All @@ -16,4 +16,15 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
set(download_urls "https://github.com/NixOS/patchelf/releases/download/${program_version}/${download_filename}")
set(tool_subdirectory "${program_version}-${patchelf_platform}-linux")
set(paths_to_search "${DOWNLOADS}/tools/patchelf/${program_version}-${patchelf_platform}-linux/bin")
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(patchelf_host "win32")
set(program_version 0.18.0)
Copy link
Member

Choose a reason for hiding this comment

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

@cenit, thanks for your PR. From PR #31107, there are some issues with version 0.18.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

still better than erroring out because it's missing? i didn't update the linux version, i just added a windows one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as a side note, there is no 0.14.5 version of patchelf for windows. The first version that was built for windows is 0.17.0, so since I had to choose one, I went for the newest one

set(download_sha512
"19d24f64bea6d6236292455a09695d289ddca71433a0ccaf372f57da80a4cde5db1c375ac8e29a41ac1f0676b7d3b56ce5b2baf39e58369c4f741b612db51044")
set(download_filename "${program_name}-${patchelf_host}-${program_version}.exe")
set(download_urls "https://github.com/NixOS/patchelf/releases/download/${program_version}/${download_filename}")
set(tool_subdirectory "${program_version}-${patchelf_host}")
set(paths_to_search "${DOWNLOADS}/tools/patchelf/${program_version}-${patchelf_host}/")
set(raw_executable ON)
set(rename_binary_to "patchelf.exe")
endif()
Loading