Skip to content

Commit

Permalink
Logging gcc version, only confirming version if supplied version is u…
Browse files Browse the repository at this point in the history
…nempty
  • Loading branch information
saibulusu committed Jan 22, 2025
1 parent 0b481fc commit 0fa874a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel
{
await this.InstallGccAsync(this.CompilerVersion, telemetryContext, cancellationToken);

if (!await this.ConfirmGccVersionInstalledAsync(cancellationToken))
if (!string.IsNullOrEmpty(this.CompilerVersion) && !await this.ConfirmGccVersionInstalledAsync(cancellationToken))
{
throw new DependencyException($"'{this.CompilerName.ToLowerInvariant()}' compiler version '{this.CompilerVersion}' not confirmed.", ErrorReason.DependencyInstallationFailed);
}
Expand Down Expand Up @@ -267,6 +267,9 @@ private async Task InstallGccAsync(string gccVersion, EventContext telemetryCont
default:
throw new PlatformNotSupportedException($"This Linux distribution '{distro}' is not supported for this profile.");
}

// Log gcc version to telemetry
await this.ExecuteCommandAsync("gcc", "-dumpversion", Environment.CurrentDirectory, telemetryContext, cancellationToken);
}

private async Task RemoveAlternativesAsync(EventContext telemetryContext, CancellationToken cancellationToken)
Expand Down

0 comments on commit 0fa874a

Please sign in to comment.