Skip to content
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

Build error: You must either specify a RuntimeIdentifier or set PublishSingleFile to false. #5

Open
Atemu opened this issue Nov 5, 2022 · 1 comment

Comments

@Atemu
Copy link
Contributor

Atemu commented Nov 5, 2022

Hi there, I packaged BSMM for Nixpkgs but I'm running into an issue I need to patch around which I'd rather not:

Executing dotnetInstallHook
MSBuild version 17.3.1+2badb37d1 for .NET
  IPA-lib -> /nix/store/hsx50dc5yly2bqinqcdr9sz6xs9zfawc-BeatSaberModManager-0.0.2/lib/BeatSaberModManager/
/nix/store/a5x48hb982y79kkh39n8wh16b62vi1iz-dotnet-sdk-6.0.401/sdk/6.0.401/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(102,5): error NETSDK1097: It is not supported to publish an application to a single-file without specifying a RuntimeIdentifier. You must either specify a RuntimeIdentifier or set PublishSingleFile to false. [/build/source/BeatSaberModManager/BeatSaberModManager.csproj]

Do you know what's up with that?

My patch consists of adding the platform-specific RuntimeIdentifier into the build file but that feels dirty.

https://github.com/NixOS/nixpkgs/blob/4d6a7480991970801c0d195eebac90180026367b/pkgs/games/BeatSaberModManager/default.nix#L31-L36
https://github.com/NixOS/nixpkgs/blob/4d6a7480991970801c0d195eebac90180026367b/pkgs/games/BeatSaberModManager/add-runtime-identifier.patch#

@affederaffe
Copy link
Owner

You can build the project with additional arguments, see the actions workflow.
I don't know much about NixOS' packaging, but the command you need is
dotnet publish -c Release -r linux-x64 --self-contained -p:PublishTrimmed=true for self-contained build (without .NET runtime dependency), and
dotnet publish -c Release -r linux-x64 --no-self-contained for a framework-dependent build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants