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

Extend LIBRARY_PATH as well as LD_LIBRARY_PATH on Linux #909

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tyrken
Copy link

@tyrken tyrken commented Jul 12, 2024

Description:

On Linux we already set LD_LIBRARY_PATH to the lib folder under the extracted Python, to allow running apps to find libPython and other libraries. This is not enough to let gcc find those libraries during compilation, e.g. as some Python dependencies do when installing. For this we also need to add the lib folder to the LIBRARY_PATH env-var.

Related issue:
Should fix #275
Not sure if the suggestion to override AGENT_TOOLSDIRECTORY for Linux if the existing advanced-docs is needed any more. It certainly didn't work for me and between the two *LIBRARY_PATH env-vars that should be enough.

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@tyrken tyrken marked this pull request as ready for review July 12, 2024 20:18
@tyrken tyrken requested a review from a team as a code owner July 12, 2024 20:18
@tyrken
Copy link
Author

tyrken commented Jul 12, 2024

While this PR has been tested and Works-For-Me (tm), actions/python-versions#275 sounds like it would be a better fix if it works as advertised, gets released & the pythons rebuilt...

if (!libPath.split(':').includes(pyLibPath)) {
core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath);
}
ensurePathInEnvVar('LIBRARY_PATH', pyLibPath);
Copy link

@jaswanthikolla jaswanthikolla Jul 19, 2024

Choose a reason for hiding this comment

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

TBH, I wouldn't go with the route of LD_LIBRARY_PATH as some systems ( including containers) doesn't allow it as it's a security issue.

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.

ld: cannot find -lpython3.10
2 participants