From a4235dbd38fc552c3c66d4c8edbf4ebbf33c6fd9 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 15 Aug 2023 11:37:55 +0200 Subject: [PATCH 1/2] Fix perl issue --- azure-pipelines.yml | 13 +++++++++++++ global.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d7b49c26c32..b30aa7cd8da 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -142,6 +142,8 @@ stages: /p:PublishToSymbolServer=true /p:VisualStudioDropName=$(VisualStudioDropName) /p:GenerateSbom=true + env: + NativeToolsOnMachine: true - script: .\tests\EndToEndBuildTests\EndToEndBuildTests.cmd -c $(_BuildConfig) displayName: End to end build tests - task: PublishTestResults@2 @@ -335,6 +337,8 @@ stages: clean: true - script: eng\CIBuild.cmd -compressallmetadata -configuration Release /p:FSharpLangVersion=preview + env: + NativeToolsOnMachine: true displayName: Build - task: PublishBuildArtifacts@1 @@ -361,6 +365,8 @@ stages: clean: true - script: eng\CIBuild.cmd -compressallmetadata -configuration Release /p:AdditionalFscCmdFlags=--strict-indentation+ + env: + NativeToolsOnMachine: true displayName: Build - task: PublishBuildArtifacts@1 @@ -418,9 +424,13 @@ stages: # yes, this is miserable, but - https://github.com/dotnet/arcade/issues/13239 - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) + env: + NativeToolsOnMachine: true displayName: Build / Test condition: ne(variables['_testKind'], 'testIntegration') - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) + env: + NativeToolsOnMachine: true displayName: Build / Integration Test continueOnError: true condition: eq(variables['_testKind'], 'testIntegration') @@ -572,6 +582,7 @@ stages: clean: true - script: .\Build.cmd -c Release -pack env: + NativeToolsOnMachine: true FSHARP_EXPERIMENTAL_FEATURES: $(_experimental_flag) - script: .\tests\EndToEndBuildTests\EndToEndBuildTests.cmd -c Release env: @@ -702,6 +713,8 @@ stages: - script: dotnet --list-sdks displayName: Report dotnet SDK versions - script: .\Build.cmd $(_kind) -pack -c $(_BuildConfig) + env: + NativeToolsOnMachine: true displayName: Initial build and prepare packages. - script: $(Build.SourcesDirectory)/tests/AheadOfTime/Trimming/check.cmd displayName: Build, trim, publish and check the state of the trimmed app. diff --git a/global.json b/global.json index c74071e3997..6d6c74eeabd 100644 --- a/global.json +++ b/global.json @@ -15,7 +15,7 @@ "xcopy-msbuild": "17.6.0-2" }, "native-tools": { - "perl": "latest" + "perl": "5.38.0.1" }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23411.1", From 2966bcd4c230c2fcb16517d2dce1525a5290a4ee Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 15 Aug 2023 12:21:57 +0200 Subject: [PATCH 2/2] Fix local running of fsharpqa stuff --- eng/Build.ps1 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 88a2d0a4340..3be5cf44a23 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -514,6 +514,14 @@ try { TryDownloadDotnetFrameworkSdk $nativeTools = InitializeNativeTools + + if (-not (Test-Path variable:NativeToolsOnMachine)) { + $env:PERL5Path = Join-Path $nativeTools "perl\5.38.0.1\perl\bin\perl.exe" + write-host "variable:NativeToolsOnMachine = unset or false" + $nativeTools + write-host "Path = $env:PERL5Path" + } + $dotnetPath = InitializeDotNetCli $env:DOTNET_ROOT = "$dotnetPath" Get-Item -Path Env: @@ -592,7 +600,15 @@ try { $env:FSCOREDLLPATH = "$ArtifactsDir\bin\fsc\$configuration\net472\FSharp.Core.dll" $env:LINK_EXE = "$RepoRoot\tests\fsharpqa\testenv\bin\link\link.exe" $env:OSARCH = $env:PROCESSOR_ARCHITECTURE - Exec-Console "perl.exe" """$RepoRoot\tests\fsharpqa\testenv\bin\runall.pl"" -resultsroot ""$resultsRoot"" -results $resultsLog -log $errorLog -fail $failLog -cleanup:no -procs:$env:NUMBER_OF_PROCESSORS" + + if (-not (Test-Path variable:NativeToolsOnMachine)) { + Exec-Console $env:PERL5Path """$RepoRoot\tests\fsharpqa\testenv\bin\runall.pl"" -resultsroot ""$resultsRoot"" -results $resultsLog -log $errorLog -fail $failLog -cleanup:no -procs:$env:NUMBER_OF_PROCESSORS" + } + else + { + Exec-Console "perl.exe" """$RepoRoot\tests\fsharpqa\testenv\bin\runall.pl"" -resultsroot ""$resultsRoot"" -results $resultsLog -log $errorLog -fail $failLog -cleanup:no -procs:$env:NUMBER_OF_PROCESSORS" + } + write-host "Exec-Console finished" Pop-Location }