New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] GenerateBundle task for single file publishing fails with v5.0.1 #11111
Comments
I had this issue but due to This line in
|
Alright, thanks for the hint! |
I can't reproduce this on the latest macOS with a console app + updated FSharp.Core to 5.0.1 and FCS 39 on the .NET SDK 5.0.103, regardless of paket or nuget. @njlr did you see this also on linux? |
We saw this on Linux and macOS. Our solution has multiple projects with interdependencies too. Some of the settings: <PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>false</PublishReadyToRun>
<Deterministic>true</Deterministic>
<DeterministicSourcePaths>true</DeterministicSourcePaths>
</PropertyGroup> |
I created a repro repo. This works with FSharp.Core 5.0.0, but not with FSharp.Core 5.0.1. |
Labeling as a regression and adding to the 16.10 milestone for now. Thanks @NicoVIII for the repro. |
Ha, was up till 1am this morning with this problem and I tracked it down (and also built a very minimal repro attached). This is a delightful collision of things. The single file publishing has an absolute prohibition against two files getting published to the same output file path but isn't smart enough to deconflict cases where the files are identical. There seem to be some cases where the build machinery adds two copies of FSharp.Core to a project. It doesn't affect regular builds because one probably just gets pasted over the other and they are identical. With 5.0.1 there was an xml file added to the package
That file gets copied twice in some cases and the bundler gets upset. If you run net6 prerelease it even emits a helpful message here (of course this highlights another opportunity to make the bundler a little less mindless - if the paths are the same it shouldn't care, even if they are different it should probably do a binary check but anyway if this list is multiple, it fails)
Fix is to get rid of the xml file from the package for now (or pin to 5.0.0). My repro attached - it's a two project case where one project brings in the second (empty) project. Oddly this trips things only with paket adding the packages. If I simply add the library to two projects directly, something is smart enough to remove the dups but not with the more complex paket build. |
The nice runtime bundlefolks seem (justifiably) unenthusiastic about patching the bundling to work around what is probably in the end an SDK issue. I don't understand why the project setup I attached above results in the FSharp.Core xml file getting added twice but that's probably the root issue really. Removing the xml file will stop the pain but it's not really at fault. |
Thanks for the repro. @KevinRansom any thoughts here? It's related to the recent FSharp.Core changes. |
I'm using the code generator lib Myriad in my project, which adds a dependency for FSharp.Compiler.Service. This dependency suddenly breaks single file publishing when I'm using v39. With v38 everything works fine.
It looks like the problem is the dependency on FSharp.Core 5.0.1 (#11111 (comment)).
Repro steps
Edit: I created a minimal repro: #11111 (comment)
I got the problem in one of my repos.
As you can see in the commit history and look at the CI results:
the deployment works, if I pin the Service to v38 and does not work, if I use v39 (which depends on FSharp.Core 5.0.1).
With v5.0.1 if I execute following commands in src/MagicCollectionHelper/AvaloniaApp:
dotnet publish -c Release -r linux-x64 -o "../../../deploy"
This works.
dotnet publish -c Release -r linux-x64 -o "../../../deploy" -p:PublishSingleFile=true
This produces the following error:
Expected behavior
Publishing as single file works also with the current version of FSharp.Core.
Actual behavior
See Repro steps. Publishing as single file throws an error.
Known workarounds
Use v5.0.0.
Related information
Provide any related information (optional):
The text was updated successfully, but these errors were encountered: