From 2cf457ef3877b73bbb9855fa072d96ba83b6b54a Mon Sep 17 00:00:00 2001 From: Davis Goodin Date: Tue, 19 Oct 2021 19:39:45 -0500 Subject: [PATCH] Remove compiler project apphosts in source-build --- .../tarball/content/repos/fsharp.proj | 6 + ...apphost-for-fsi-fsc-for-source-build.patch | 35 +++++ ...t-pack-prebuilts-during-source-build.patch | 127 ++++++++++++++++++ ...st-build-of-csi-vbi-for-source-build.patch | 35 +++++ 4 files changed, 203 insertions(+) create mode 100644 src/SourceBuild/tarball/patches/fsharp/0001-Disable-apphost-for-fsi-fsc-for-source-build.patch create mode 100644 src/SourceBuild/tarball/patches/fsharp/0002-Remove-apphost-pack-prebuilts-during-source-build.patch create mode 100644 src/SourceBuild/tarball/patches/roslyn/0004-Disable-apphost-build-of-csi-vbi-for-source-build.patch diff --git a/src/SourceBuild/tarball/content/repos/fsharp.proj b/src/SourceBuild/tarball/content/repos/fsharp.proj index b77de5f30..a03a69fc5 100644 --- a/src/SourceBuild/tarball/content/repos/fsharp.proj +++ b/src/SourceBuild/tarball/content/repos/fsharp.proj @@ -4,6 +4,12 @@ $(StandardSourceBuildArgs) $(BuildCommandArgs) /p:TreatWarningsAsErrors=false + + $(BuildCommandArgs) --sourcebuild $(StandardSourceBuildCommand) $(BuildCommandArgs) false diff --git a/src/SourceBuild/tarball/patches/fsharp/0001-Disable-apphost-for-fsi-fsc-for-source-build.patch b/src/SourceBuild/tarball/patches/fsharp/0001-Disable-apphost-for-fsi-fsc-for-source-build.patch new file mode 100644 index 000000000..2e078b165 --- /dev/null +++ b/src/SourceBuild/tarball/patches/fsharp/0001-Disable-apphost-for-fsi-fsc-for-source-build.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Davis Goodin +Date: Tue, 19 Oct 2021 16:11:51 -0500 +Subject: [PATCH] Disable apphost for 'fsi', 'fsc' for source-build + +Creating an apphost for a net5.0 project while building with a net6.0 SDK downloads the apphost pack as a prebuilt. Stopping the project from creating the apphost removes the prebuilt for source-build. +--- + src/fsharp/fsc/fsc.fsproj | 1 + + src/fsharp/fsi/fsi.fsproj | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/src/fsharp/fsc/fsc.fsproj b/src/fsharp/fsc/fsc.fsproj +index 7fa31fc21..04025c297 100644 +--- a/src/fsharp/fsc/fsc.fsproj ++++ b/src/fsharp/fsc/fsc.fsproj +@@ -12,6 +12,7 @@ + $(OtherFlags) --maxerrors:20 --extraoptimizationloops:1 + true + true ++ false + + + +diff --git a/src/fsharp/fsi/fsi.fsproj b/src/fsharp/fsi/fsi.fsproj +index 9fd9b1333..eace6c166 100644 +--- a/src/fsharp/fsi/fsi.fsproj ++++ b/src/fsharp/fsi/fsi.fsproj +@@ -13,6 +13,7 @@ + fsi.res + true + true ++ false + + + diff --git a/src/SourceBuild/tarball/patches/fsharp/0002-Remove-apphost-pack-prebuilts-during-source-build.patch b/src/SourceBuild/tarball/patches/fsharp/0002-Remove-apphost-pack-prebuilts-during-source-build.patch new file mode 100644 index 000000000..e88e10cea --- /dev/null +++ b/src/SourceBuild/tarball/patches/fsharp/0002-Remove-apphost-pack-prebuilts-during-source-build.patch @@ -0,0 +1,127 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Davis Goodin +Date: Tue, 19 Oct 2021 19:34:11 -0500 +Subject: [PATCH] Remove apphost pack prebuilts during source-build + +Add a check to eng/build.sh to avoid running the bootstrapping twice: once in the outer build and again in the inner build. + +Sets UseAppHost=false during source-build for the projects that build during bootstrapping. Pass the DotNetBuildFromSource property through the environment in eng/SourceBuild.props so it takes effect. +--- + eng/SourceBuild.props | 2 +- + eng/build.sh | 51 ++++++++++--------- + .../AssemblyCheck/AssemblyCheck.fsproj | 1 + + src/buildtools/fslex/fslex.fsproj | 1 + + src/buildtools/fsyacc/fsyacc.fsproj | 1 + + 5 files changed, 32 insertions(+), 24 deletions(-) + +diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props +index 22c929f28..903ee00d3 100644 +--- a/eng/SourceBuild.props ++++ b/eng/SourceBuild.props +@@ -41,7 +41,7 @@ + ++ EnvironmentVariables="@(InnerBuildEnv);DotNetBuildFromSource=true" /> + + + +diff --git a/eng/build.sh b/eng/build.sh +index 9a2aa0083..6af422237 100755 +--- a/eng/build.sh ++++ b/eng/build.sh +@@ -240,29 +240,34 @@ function BuildSolution { + node_reuse=false + + # build bootstrap tools +- bootstrap_config=Proto +- bootstrap_dir=$artifacts_dir/Bootstrap +- if [[ "$force_bootstrap" == true ]]; then +- rm -fr $bootstrap_dir +- fi +- if [ ! -f "$bootstrap_dir/fslex.dll" ]; then +- BuildMessage="Error building tools" +- MSBuild "$repo_root/src/buildtools/buildtools.proj" \ +- /restore \ +- /p:Configuration=$bootstrap_config +- +- mkdir -p "$bootstrap_dir" +- cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/net5.0 $bootstrap_dir/fslex +- cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/net5.0 $bootstrap_dir/fsyacc +- fi +- if [ ! -f "$bootstrap_dir/fsc.exe" ]; then +- BuildMessage="Error building bootstrap" +- MSBuild "$repo_root/proto.proj" \ +- /restore \ +- /p:Configuration=$bootstrap_config \ +- +- +- cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net5.0 $bootstrap_dir/fsc ++ # source_build=true means we are currently in the outer/wrapper source-build, ++ # and building bootstrap needs to wait. The source-build targets will run this ++ # script again without setting source_build=true when it is done setting up ++ # the build environment. See 'eng/SourceBuild.props'. ++ if [[ "$source_build" != true ]]; then ++ bootstrap_config=Proto ++ bootstrap_dir=$artifacts_dir/Bootstrap ++ if [[ "$force_bootstrap" == true ]]; then ++ rm -fr $bootstrap_dir ++ fi ++ if [ ! -f "$bootstrap_dir/fslex.dll" ]; then ++ BuildMessage="Error building tools" ++ MSBuild "$repo_root/src/buildtools/buildtools.proj" \ ++ /restore \ ++ /p:Configuration=$bootstrap_config ++ ++ mkdir -p "$bootstrap_dir" ++ cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/net5.0 $bootstrap_dir/fslex ++ cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/net5.0 $bootstrap_dir/fsyacc ++ fi ++ if [ ! -f "$bootstrap_dir/fsc.exe" ]; then ++ BuildMessage="Error building bootstrap" ++ MSBuild "$repo_root/proto.proj" \ ++ /restore \ ++ /p:Configuration=$bootstrap_config ++ ++ cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net5.0 $bootstrap_dir/fsc ++ fi + fi + + if [[ "$skip_build" != true ]]; then +diff --git a/src/buildtools/AssemblyCheck/AssemblyCheck.fsproj b/src/buildtools/AssemblyCheck/AssemblyCheck.fsproj +index 464b6ef78..5c78bbe6d 100644 +--- a/src/buildtools/AssemblyCheck/AssemblyCheck.fsproj ++++ b/src/buildtools/AssemblyCheck/AssemblyCheck.fsproj +@@ -4,6 +4,7 @@ + Exe + net5.0 + true ++ false + + + +diff --git a/src/buildtools/fslex/fslex.fsproj b/src/buildtools/fslex/fslex.fsproj +index 1959ce59c..3d63bf6bf 100644 +--- a/src/buildtools/fslex/fslex.fsproj ++++ b/src/buildtools/fslex/fslex.fsproj +@@ -5,6 +5,7 @@ + net5.0 + INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstants) + true ++ false + + + +diff --git a/src/buildtools/fsyacc/fsyacc.fsproj b/src/buildtools/fsyacc/fsyacc.fsproj +index 5d1b7141f..63b63c5de 100644 +--- a/src/buildtools/fsyacc/fsyacc.fsproj ++++ b/src/buildtools/fsyacc/fsyacc.fsproj +@@ -5,6 +5,7 @@ + net5.0 + INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstants) + true ++ false + + + diff --git a/src/SourceBuild/tarball/patches/roslyn/0004-Disable-apphost-build-of-csi-vbi-for-source-build.patch b/src/SourceBuild/tarball/patches/roslyn/0004-Disable-apphost-build-of-csi-vbi-for-source-build.patch new file mode 100644 index 000000000..528517fb8 --- /dev/null +++ b/src/SourceBuild/tarball/patches/roslyn/0004-Disable-apphost-build-of-csi-vbi-for-source-build.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Davis Goodin +Date: Tue, 19 Oct 2021 19:38:52 -0500 +Subject: [PATCH] Disable apphost build of 'csi', 'vbi' for source-build + +Creating an apphost for a netcoreapp3.1 project uses the apphost pack as a prebuilt. Stopping these projects from creating the apphost removes the prebuilt for source-build. +--- + src/Interactive/csi/csi.csproj | 1 + + src/Interactive/vbi/vbi.vbproj | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/src/Interactive/csi/csi.csproj b/src/Interactive/csi/csi.csproj +index 3970bb4e9ea..e96beb550d2 100644 +--- a/src/Interactive/csi/csi.csproj ++++ b/src/Interactive/csi/csi.csproj +@@ -6,6 +6,7 @@ + Exe + CSharpInteractive + netcoreapp3.1;net472 ++ false + + + +diff --git a/src/Interactive/vbi/vbi.vbproj b/src/Interactive/vbi/vbi.vbproj +index 5bbdf7f03a7..5f732d71534 100644 +--- a/src/Interactive/vbi/vbi.vbproj ++++ b/src/Interactive/vbi/vbi.vbproj +@@ -6,6 +6,7 @@ + Exe + Sub Main + netcoreapp3.1;net472 ++ false + + +