I have a .NET solution I'm using with NCrunch that's suddenly started giving this error on the NCrunch build:
FSC (0, 0): Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded)
The project has a .NET Core 3.0 F# console project and a .NET Core 3.0 F# NUnit test project.
Strangely, this doesn't happen when doing a normal VS 2019 build or rebuild, and it doesn't happen when building with dotnet build (whether or not I do a dotnet clean first).
Any ideas?
Build/Test Issues
"Deterministic builds only support portable PDBs" in F# project
Started by rlundy on 4,240 views
Remco NCrunch Developer
#13599
18 Jun 2019 00:43 UTC
Hi, thanks for sharing this issue.
NCrunch in its current form doesn't support working with portable PDB files. We're working on a solution to this, but it's a very big task.
So right now, it forces your build system to use 'Full' PDBs instead. This clashes with deterministic builds.
The solution here is to set your NCrunch build so that it is not deterministic. If you have an existing deterministic property in your project, please replace it with the following:
<Deterministic Condition="'$(NCrunch)' != '1'">true</Deterministic>
Otherwise, add the following line:
<Deterministic Condition="'$(NCrunch)' == '1'">false</Deterministic>
NCrunch in its current form doesn't support working with portable PDB files. We're working on a solution to this, but it's a very big task.
So right now, it forces your build system to use 'Full' PDBs instead. This clashes with deterministic builds.
The solution here is to set your NCrunch build so that it is not deterministic. If you have an existing deterministic property in your project, please replace it with the following:
<Deterministic Condition="'$(NCrunch)' != '1'">true</Deterministic>
Otherwise, add the following line:
<Deterministic Condition="'$(NCrunch)' == '1'">false</Deterministic>
Very strange, my F# project has worked without any problem with NCrunch until the VS 16.2.0 !
Since this version I get always the same error :
FSC (0, 0): Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded)
Since this version I get always the same error :
FSC (0, 0): Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded)
Remco NCrunch Developer
#13695
06 Aug 2019 00:12 UTC
They must have changed a default setting within the compiler. It's my expectation that portable PDBs eventually phase out the old ones and support for the legacy PDBs is gone entirely (which is why we're working crazily to add support for the portable PDBs).
Can you confirm whether the deterministic build setting described above solved the problem for you?
Can you confirm whether the deterministic build setting described above solved the problem for you?
Great news about portable PDBs!
The workaround doesn't seem to work for me...
The workaround doesn't seem to work for me...
Edited 08 Aug 2019 10:45 UTC
Remco NCrunch Developer
#13740
08 Aug 2019 23:18 UTC
Can you try adding the following into the primary property group in your .fsproj file?
<OtherFlags>--deterministic-</OtherFlags>
<OtherFlags>--deterministic-</OtherFlags>
Thanks Remco, it works :
<OtherFlags Condition="'$(NCrunch)' == '1'">--deterministic-</OtherFlags>
<OtherFlags Condition="'$(NCrunch)' == '1'">--deterministic-</OtherFlags>
Just had this same issue. Research suggests deterministic has been the default for a while, but the F# compiler only added support for deterministic builds recently. Ref: https://github.com/dotnet/fsharp/issues/7363
I've also got the same issue with using sourcelink which requires portable PDBs. This results in:
FSC (0, 0): --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded)
For some reason this works fine for .csproj files/CSC.
I've also got the same issue with using sourcelink which requires portable PDBs. This results in:
FSC (0, 0): --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded)
For some reason this works fine for .csproj files/CSC.
Remco NCrunch Developer
#13765
15 Aug 2019 00:53 UTC
Looking at how this is working, I expect that everyone using FSharp with NCrunch will likely need to adjust their .fsproj file for it to work correctly after updating their VS.
Interestingly, when I tried the <Deterministic> flag inside the project file, it didn't work for me. Hence the suggestion about <OtherFlags>, which definitely does work.
We'll get a fix out for this in the next release. It's going to be interesting to see whether the fix is just a patch to set the OtherFlags under NCrunch, or whether it's actually full blown portable PDB support. We're getting close on that now.
Interestingly, when I tried the <Deterministic> flag inside the project file, it didn't work for me. Hence the suggestion about <OtherFlags>, which definitely does work.
We'll get a fix out for this in the next release. It's going to be interesting to see whether the fix is just a patch to set the OtherFlags under NCrunch, or whether it's actually full blown portable PDB support. We're getting close on that now.
Post a reply
Log in to reply.