Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

"Deterministic builds only support portable PDBs" in F# project
rlundy
#1 Posted : Monday, June 17, 2019 12:35:39 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/15/2016(UTC)
Posts: 6
Location: Germany

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
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?
Remco
#2 Posted : Tuesday, June 18, 2019 12:43:54 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
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>
akhansari-vp
#3 Posted : Monday, August 5, 2019 3:25:07 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/5/2019(UTC)
Posts: 3
Location: France

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
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)
Remco
#4 Posted : Tuesday, August 6, 2019 12:12:19 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
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?
akhansari-vp
#5 Posted : Thursday, August 8, 2019 10:45:29 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/5/2019(UTC)
Posts: 3
Location: France

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Great news about portable PDBs!

The workaround doesn't seem to work for me...
Remco
#6 Posted : Thursday, August 8, 2019 11:18:20 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Can you try adding the following into the primary property group in your .fsproj file?

<OtherFlags>--deterministic-</OtherFlags>
1 user thanked Remco for this useful post.
akhansari-vp on 8/9/2019(UTC)
akhansari-vp
#7 Posted : Friday, August 9, 2019 9:00:37 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/5/2019(UTC)
Posts: 3
Location: France

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Thanks Remco, it works :
<OtherFlags Condition="'$(NCrunch)' == '1'">--deterministic-</OtherFlags>
1 user thanked akhansari-vp for this useful post.
Remco on 8/9/2019(UTC)
lscpike
#8 Posted : Wednesday, August 14, 2019 12:55:53 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/14/2019(UTC)
Posts: 1

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.

Remco
#9 Posted : Thursday, August 15, 2019 12:53:06 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.053 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download