So I want to combine multiple dotnet SDKs in a flake. Roughly, I tried this:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
in flake-utils.lib.eachDefaultSystem (system: {
packages.default = pkgs.buildEnv {
name = "combined-dotnet";
paths = with pkgs;
[
(with dotnetCorePackages;
combinePackages [
dotnetCorePackages.sdk_6_0
dotnetCorePackages.sdk_7_0
dotnetPackages.Nuget
])
];
};
});
}
This builds fabulously and the dotnet command works for dotnet 7 project. However, if I try a dotnet 6 project, I get an error roughly like this:
Failed to load dotnet-sdk-6.0.412 libcoreclr.so
error: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.3
Generally, I want to build a package to combine dotnet SDKs so that both of the SDKs are listed when you do dotnet --list-sdks or dotnet --info, which works. But the dotnet 6 SDK does not work as I just described.
Generally you can install multiple dotnet SDKs manually or with Microsofts helper scripts. They then have some common directories that put an extra directory with the version number of the SDKs and a single shared dotnet command can find all SDKs then.
What did I do incorrectly that causes me to get this error? To me, combinePackages appeared to be the solution I was looking for, but I get the loading error as described.