When building via msbuild or dotnet build or dotnet msbuild on an OSX system, any net4XX-targeting build fails because the FSharpBuild.Directory.Build.props hard-code mono paths that are standard on Linux, not on OSX. the meaningful lines are 45-50:
<!-- mono -->
<PropertyGroup Condition="'$(OS)' == 'Unix'">
<MonoPackaging Condition="$(TargetFramework.StartsWith('net4'))">true</MonoPackaging>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net45'">/usr/lib/mono/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net46'">/usr/lib/mono/4.6-api</FrameworkPathOverride>
</PropertyGroup>
Repro steps
Provide the steps required to reproduce the problem
- Clone down latest master
- run
dotnet build -f net462 src/fsharp/FSharp.Build/FSharp.Build.fsproj from the root directory
Expected behavior
The FSharp.Build dll is build for the net462 TFM.
Actual behavior
The FSharp.Build dll fails to build because it first builds FSharp.Core, and attempts to locate explicit references via the hard-coded /usr/lib/mono/4.5-api path. An example of the failing resolution is:
12:48:19.065 2:17>/Users/chethusk/oss/fsharp/artifacts/toolset/dotnet/sdk/2.1.500/Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/Users/chethusk/oss/fsharp/src/fsharp/FSharp.Core/FSharp.Core.fsproj]
For SearchPath "{TargetFrameworkDirectory}". (TaskId:115)
Considered "/usr/lib/mono/4.5-api/System.winmd", but it didn't exist. (TaskId:115)
Considered "/usr/lib/mono/4.5-api/System.dll", but it didn't exist. (TaskId:115)
Considered "/usr/lib/mono/4.5-api/System.exe", but it didn't exist. (TaskId:115)
For SearchPath "{RawFileName}". (TaskId:115)
Considered treating "System" as a file name, but it didn't exist. (TaskId:115)
Primary reference "System.Data". (TaskId:115)
Known workarounds
None, because this property replacement overrides any FrameworkPathOverride that the user may set, eg via environmetn variable.
Related information
Provide any related information
- Operating system: OSX Mojave
- Branch: master
- .NET Runtime, CoreCLR or Mono Version: Mono 5.18 or 5.23, dotnet sdk 2.1.500 (as downloaded via the dotnet-install.sh script)
- Editing Tools (e.g. Visual Studio Version): VS Code w/ Ionide
- Indications of severity: high, this impacts the ability to merge and build on the
fsharp/fsharp packaging repository.
When building via
msbuildordotnet buildordotnet msbuildon an OSX system, any net4XX-targeting build fails because the FSharpBuild.Directory.Build.props hard-code mono paths that are standard on Linux, not on OSX. the meaningful lines are 45-50:Repro steps
Provide the steps required to reproduce the problem
dotnet build -f net462 src/fsharp/FSharp.Build/FSharp.Build.fsprojfrom the root directoryExpected behavior
The
FSharp.Builddll is build for the net462 TFM.Actual behavior
The
FSharp.Builddll fails to build because it first builds FSharp.Core, and attempts to locate explicit references via the hard-coded/usr/lib/mono/4.5-apipath. An example of the failing resolution is:Known workarounds
None, because this property replacement overrides any
FrameworkPathOverridethat the user may set, eg via environmetn variable.Related information
Provide any related information
fsharp/fsharppackaging repository.