@@ -91070,13 +91070,9 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
91070
91070
core.exportVariable('Python3_ROOT_DIR', installDir);
91071
91071
core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');
91072
91072
if (utils_1.IS_LINUX) {
91073
- const libPath = process.env.LD_LIBRARY_PATH
91074
- ? `:${process.env.LD_LIBRARY_PATH}`
91075
- : '';
91076
91073
const pyLibPath = path.join(installDir, 'lib');
91077
- if (!libPath.split(':').includes(pyLibPath)) {
91078
- core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath);
91079
- }
91074
+ ensurePathInEnvVar('LIBRARY_PATH', pyLibPath);
91075
+ ensurePathInEnvVar('LD_LIBRARY_PATH', pyLibPath);
91080
91076
}
91081
91077
core.addPath(installDir);
91082
91078
core.addPath(_binDir);
@@ -91099,6 +91095,15 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
91099
91095
});
91100
91096
}
91101
91097
exports.useCpythonVersion = useCpythonVersion;
91098
+ /** Ensure a folder is present in a colon-separated env-var */
91099
+ function ensurePathInEnvVar(envVarName, extraPath) {
91100
+ const currentPath = process.env[envVarName]
91101
+ ? `:${process.env[envVarName]}`
91102
+ : '';
91103
+ if (!currentPath.split(':').includes(extraPath)) {
91104
+ core.exportVariable(envVarName, extraPath + currentPath);
91105
+ }
91106
+ }
91102
91107
/** Convert versions like `3.8-dev` to a version like `~3.8.0-0`. */
91103
91108
function desugarDevVersion(versionSpec) {
91104
91109
const devVersion = /^(\d+)\.(\d+)-dev$/;
0 commit comments