From 04f2dbdbb3c93d72e42ed44af8648d08c05e9f68 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 28 May 2024 07:24:18 +0000 Subject: [PATCH 1/3] Fix full source-build product build when running R2R See https://github.com/dotnet/source-build/issues/4410 When building from source, we must set the RuntimeIdentifier property explicitly as otherwise the SDK defaults to the portable RID. Also make the SDK aware of the R2R build by updating the Known* items in Directory.Build.targets and remove the AspNetCore framework references. --- Directory.Build.targets | 26 +++++++++++++++++++ azure-pipelines-PR.yml | 6 ++++- azure-pipelines.yml | 4 +++ buildtools/AssemblyCheck/AssemblyCheck.fsproj | 2 +- buildtools/fslex/fslex.fsproj | 2 +- buildtools/fsyacc/fsyacc.fsproj | 2 +- eng/SourceBuild.props | 4 +-- src/fsc/fscProject/fsc.fsproj | 2 +- src/fsi/fsiProject/fsi.fsproj | 2 +- 9 files changed, 42 insertions(+), 8 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index cd863377199..91ccc4be1fa 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -21,4 +21,30 @@ + + + + + %(RuntimePackRuntimeIdentifiers);$(TargetRid) + + + %(RuntimePackRuntimeIdentifiers);$(TargetRid) + + + %(Crossgen2RuntimeIdentifiers);$(TargetRid) + + + %(AppHostRuntimeIdentifiers);$(TargetRid) + + + + + diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index be8dc94eca5..ccc308b9245 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -209,6 +209,10 @@ stages: enablePublishBuildAssets: true enablePublishUsingPipelines: $(_PublishUsingPipelines) enableSourceBuild: true + sourceBuildParameters: + platforms: + - name: Linux_x64 + targetRID: linux-x64 enableTelemetry: true helixRepo: dotnet/fsharp jobs: @@ -722,4 +726,4 @@ stages: targetPath: './artifacts/log/Release/AheadOfTime/Trimming/' artifactName: 'Trim Test Logs Attempt $(System.JobAttempt) Logs $(_kind)' continueOnError: true - condition: always() \ No newline at end of file + condition: always() diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e0c4349b26b..355afef3924 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -100,6 +100,10 @@ extends: enablePublishBuildAssets: true enablePublishUsingPipelines: $(_PublishUsingPipelines) enableSourceBuild: true + sourceBuildParameters: + platforms: + - name: Linux_x64 + targetRID: linux-x64 enableTelemetry: true helixRepo: dotnet/fsharp jobs: diff --git a/buildtools/AssemblyCheck/AssemblyCheck.fsproj b/buildtools/AssemblyCheck/AssemblyCheck.fsproj index 6cfd3b1103f..bb4b9dd2b76 100644 --- a/buildtools/AssemblyCheck/AssemblyCheck.fsproj +++ b/buildtools/AssemblyCheck/AssemblyCheck.fsproj @@ -8,7 +8,7 @@ true - true + $(NETCoreSdkRuntimeIdentifier) diff --git a/buildtools/fslex/fslex.fsproj b/buildtools/fslex/fslex.fsproj index 03ed6a77a60..f93c26d5559 100644 --- a/buildtools/fslex/fslex.fsproj +++ b/buildtools/fslex/fslex.fsproj @@ -9,7 +9,7 @@ true - true + $(NETCoreSdkRuntimeIdentifier) diff --git a/buildtools/fsyacc/fsyacc.fsproj b/buildtools/fsyacc/fsyacc.fsproj index 621a2f3c7ca..8dd8f9f7d6a 100644 --- a/buildtools/fsyacc/fsyacc.fsproj +++ b/buildtools/fsyacc/fsyacc.fsproj @@ -9,7 +9,7 @@ true - true + $(NETCoreSdkRuntimeIdentifier) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 3bfd9f80fc4..83037bae417 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -27,7 +27,7 @@ DependsOnTargets="PrepareInnerSourceBuildRepoRoot" BeforeTargets="RunInnerSourceBuildCommand" Condition="'$(ArcadeBuildFromSource)' == 'true' or '$(DotNetBuildSourceOnly)' == 'true'"> - + --tfm $(SourceBuildBootstrapTfm) @@ -42,7 +42,7 @@ + EnvironmentVariables="@(InnerBuildEnv);DotNetBuildFromSource=true;TargetRid=$(TargetRid)" /> diff --git a/src/fsc/fscProject/fsc.fsproj b/src/fsc/fscProject/fsc.fsproj index 5f30ad30579..1f22c8531e9 100644 --- a/src/fsc/fscProject/fsc.fsproj +++ b/src/fsc/fscProject/fsc.fsproj @@ -11,7 +11,7 @@ $(FSharpNetCoreProductTargetFramework) true - true + $(NETCoreSdkRuntimeIdentifier) diff --git a/src/fsi/fsiProject/fsi.fsproj b/src/fsi/fsiProject/fsi.fsproj index 639ab45af17..634ed56a9ea 100644 --- a/src/fsi/fsiProject/fsi.fsproj +++ b/src/fsi/fsiProject/fsi.fsproj @@ -11,7 +11,7 @@ $(FSharpNetCoreProductTargetFramework) true - true + $(NETCoreSdkRuntimeIdentifier) From 7271b277c17e66e8661f7b251819c833261be7ca Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 28 May 2024 09:18:23 +0000 Subject: [PATCH 2/3] Undo unnecessary changes --- Directory.Build.targets | 26 -------------------------- azure-pipelines-PR.yml | 6 +----- azure-pipelines.yml | 4 ---- eng/SourceBuild.props | 4 ++-- 4 files changed, 3 insertions(+), 37 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 91ccc4be1fa..cd863377199 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -21,30 +21,4 @@ - - - - - %(RuntimePackRuntimeIdentifiers);$(TargetRid) - - - %(RuntimePackRuntimeIdentifiers);$(TargetRid) - - - %(Crossgen2RuntimeIdentifiers);$(TargetRid) - - - %(AppHostRuntimeIdentifiers);$(TargetRid) - - - - - diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index ccc308b9245..be8dc94eca5 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -209,10 +209,6 @@ stages: enablePublishBuildAssets: true enablePublishUsingPipelines: $(_PublishUsingPipelines) enableSourceBuild: true - sourceBuildParameters: - platforms: - - name: Linux_x64 - targetRID: linux-x64 enableTelemetry: true helixRepo: dotnet/fsharp jobs: @@ -726,4 +722,4 @@ stages: targetPath: './artifacts/log/Release/AheadOfTime/Trimming/' artifactName: 'Trim Test Logs Attempt $(System.JobAttempt) Logs $(_kind)' continueOnError: true - condition: always() + condition: always() \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 355afef3924..e0c4349b26b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -100,10 +100,6 @@ extends: enablePublishBuildAssets: true enablePublishUsingPipelines: $(_PublishUsingPipelines) enableSourceBuild: true - sourceBuildParameters: - platforms: - - name: Linux_x64 - targetRID: linux-x64 enableTelemetry: true helixRepo: dotnet/fsharp jobs: diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 83037bae417..3bfd9f80fc4 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -27,7 +27,7 @@ DependsOnTargets="PrepareInnerSourceBuildRepoRoot" BeforeTargets="RunInnerSourceBuildCommand" Condition="'$(ArcadeBuildFromSource)' == 'true' or '$(DotNetBuildSourceOnly)' == 'true'"> - + --tfm $(SourceBuildBootstrapTfm) @@ -42,7 +42,7 @@ + EnvironmentVariables="@(InnerBuildEnv);DotNetBuildFromSource=true" /> From a726464c5f420b28471b36a6ff49949d663cfb83 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 28 May 2024 19:58:47 +0200 Subject: [PATCH 3/3] Update Directory.Build.targets --- Directory.Build.targets | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Directory.Build.targets b/Directory.Build.targets index cd863377199..8a1a1fa4a3f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -21,4 +21,20 @@ + + + + + %(RuntimePackRuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier) + + + %(Crossgen2RuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier) + + +