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

Compiler Installation Ubuntu 24 fix #337

Merged
merged 12 commits into from
Jul 3, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public async Task CompilerInstallationRunsTheExpectedWorkloadCommandInLinuxForGc
$"--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-123 " +
$"--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-123 " +
$"--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-123",
"sudo update-alternatives --remove-all cpp",
RakeshwarK marked this conversation as resolved.
Show resolved Hide resolved
"sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-123 1230",
};

RakeshwarK marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -109,7 +110,7 @@ public async Task CompilerInstallationRunsTheExpectedWorkloadCommandInLinuxForGc
await compilerInstallation.ExecuteAsync(CancellationToken.None).ConfigureAwait(false);
}

Assert.AreEqual(7, commandExecuted);
Assert.AreEqual(8, commandExecuted);
RakeshwarK marked this conversation as resolved.
Show resolved Hide resolved
}

[Test]
Expand Down Expand Up @@ -252,6 +253,7 @@ public async Task CompilerInstallationInLinuxDefaultsToGcc10()
$"--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 " +
$"--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10 " +
$"--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-10",
"sudo update-alternatives --remove-all cpp",
"sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-10 100",
};

Expand Down Expand Up @@ -285,7 +287,7 @@ public async Task CompilerInstallationInLinuxDefaultsToGcc10()
await compilerInstallation.ExecuteAsync(CancellationToken.None).ConfigureAwait(false);
}

Assert.AreEqual(7, commandExecuted);
Assert.AreEqual(8, commandExecuted);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ private async Task SetGccPriorityAsync(string gccVersion, EventContext telemetry

await this.ExecuteCommandAsync("update-alternatives", updateAlternativeArgument, Environment.CurrentDirectory, telemetryContext, cancellationToken);

// Remove all existing alternatives for cpp before the subsequent "update-alternatives" of cpp
await this.ExecuteCommandAsync("update-alternatives", "--remove-all cpp", Environment.CurrentDirectory, telemetryContext, cancellationToken);

// For some update path, the cpp can't be update-alternative by a gcc, so needs a separate call.
string updateAlternativeArgumentCpp = $"--install /usr/bin/cpp cpp /usr/bin/cpp-{gccVersion} {gccVersion}0";

Expand Down
Loading