!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

126 Members
24 Servers

Load older messages


SenderMessageTime
17 Dec 2024
@gggkiller:matrix.orgGGGand the code you're using to package said program?18:21:39
@gggkiller:matrix.orgGGG* and the code you're using to package said app?18:24:00
@genga898:matrix.orgEmmanuel Genga
{
  fetchFromGitHub,
  buildDotnetModule,
  dotnet-sdk,
}:
let
  dotnet_8 = dotnet-sdk;
in

buildDotnetModule rec {
  pname = "yuckls";
  version = "";

  src = fetchFromGitHub {
    owner = "Eugenenoble2005";
    repo = "YuckLS";
    rev = "dffe86db9c0616c516ee9620f8bf8d57759ffb11";
    hash = "sha256-SA39EfwCZyMMxK3zDH25lbOc+Ih3gMDufFyhyQ/es0s=";
  };

  projectFile = "${src}/YuckLS/YuckLS.csproj";

  dotnet-sdk = dotnet_8;
  nugetDeps = ./deps.nix;
}

18:24:34
@gggkiller:matrix.orgGGG yeah, you shouldn't have that ${src} at the start of projectFile 18:24:51
@gggkiller:matrix.orgGGG the rest seems fine, other than the lack of a version 18:25:16
@genga898:matrix.orgEmmanuel Genga Not really packaging it for nixpkgs, it's an alpha build and I want to test it out locally 18:26:06
@whovian9369:matrix.orgWhovian9369

Does anyone here have tips on updating enough of a Net 7.0 app so it can be built and run with Net 8.0 and/or 9.0?
Derivation I threw together uses dotnetCorePackages.sdk_7_0 and dotnetCorePackages.runtime_7_0, which are EOL and Nix complains on trying to build it since they're broken in Nixpkgs.

The derivation in question is available at https://github.com/Whovian9369/aaru-nix-flake/blob/main/lts.nix in case it helps.

21:42:13
@emma:rory.gayEmma [it/its]unless the repo is configured otherwise , you could probably use rollForward21:42:45
@emma:rory.gayEmma [it/its]* unless the repo is configured otherwise , you could probably use rollForward mechanics?21:42:53
@emma:rory.gayEmma [it/its]ie. try building it under 8/9 and see what happens21:43:05
@whovian9369:matrix.orgWhovian9369So updating the derivation to use Net 8.0/9.0 and try running it?21:45:42
@gggkiller:matrix.orgGGG
In reply to @whovian9369:matrix.org

Does anyone here have tips on updating enough of a Net 7.0 app so it can be built and run with Net 8.0 and/or 9.0?
Derivation I threw together uses dotnetCorePackages.sdk_7_0 and dotnetCorePackages.runtime_7_0, which are EOL and Nix complains on trying to build it since they're broken in Nixpkgs.

The derivation in question is available at https://github.com/Whovian9369/aaru-nix-flake/blob/main/lts.nix in case it helps.

You could just do a patch (or substituteInPlace if you're lazy) to replace all TargetFramework labels to net8.0 or net9.0 of the app doesn't use any APIs that had breaking changes
21:49:06
@gggkiller:matrix.orgGGGJust doing roll forward won't work because it still needs the older SDK to build so you'll still get the insecure warning.21:49:31
@whovian9369:matrix.orgWhovian9369 So my current issue (which I haven't looked into yet, whoops) is That I'm getting errors because of hardcoded RuntimeIdentifiers at https://github.com/aaru-dps/Aaru/blob/f4fef21d0d88b7931b95549782563db4da91a8f8/Aaru/Aaru.csproj#L21 21:52:54
@6pak:matrix.org6pakglobal properties override project ones21:53:41
@6pak:matrix.org6pak so you can do -p:RuntimeIdentifiers= 21:53:48
@whovian9369:matrix.orgWhovian9369My issue with just building using Net 8.0 was that it still wanted Net 7 Runtime, which threw a slight wrench in the works too.21:53:54
@whovian9369:matrix.orgWhovian9369And building with 8 SDK and 8 Runtime gives me the Runtime issue.21:54:13
@whovian9369:matrix.orgWhovian9369* And building with 8 SDK and 8 Runtime gives me the Runtime Identifiers issue.21:54:23
@gggkiller:matrix.orgGGG* You could just do a patch (or substituteInPlace if you're lazy) to replace all TargetFramework labels to net8.0 or net9.0 *if* the app doesn't use any APIs that had breaking changes21:55:12
@whovian9369:matrix.orgWhovian9369 runtimeId = "linux-x64"; should override that then, right? Or should I be doing it using like dotnetFlags = [ "-p:RuntimeIdentifiers=linux-x64" ] 21:55:19
@gggkiller:matrix.orgGGGLatter21:55:31
@6pak:matrix.org6pak I think nixpkgs dotnet stuff sets RuntimeIdentifier 21:55:35
@6pak:matrix.org6pak so if you empty out RuntimeIdentifiers, it will work like you want it to 21:55:44
@whovian9369:matrix.orgWhovian9369I'll have to try it out then, thanks!21:55:53
@gggkiller:matrix.orgGGGYou'll probably want to use `dotnetCorePackages.systemToRuntimeId` to transform the `stdenv.targetSystem` into a RuntimeIdentifier21:56:42
@6pak:matrix.org6pakhostSystem*21:57:06
@gggkiller:matrix.orgGGG
In reply to @6pak:matrix.org
I think nixpkgs dotnet stuff sets RuntimeIdentifier
Does it? Lemme double check
21:57:06
@gggkiller:matrix.orgGGGI already forgot21:57:12
@6pak:matrix.org6pakbut even then, just let builddotnetmodule fill it out21:57:23

Show newer messages


Back to Room ListRoom Version: 9