fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

NoWarn for FS5311 no longer respected in Release builds after .NET / F# 7 -> 8 update

Open jcmrva opened this issue 1 year ago • 7 comments

FS3511: This state machine is not statically compilable. A resumable code invocation at '(...)' could not be reduced. An alternative dynamic implementation will be used, which may be slower. Consider adjusting your code to ensure this state machine is statically compilable, or else suppress this warning.

We have a few task CEs that trigger this warning and have opted to suppress it.

In .NET 7, we used <NoWarn>3511</NoWarn> in Directory.Build.props. After updating to .NET 8, the warnings still occur, but only in Release configuration. Because we use TreatWarningsAsErrors, this is a breaking change.

As a workaround, we added the #nowarn directive to each file, which is arguably an improvement.

.NET SDK 8.0.101 OS: all

jcmrva avatar Jan 18 '24 18:01 jcmrva

I don't think it's F# issue, I bet it'll work if you put it to fsproj directly, it seems it's not propagating from props file correctly.

vzarytovskii avatar Jan 18 '24 19:01 vzarytovskii

I thought that might be the case, but the other entries in the props file work okay.

jcmrva avatar Jan 18 '24 19:01 jcmrva

I thought that might be the case, but the other entries in the props file work okay.

Yeah, it seems to be a nowarn issue, I I've seen it some time ago, but since it was a nightly sdk, I thought it's some fluke. Needs confirmation though.

vzarytovskii avatar Jan 18 '24 21:01 vzarytovskii

@jcmrva can you attach or send us the binlog from MSBuild where this doesn't work?

0101 avatar Jan 22 '24 17:01 0101

It may take a few days but I should be able to. Is there a secure way I can send it?

jcmrva avatar Jan 22 '24 22:01 jcmrva

It may take a few days but I should be able to. Is there a secure way I can send it?

You can send it to me via email probably - [email protected]

vzarytovskii avatar Jan 23 '24 11:01 vzarytovskii

I may have missed a step somewhere but I can't reproduce it at the moment. I'll poke at it more when I have time.

jcmrva avatar Jan 25 '24 20:01 jcmrva