-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Refine rpath fixup to inspect already existing rpaths #36056
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@dg0yt Any idea why |
I guess the problem is related to the fact that vfap is unable to parse the version from the program's output, and that's why it even doesn't accept its own previous download. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Nope was a problem with the test. It simply set the variable to empty resulting in unexpected behavior |
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 with string manipulation test(s)
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.
Can we have x64-linux-dynamic CI run with these changes?
@@ -169,8 +171,8 @@ if(CMD STREQUAL "BUILD") | |||
|
|||
include("${CURRENT_PORT_DIR}/portfile.cmake") | |||
if(DEFINED PORT) | |||
if(VCPKG_FIXUP_ELF_RPATH) | |||
include("${SCRIPTS}/cmake/z_vcpkg_fixup_rpath.cmake") | |||
if(VCPKG_FIXUP_ELF_RPATH OR VCPKG_TARGET_IS_LINUX) |
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.
if(VCPKG_FIXUP_ELF_RPATH OR VCPKG_TARGET_IS_LINUX) | |
if(VCPKG_FIXUP_ELF_RPATH) |
or
if(VCPKG_FIXUP_ELF_RPATH OR VCPKG_TARGET_IS_LINUX) | |
if(VCPKG_FIXUP_ELF_RPATH AND VCPKG_TARGET_IS_LINUX) |
Otherwise I don't see how VCPKG_FIXUP_ELF_RPATH
makes sense anymore.
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.
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 I was assuming it would be fixed to not apply to static triplets in my comment.
execute_process( | ||
COMMAND "${PATCHELF}" --set-rpath "${rpath}" "${elf_file}" | ||
COMMAND "${PATCHELF}" --set-rpath "${new_rpath}" "${elf_file}" | ||
OUTPUT_QUIET | ||
ERROR_VARIABLE set_rpath_error |
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.
ERROR_VARIABLE set_rpath_error |
Or keep the error check in case patchelf for some reason couldn't fix our binary for some reason.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Should I retrigger CI or should i wait for further review? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
…e actually need it. In microsoft#36056 , things were changed to unconditionally patchelf when targeting Linux. Unfortunately that broke --only-downloads a lot of the time. This fixes that.
* print compiler path * update messages.json * fix empty message * fix format * add tests and fix * update vcpkg to latest commit * fix * fix * Fix e2e test on Windows. * Change scripts SHA to not include microsoft/vcpkg#36056 --------- Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
…ATH (#37129) ... and don't fetch patchelf unless we actually need it. For example cmake helper ports have no need to fetch patchelf. In #36056 , things were changed to unconditionally patchelf when targeting Linux. Unfortunately that broke --only-downloads a lot of the time. This fixes that. Also contains @Osyotr 's fixes from #37190 to coalesce world rebuilds a bit, so repeating comments from there: Fixes #37183 Towards #25668
# lib relative corrections | ||
list(TRANSFORM rpath_norm REPLACE "${current_prefix}/lib/?" "\$ORIGIN/${relative_to_lib}/") | ||
list(TRANSFORM rpath_norm REPLACE "${current_installed_prefix}/lib/?" "\$ORIGIN/${relative_to_lib}/") | ||
list(TRANSFORM rpath_norm REPLACE "${current_prefix}/lib/?" "\$ORIGIN/${relative_to_lib}/") | ||
list(TRANSFORM rpath_norm REPLACE "${current_installed_prefix}/lib/?" "\$ORIGIN/${relative_to_lib}/") | ||
# prefix relativ | ||
list(TRANSFORM rpath_norm REPLACE "${current_prefix}" "\$ORIGIN/${relative_to_prefix}/") | ||
list(TRANSFORM rpath_norm REPLACE "${current_installed_prefix}" "\$ORIGIN/${relative_to_prefix}/") | ||
list(TRANSFORM rpath_norm REPLACE "${current_prefix}" "\$ORIGIN/${relative_to_prefix}/") | ||
list(TRANSFORM rpath_norm REPLACE "${current_installed_prefix}" "\$ORIGIN/${relative_to_prefix}/") |
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.
@Neumann-A I may be overlooking the obvious: Is there a reason why each line occurs twice? AFAICS they cannot match twice. Every match inserts $ORIGIN
, and then it cannot have a second insertion.
Reason:
needed
$ORIGIN/../../../../intel64/
in there which came from a pc file via-Wl,-rpath='${libdir}'