Skip to content

Commit

Permalink
Use older compiler for python <3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoH2O1999 committed Jan 17, 2023
1 parent 48d898d commit a262dbd
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/builder/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,19 @@ export default class LinuxBuilder extends Builder {

protected async prepareEnvironment(): Promise<void> {
core.startGroup('Installing dependencies');

// Install dependencies

await exec.exec('sudo apt install -y', ubuntuDependencies);

// Use gcc-10 for python versions <3.7

if (semver.lt(this.specificVersion, '3.7.0')) {
core.info('Detected version <3.7. An older compiler will be used...');
await exec.exec('sudo apt install gcc-10');
process.env['CC'] = 'gcc-10';
}

core.endGroup();
}

Expand All @@ -103,11 +115,6 @@ export default class LinuxBuilder extends Builder {
);
core.info(`Creating symlink from ${pythonExecutable} to ${binExecutable}`);
fs.symlinkSync(pythonExecutable, binExecutable);
core.info('Creating pip symlink...');
const pipPath = path.join(installedPath, 'bin', 'pip3');
const targetPip = path.join(installedPath, 'pip');
core.info(`Creating symlink from ${pipPath} to ${targetPip}`);
fs.symlinkSync(pipPath, targetPip);

// Adding executable bits
const executables = [
Expand Down

0 comments on commit a262dbd

Please sign in to comment.