Skip to content

Disable apphost on downlevel frameworks during source-build#12286

Merged
brettfo merged 1 commit into
dotnet:mainfrom
dagood:fs-no-apphost
Oct 28, 2021
Merged

Disable apphost on downlevel frameworks during source-build#12286
brettfo merged 1 commit into
dotnet:mainfrom
dagood:fs-no-apphost

Conversation

@dagood
Copy link
Copy Markdown
Member

@dagood dagood commented Oct 21, 2021

During source-build, disable apphost build for 'fsi' and 'fsc', and
'fsyacc', 'fslex', and 'AssemblyCheck' during the bootstrap 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 projects from
creating the apphost removes the prebuilt for source-build.

To make disabling the apphost work in the bootstrapping build, add a
check to eng/build.sh to skip the bootstrap build if we're currently
running the "outer" source-build. That gives source-build the ability to
run bootstrapping on its own terms. Now, when eng/SourceBuild.props runs
bootstrapping, it can pass the DotNetBuildFromSource property through
the environment so it takes effect.


I've run this through a source-build tarball build locally and it seems to remove the prebuilt 5.0 apphost: dotnet/installer#12456.

/cc @dotnet/source-build-internal

During source-build, disable apphost build for 'fsi' and 'fsc', and
'fsyacc', 'fslex', and 'AssemblyCheck' during the bootstrap 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 projects from
creating the apphost removes the prebuilt for source-build.

To make disabling the apphost work in the bootstrapping build, add a
check to eng/build.sh to skip the bootstrap build if we're currently
running the "outer" source-build. That gives source-build the ability to
run bootstrapping on its own terms. Now, when eng/SourceBuild.props runs
bootstrapping, it can pass the DotNetBuildFromSource property through
the environment so it takes effect.
Comment thread eng/build.sh
# 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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume the source_build environment variable is set prior to running this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It comes from the --sourceBuild arg--the environment value is discarded--but basically yes:

source_build=false

fsharp/eng/build.sh

Lines 140 to 141 in 8459d3a

--sourcebuild)
source_build=true

This is passed in by source-build here:

https://github.com/dotnet/installer/blob/9e8b04bbff820c93c142f99a507a46b976f5c14c/src/SourceBuild/tarball/content/repos/fsharp.proj#L7-L12

@brettfo brettfo merged commit eb1337f into dotnet:main Oct 28, 2021
@dagood dagood deleted the fs-no-apphost branch October 28, 2021 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants