From 0fa874aefbc1272cbfd8e94db49f60dbff3cff7a Mon Sep 17 00:00:00 2001 From: saibulusu Date: Wed, 22 Jan 2025 15:11:06 -0800 Subject: [PATCH] Logging gcc version, only confirming version if supplied version is unempty --- .../VirtualClient.Dependencies/CompilerInstallation.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/VirtualClient/VirtualClient.Dependencies/CompilerInstallation.cs b/src/VirtualClient/VirtualClient.Dependencies/CompilerInstallation.cs index 4046c60bf..381949ef5 100644 --- a/src/VirtualClient/VirtualClient.Dependencies/CompilerInstallation.cs +++ b/src/VirtualClient/VirtualClient.Dependencies/CompilerInstallation.cs @@ -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); } @@ -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)