Skip to content

Stop producing executable fsc and fsi during source-build #12282

@dagood

Description

@dagood

fsc and fsi target net5.0 and have output type Exe, so when building with/for a 6.0 SDK, they download Microsoft.NETCore.App.Host.linux-x64/5.0.9 as a prebuilt dependency in order to generate the framework-dependent executable (FDE):

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks Condition="'$(ProtoTargetFramework)' != ''">$(ProtoTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(ProtoTargetFramework)' == ''">net472;net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix'">net5.0</TargetFrameworks>
<NoWarn>$(NoWarn);44</NoWarn> <!-- Obsolete -->
<NoWarn>$(NoWarn);75</NoWarn> <!-- InternalCommandLineOption -->
<AllowCrossTargeting>true</AllowCrossTargeting>
<NGenBinary>true</NGenBinary>
<UseAppHost>true</UseAppHost>
</PropertyGroup>

In a Microsoft-built SDK, the FDEs don't seem to be shipped, just the framework dependent assemblies:

$ find . -iname fsi*
./sdk/6.0.100-rc.2.21505.57/FSharp/fsi.deps.json
./sdk/6.0.100-rc.2.21505.57/FSharp/fsi.dll
./sdk/6.0.100-rc.2.21505.57/FSharp/fsi.runtimeconfig.json
$ find . -iname fsc*
./sdk/6.0.100-rc.2.21505.57/FSharp/fsc.runtimeconfig.json
./sdk/6.0.100-rc.2.21505.57/FSharp/fsc.dll
./sdk/6.0.100-rc.2.21505.57/FSharp/fsc.deps.json
  • Is it safe to add to <UseAppHost>false</UseAppHost> to these projects during source-builds, to remove the FDE and the prebuilt?
  • Can this change be made even when source-build isn't involved? Or are these FDEs used in some other scenario that's specific to the Microsoft-built output?

@brettfo

In the past, source-build would have upgraded F# to net6.0 to get around this prebuilt, but this is no longer the preferred way to go about this. (We'd rather keep TFM parity with the Microsoft build.)


Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions