mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-09 12:52:20 +02:00
Inject LD_LIBRARY_PATH library path into Python manifest install and setup (#144)
* Adding LD_LIBRARY_PATH env var to both setup and install tasks * Rebuild dist/index.js * Fixed some typos in contributors.md Markdown
This commit is contained in:
parent
c181ffa198
commit
878156f1de
4 changed files with 33 additions and 2 deletions
|
@ -9,6 +9,7 @@ import * as core from '@actions/core';
|
|||
import * as tc from '@actions/tool-cache';
|
||||
|
||||
const IS_WINDOWS = process.platform === 'win32';
|
||||
const IS_LINUX = process.platform === 'linux';
|
||||
|
||||
// Python has "scripts" or "bin" directories where command-line tools that come with packages are installed.
|
||||
// This is where pip is, along with anything that pip installs.
|
||||
|
@ -109,6 +110,18 @@ async function useCpythonVersion(
|
|||
}
|
||||
|
||||
core.exportVariable('pythonLocation', installDir);
|
||||
|
||||
if (IS_LINUX) {
|
||||
const libPath = process.env.LD_LIBRARY_PATH
|
||||
? `:${process.env.LD_LIBRARY_PATH}`
|
||||
: '';
|
||||
const pyLibPath = path.join(installDir, 'lib');
|
||||
|
||||
if (!libPath.split(':').includes(pyLibPath)) {
|
||||
core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath);
|
||||
}
|
||||
}
|
||||
|
||||
core.addPath(installDir);
|
||||
core.addPath(binDir(installDir));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue