@@ -91070,13 +91070,9 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
9107091070            core.exportVariable('Python3_ROOT_DIR', installDir);
9107191071            core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');
9107291072            if (utils_1.IS_LINUX) {
91073-                 const libPath = process.env.LD_LIBRARY_PATH
91074-                     ? `:${process.env.LD_LIBRARY_PATH}`
91075-                     : '';
9107691073                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);
9108091076            }
9108191077            core.addPath(installDir);
9108291078            core.addPath(_binDir);
@@ -91099,6 +91095,15 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
9109991095    });
9110091096}
9110191097exports.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+ }
9110291107/** Convert versions like `3.8-dev` to a version like `~3.8.0-0`. */
9110391108function desugarDevVersion(versionSpec) {
9110491109    const devVersion = /^(\d+)\.(\d+)-dev$/;
0 commit comments