Merge pull request #233422 from mdarocha/crossgen-fix

buildDotnetModule: support ReadyToRun and native binaries inside nuget files
This commit is contained in:
Sandro 2023-06-22 22:26:53 +02:00 committed by GitHub
commit 67f4868a43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 98 additions and 30 deletions

View file

@ -92,7 +92,7 @@ The `dotnetCorePackages.sdk` contains both a runtime and the full sdk of a given
To package Dotnet applications, you can use `buildDotnetModule`. This has similar arguments to `stdenv.mkDerivation`, with the following additions: To package Dotnet applications, you can use `buildDotnetModule`. This has similar arguments to `stdenv.mkDerivation`, with the following additions:
* `projectFile` is used for specifying the dotnet project file, relative to the source root. These usually have `.sln` or `.csproj` file extensions. This can be a list of multiple projects as well. Most of the time dotnet can figure this location out by itself, so this should only be set if necessary. * `projectFile` is used for specifying the dotnet project file, relative to the source root. These have `.sln` (entire solution) or `.csproj` (single project) file extensions. This can be a list of multiple projects as well. When omitted, will attempt to find and build the solution (`.sln`). If running into problems, make sure to set it to a file (or a list of files) with the `.csproj` extension - building applications as entire solutions is not fully supported by the .NET CLI.
* `nugetDeps` takes either a path to a `deps.nix` file, or a derivation. The `deps.nix` file can be generated using the script attached to `passthru.fetch-deps`. This file can also be generated manually using `nuget-to-nix` tool, which is available in nixpkgs. If the argument is a derivation, it will be used directly and assume it has the same output as `mkNugetDeps`. * `nugetDeps` takes either a path to a `deps.nix` file, or a derivation. The `deps.nix` file can be generated using the script attached to `passthru.fetch-deps`. This file can also be generated manually using `nuget-to-nix` tool, which is available in nixpkgs. If the argument is a derivation, it will be used directly and assume it has the same output as `mkNugetDeps`.
* `packNupkg` is used to pack project as a `nupkg`, and installs it to `$out/share`. If set to `true`, the derivation can be used as a dependency for another dotnet project by adding it to `projectReferences`. * `packNupkg` is used to pack project as a `nupkg`, and installs it to `$out/share`. If set to `true`, the derivation can be used as a dependency for another dotnet project by adding it to `projectReferences`.
* `projectReferences` can be used to resolve `ProjectReference` project items. Referenced projects can be packed with `buildDotnetModule` by setting the `packNupkg = true` attribute and passing a list of derivations to `projectReferences`. Since we are sharing referenced projects as NuGets they must be added to csproj/fsproj files as `PackageReference` as well. * `projectReferences` can be used to resolve `ProjectReference` project items. Referenced projects can be packed with `buildDotnetModule` by setting the `packNupkg = true` attribute and passing a list of derivations to `projectReferences`. Since we are sharing referenced projects as NuGets they must be added to csproj/fsproj files as `PackageReference` as well.
@ -108,13 +108,13 @@ To package Dotnet applications, you can use `buildDotnetModule`. This has simila
* `executables` is used to specify which executables get wrapped to `$out/bin`, relative to `$out/lib/$pname`. If this is unset, all executables generated will get installed. If you do not want to install any, set this to `[]`. This gets done in the `preFixup` phase. * `executables` is used to specify which executables get wrapped to `$out/bin`, relative to `$out/lib/$pname`. If this is unset, all executables generated will get installed. If you do not want to install any, set this to `[]`. This gets done in the `preFixup` phase.
* `runtimeDeps` is used to wrap libraries into `LD_LIBRARY_PATH`. This is how dotnet usually handles runtime dependencies. * `runtimeDeps` is used to wrap libraries into `LD_LIBRARY_PATH`. This is how dotnet usually handles runtime dependencies.
* `buildType` is used to change the type of build. Possible values are `Release`, `Debug`, etc. By default, this is set to `Release`. * `buildType` is used to change the type of build. Possible values are `Release`, `Debug`, etc. By default, this is set to `Release`.
* `selfContainedBuild` allows to enable the [self-contained](https://docs.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained) build flag. By default, it is set to false and generated applications have a dependency on the selected dotnet runtime. If enabled, the dotnet runtime is bundled into the executable and the built app has no dependency on Dotnet. * `selfContainedBuild` allows to enable the [self-contained](https://docs.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained) build flag. By default, it is set to false and generated applications have a dependency on the selected dotnet runtime. If enabled, the dotnet runtime is bundled into the executable and the built app has no dependency on .NET.
* `useAppHost` will enable creation of a binary executable that runs the .NET application using the specified root. More info in [Microsoft docs](https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent). Enabled by default. * `useAppHost` will enable creation of a binary executable that runs the .NET application using the specified root. More info in [Microsoft docs](https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent). Enabled by default.
* `useDotnetFromEnv` will change the binary wrapper so that it uses the .NET from the environment. The runtime specified by `dotnet-runtime` is given as a fallback in case no .NET is installed in the user's environment. This is most useful for .NET global tools and LSP servers, which often extend the .NET CLI and their runtime should match the users' .NET runtime. * `useDotnetFromEnv` will change the binary wrapper so that it uses the .NET from the environment. The runtime specified by `dotnet-runtime` is given as a fallback in case no .NET is installed in the user's environment. This is most useful for .NET global tools and LSP servers, which often extend the .NET CLI and their runtime should match the users' .NET runtime.
* `dotnet-sdk` is useful in cases where you need to change what dotnet SDK is being used. You can also set this to the result of `dotnetSdkPackages.combinePackages`, if the project uses multiple SDKs to build. * `dotnet-sdk` is useful in cases where you need to change what dotnet SDK is being used. You can also set this to the result of `dotnetSdkPackages.combinePackages`, if the project uses multiple SDKs to build.
* `dotnet-runtime` is useful in cases where you need to change what dotnet runtime is being used. This can be either a regular dotnet runtime, or an aspnetcore. * `dotnet-runtime` is useful in cases where you need to change what dotnet runtime is being used. This can be either a regular dotnet runtime, or an aspnetcore.
* `dotnet-test-sdk` is useful in cases where unit tests expect a different dotnet SDK. By default, this is set to the `dotnet-sdk` attribute. * `dotnet-test-sdk` is useful in cases where unit tests expect a different dotnet SDK. By default, this is set to the `dotnet-sdk` attribute.
* `testProjectFile` is useful in cases where the regular project file does not contain the unit tests. It gets restored and build, but not installed. You may need to regenerate your nuget lockfile after setting this. * `testProjectFile` is useful in cases where the regular project file does not contain the unit tests. It gets restored and build, but not installed. You may need to regenerate your nuget lockfile after setting this. Note that if set, only tests from this project are executed.
* `disabledTests` is used to disable running specific unit tests. This gets passed as: `dotnet test --filter "FullyQualifiedName!={}"`, to ensure compatibility with all unit test frameworks. * `disabledTests` is used to disable running specific unit tests. This gets passed as: `dotnet test --filter "FullyQualifiedName!={}"`, to ensure compatibility with all unit test frameworks.
* `dotnetRestoreFlags` can be used to pass flags to `dotnet restore`. * `dotnetRestoreFlags` can be used to pass flags to `dotnet restore`.
* `dotnetBuildFlags` can be used to pass flags to `dotnet build`. * `dotnetBuildFlags` can be used to pass flags to `dotnet build`.

View file

@ -14,11 +14,9 @@ buildDotnetModule rec {
projectFile = "tone/tone.csproj"; projectFile = "tone/tone.csproj";
executables = [ "tone" ]; executables = [ "tone" ];
nugetDeps = ./nuget-deps.nix; nugetDeps = ./nuget-deps.nix;
dotnetBuildFlags = [ "--no-self-contained" ];
dotnetInstallFlags = [ dotnetInstallFlags = [
"-p:PublishSingleFile=false" "-p:PublishSingleFile=false"
"-p:PublishTrimmed=false"
"-p:PublishReadyToRun=false"
]; ];
dotnet-sdk = dotnetCorePackages.sdk_6_0; dotnet-sdk = dotnetCorePackages.sdk_6_0;
@ -29,6 +27,6 @@ buildDotnetModule rec {
description = "A cross platform utility to dump and modify audio metadata for a wide variety of formats"; description = "A cross platform utility to dump and modify audio metadata for a wide variety of formats";
license = licenses.asl20; license = licenses.asl20;
maintainers = [ maintainers.jvanbruegge ]; maintainers = [ maintainers.jvanbruegge ];
platforms = [ "x86_64-linux" ]; platforms = platforms.linux;
}; };
} }

View file

@ -28,7 +28,6 @@
(fetchNuGet { pname = "Microsoft.Extensions.Options.ConfigurationExtensions"; version = "7.0.0"; sha256 = "1liyprh0zha2vgmqh92n8kkjz61zwhr7g16f0gmr297z2rg1j5pj"; }) (fetchNuGet { pname = "Microsoft.Extensions.Options.ConfigurationExtensions"; version = "7.0.0"; sha256 = "1liyprh0zha2vgmqh92n8kkjz61zwhr7g16f0gmr297z2rg1j5pj"; })
(fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "2.0.0"; sha256 = "1xppr5jbny04slyjgngxjdm0maxdh47vq481ps944d7jrfs0p3mb"; }) (fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "2.0.0"; sha256 = "1xppr5jbny04slyjgngxjdm0maxdh47vq481ps944d7jrfs0p3mb"; })
(fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "7.0.0"; sha256 = "1b4km9fszid9vp2zb3gya5ni9fn8bq62bzaas2ck2r7gs0sdys80"; }) (fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "7.0.0"; sha256 = "1b4km9fszid9vp2zb3gya5ni9fn8bq62bzaas2ck2r7gs0sdys80"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-x64"; version = "6.0.18"; sha256 = "12661jkck5wqwc6cr8vq71lqn7k0jm0q86qxw51a0vph24m77irj"; })
(fetchNuGet { pname = "Newtonsoft.Json"; version = "13.0.2"; sha256 = "1p9splg1min274dpz7xdfgzrwkyfd3xlkygwpr1xgjvvyjvs6b0i"; }) (fetchNuGet { pname = "Newtonsoft.Json"; version = "13.0.2"; sha256 = "1p9splg1min274dpz7xdfgzrwkyfd3xlkygwpr1xgjvvyjvs6b0i"; })
(fetchNuGet { pname = "Sandreas.AudioMetadata"; version = "0.1.1"; sha256 = "11ibv23h7qj5qshibmlsqmjca51dqbhib9p1gz66c5kqhk7ci38j"; }) (fetchNuGet { pname = "Sandreas.AudioMetadata"; version = "0.1.1"; sha256 = "11ibv23h7qj5qshibmlsqmjca51dqbhib9p1gz66c5kqhk7ci38j"; })
(fetchNuGet { pname = "Sandreas.Files"; version = "1.1.2"; sha256 = "08qk229q2y1dpdxdnp8xi9mgk8fgpjxrxm4z6ak8n09npp67nhn0"; }) (fetchNuGet { pname = "Sandreas.Files"; version = "1.1.2"; sha256 = "08qk229q2y1dpdxdnp8xi9mgk8fgpjxrxm4z6ak8n09npp67nhn0"; })

View file

@ -1,5 +1,4 @@
{ lib { lib
, stdenvNoCC
, buildDotnetModule , buildDotnetModule
, fetchFromGitHub , fetchFromGitHub
, dotnetCorePackages , dotnetCorePackages
@ -31,10 +30,6 @@ buildDotnetModule rec {
nugetDeps = ./deps.nix; nugetDeps = ./deps.nix;
executables = "NickvisionMoney.GNOME"; executables = "NickvisionMoney.GNOME";
# Prevent installing native libraries for all platforms
dotnetBuildFlags = [ "--runtime" (dotnetCorePackages.systemToDotnetRid stdenvNoCC.hostPlatform.system) ];
dotnetInstallFlags = [ "--runtime" (dotnetCorePackages.systemToDotnetRid stdenvNoCC.hostPlatform.system) ];
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config pkg-config
wrapGAppsHook4 wrapGAppsHook4

View file

@ -2,6 +2,8 @@
, stdenv , stdenv
, which , which
, coreutils , coreutils
, zlib
, openssl
, callPackage , callPackage
, makeSetupHook , makeSetupHook
, makeWrapper , makeWrapper
@ -26,6 +28,14 @@ in
propagatedBuildInputs = [ dotnet-sdk nuget-source ]; propagatedBuildInputs = [ dotnet-sdk nuget-source ];
substitutions = { substitutions = {
nugetSource = nuget-source; nugetSource = nuget-source;
dynamicLinker = "${stdenv.cc}/nix-support/dynamic-linker";
libPath = lib.makeLibraryPath [
stdenv.cc.cc.lib
stdenv.cc.libc
dotnet-sdk.passthru.icu
zlib
openssl
];
inherit runtimeId; inherit runtimeId;
}; };
} ./dotnet-configure-hook.sh) { }; } ./dotnet-configure-hook.sh) { };
@ -44,7 +54,7 @@ in
name = "dotnet-check-hook"; name = "dotnet-check-hook";
propagatedBuildInputs = [ dotnet-test-sdk ]; propagatedBuildInputs = [ dotnet-test-sdk ];
substitutions = { substitutions = {
inherit buildType libraryPath; inherit buildType runtimeId libraryPath;
disabledTests = lib.optionalString (disabledTests != []) disabledTests = lib.optionalString (disabledTests != [])
(let (let
escapedNames = lib.lists.map (n: lib.replaceStrings [","] ["%2C"] n) disabledTests; escapedNames = lib.lists.map (n: lib.replaceStrings [","] ["%2C"] n) disabledTests;

View file

@ -15,7 +15,7 @@ dotnetBuildHook() {
fi fi
if [ "${selfContainedBuild-}" ]; then if [ "${selfContainedBuild-}" ]; then
dotnetBuildFlags+=(--runtime "@runtimeId@" "-p:SelfContained=true") dotnetBuildFlags+=("-p:SelfContained=true")
else else
dotnetBuildFlags+=("-p:SelfContained=false") dotnetBuildFlags+=("-p:SelfContained=false")
fi fi
@ -30,6 +30,12 @@ dotnetBuildHook() {
dotnetBuild() { dotnetBuild() {
local -r project="${1-}" local -r project="${1-}"
runtimeIdFlags=()
if [[ "$project" == *.csproj ]] || [ "${selfContainedBuild-}" ]; then
runtimeIdFlags+=("--runtime @runtimeId@")
fi
env dotnet build ${project-} \ env dotnet build ${project-} \
-maxcpucount:$maxCpuFlag \ -maxcpucount:$maxCpuFlag \
-p:BuildInParallel=$parallelBuildFlag \ -p:BuildInParallel=$parallelBuildFlag \
@ -38,6 +44,7 @@ dotnetBuildHook() {
--configuration "@buildType@" \ --configuration "@buildType@" \
--no-restore \ --no-restore \
${versionFlag-} \ ${versionFlag-} \
${runtimeIdFlags[@]} \
${dotnetBuildFlags[@]} \ ${dotnetBuildFlags[@]} \
${dotnetFlags[@]} ${dotnetFlags[@]}
} }

View file

@ -17,6 +17,11 @@ dotnetCheckHook() {
fi fi
for project in ${testProjectFile[@]-${projectFile[@]}}; do for project in ${testProjectFile[@]-${projectFile[@]}}; do
runtimeIdFlags=()
if [[ "$project" == *.csproj ]]; then
runtimeIdFlags=("--runtime @runtimeId@")
fi
env "LD_LIBRARY_PATH=@libraryPath@" \ env "LD_LIBRARY_PATH=@libraryPath@" \
dotnet test "$project" \ dotnet test "$project" \
-maxcpucount:$maxCpuFlag \ -maxcpucount:$maxCpuFlag \
@ -26,6 +31,7 @@ dotnetCheckHook() {
--no-build \ --no-build \
--logger "console;verbosity=normal" \ --logger "console;verbosity=normal" \
${disabledTestsFlag-} \ ${disabledTestsFlag-} \
${runtimeIdFlags[@]} \
"${dotnetTestFlags[@]}" \ "${dotnetTestFlags[@]}" \
"${dotnetFlags[@]}" "${dotnetFlags[@]}"
done done

View file

@ -51,6 +51,27 @@ EOF
dotnetRestore "$project" dotnetRestore "$project"
done done
echo "Fixing up native binaries..."
# Find all native binaries and nuget libraries, and fix them up,
# by setting the proper interpreter and rpath to some commonly used libraries
for binary in $(find "$HOME/.nuget/packages/" -type f -executable); do
if patchelf --print-interpreter "$binary" >/dev/null 2>/dev/null; then
echo "Found binary: $binary, fixing it up..."
patchelf --set-interpreter "$(cat "@dynamicLinker@")" "$binary"
# This makes sure that if the binary requires some specific runtime dependencies, it can find it.
# This fixes dotnet-built binaries like crossgen2
patchelf \
--add-needed libicui18n.so \
--add-needed libicuuc.so \
--add-needed libz.so \
--add-needed libssl.so \
"$binary"
patchelf --set-rpath "@libPath@" "$binary"
fi
done
runHook postConfigure runHook postConfigure
echo "Finished dotnetConfigureHook" echo "Finished dotnetConfigureHook"

View file

@ -7,9 +7,12 @@ dotnetInstallHook() {
runHook preInstall runHook preInstall
if [ "${selfContainedBuild-}" ]; then if [ "${selfContainedBuild-}" ]; then
dotnetInstallFlags+=(--runtime "@runtimeId@" "--self-contained") dotnetInstallFlags+=("--self-contained")
else else
dotnetInstallFlags+=("--no-self-contained") dotnetInstallFlags+=("--no-self-contained")
# https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained
# Trimming is only available for self-contained build, so force disable it here
dotnetInstallFlags+=("-p:PublishTrimmed=false")
fi fi
if [ "${useAppHost-}" ]; then if [ "${useAppHost-}" ]; then
@ -18,12 +21,19 @@ dotnetInstallHook() {
dotnetPublish() { dotnetPublish() {
local -r project="${1-}" local -r project="${1-}"
runtimeIdFlags=()
if [[ "$project" == *.csproj ]] || [ "${selfContainedBuild-}" ]; then
runtimeIdFlags+=("--runtime @runtimeId@")
fi
env dotnet publish ${project-} \ env dotnet publish ${project-} \
-p:ContinuousIntegrationBuild=true \ -p:ContinuousIntegrationBuild=true \
-p:Deterministic=true \ -p:Deterministic=true \
--output "$out/lib/${pname}" \ --output "$out/lib/${pname}" \
--configuration "@buildType@" \ --configuration "@buildType@" \
--no-build \ --no-build \
${runtimeIdFlags[@]} \
${dotnetInstallFlags[@]} \ ${dotnetInstallFlags[@]} \
${dotnetFlags[@]} ${dotnetFlags[@]}
} }
@ -36,6 +46,7 @@ dotnetInstallHook() {
--output "$out/share" \ --output "$out/share" \
--configuration "@buildType@" \ --configuration "@buildType@" \
--no-build \ --no-build \
--runtime "@runtimeId@" \
${dotnetPackFlags[@]} \ ${dotnetPackFlags[@]} \
${dotnetFlags[@]} ${dotnetFlags[@]}
} }

View file

@ -122,7 +122,7 @@ stdenv.mkDerivation (finalAttrs: rec {
export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_CLI_TELEMETRY_OPTOUT=1
''; '';
passthru = rec { passthru = {
inherit icu; inherit icu;
packages = packageDeps; packages = packageDeps;

View file

@ -5,7 +5,7 @@ dotnetCombined = with dotnetCorePackages; combinePackages [ sdk_6_0 aspnetcore_7
Hashes and urls are retrieved from: Hashes and urls are retrieved from:
https://dotnet.microsoft.com/download/dotnet https://dotnet.microsoft.com/download/dotnet
*/ */
{ callPackage,}: { callPackage }:
let let
buildDotnet = attrs: callPackage (import ./build-dotnet.nix attrs) {}; buildDotnet = attrs: callPackage (import ./build-dotnet.nix attrs) {};
buildAttrs = { buildAttrs = {
@ -31,7 +31,7 @@ let
# Convert a "stdenv.hostPlatform.system" to a dotnet RID # Convert a "stdenv.hostPlatform.system" to a dotnet RID
systemToDotnetRid = system: runtimeIdentifierMap.${system} or (throw "unsupported platform ${system}"); systemToDotnetRid = system: runtimeIdentifierMap.${system} or (throw "unsupported platform ${system}");
in in
rec { {
inherit systemToDotnetRid; inherit systemToDotnetRid;
combinePackages = attrs: callPackage (import ./combine-packages.nix attrs) {}; combinePackages = attrs: callPackage (import ./combine-packages.nix attrs) {};

View file

@ -241,6 +241,14 @@ sdk_packages () {
"runtime.osx-arm64.Microsoft.NETCore.DotNetHost" \ "runtime.osx-arm64.Microsoft.NETCore.DotNetHost" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy" \ "runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver" \ "runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver" \
"Microsoft.NETCore.App.Crossgen2.linux-musl-arm" \
"Microsoft.NETCore.App.Crossgen2.linux-musl-arm64" \
"Microsoft.NETCore.App.Crossgen2.linux-musl-x64" \
"Microsoft.NETCore.App.Crossgen2.linux-arm" \
"Microsoft.NETCore.App.Crossgen2.linux-arm64" \
"Microsoft.NETCore.App.Crossgen2.linux-x64" \
"Microsoft.NETCore.App.Crossgen2.osx-x64" \
"Microsoft.NETCore.App.Crossgen2.osx-arm64"
) )
# Packages that only apply to .NET 7 and up # Packages that only apply to .NET 7 and up

View file

@ -166,6 +166,14 @@
(fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHost"; version = "6.0.18"; sha256 = "0c95g1kapwsrbz51myhzpd1wviwlhvknhyfl3q5jy03z1kymxscj"; }) (fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHost"; version = "6.0.18"; sha256 = "0c95g1kapwsrbz51myhzpd1wviwlhvknhyfl3q5jy03z1kymxscj"; })
(fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy"; version = "6.0.18"; sha256 = "1iy2n5b3wwarsrkhm937f87rir7md45m5hm51qfzr5i3bx5vabcg"; }) (fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy"; version = "6.0.18"; sha256 = "1iy2n5b3wwarsrkhm937f87rir7md45m5hm51qfzr5i3bx5vabcg"; })
(fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver"; version = "6.0.18"; sha256 = "09f5dcdvnfs9ax5i4b6kqpj7frhw66madla71i2m3azayqd0kis1"; }) (fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver"; version = "6.0.18"; sha256 = "09f5dcdvnfs9ax5i4b6kqpj7frhw66madla71i2m3azayqd0kis1"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-musl-arm"; version = "6.0.18"; sha256 = "1wx2kpgprpzm95h314hxjwfx3qglsy1g3ssrk34n4znswxf68czd"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-musl-arm64"; version = "6.0.18"; sha256 = "07yfp1mn4pk81ispcxz513vkgzjc0295wvlhb2lyfly70j5221vh"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-musl-x64"; version = "6.0.18"; sha256 = "0fw1i6zc9jzbsk5gkz3ns9qcsi58mjn6g8wq2y67amacc3m918aw"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-arm"; version = "6.0.18"; sha256 = "1yfxlcxrrpmgn5m415wxnca4xd6gy9z0wqrlhk8v6n33gzhyr84y"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-arm64"; version = "6.0.18"; sha256 = "0yqwq66fnbylgwxvrin3qkmhza1ciq73x4sl54dgq7vj4sz7r0q3"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-x64"; version = "6.0.18"; sha256 = "12661jkck5wqwc6cr8vq71lqn7k0jm0q86qxw51a0vph24m77irj"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.osx-x64"; version = "6.0.18"; sha256 = "16x0mlckhlaqq9lm8d50mg4fhb7290vc4kp6gdk6bxg9j1nl9pza"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.osx-arm64"; version = "6.0.18"; sha256 = "0k30ck2gkv09g8jgalnrdiz39i6lpsq9ky1c9y35dvg0mclcixc3"; })
]; ];
}; };
} }

View file

@ -166,6 +166,14 @@
(fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHost"; version = "7.0.7"; sha256 = "1x0bd7b6yjm38k64df1l7jwl6fn1n0wgba8pxrb1dw97ijcq6pds"; }) (fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHost"; version = "7.0.7"; sha256 = "1x0bd7b6yjm38k64df1l7jwl6fn1n0wgba8pxrb1dw97ijcq6pds"; })
(fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy"; version = "7.0.7"; sha256 = "0cri9fbrsdah7xr4x9qy73n3pj0zmrwc8xc8a8zj299xmjx41srp"; }) (fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy"; version = "7.0.7"; sha256 = "0cri9fbrsdah7xr4x9qy73n3pj0zmrwc8xc8a8zj299xmjx41srp"; })
(fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver"; version = "7.0.7"; sha256 = "0dp8j9dc46v46zza9i4i7ywn3cz43fxyhzhiwls6nzc9z0y3xnjb"; }) (fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver"; version = "7.0.7"; sha256 = "0dp8j9dc46v46zza9i4i7ywn3cz43fxyhzhiwls6nzc9z0y3xnjb"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-musl-arm"; version = "7.0.7"; sha256 = "1difx4s84s5s8yq66qc8j7ldzchlj8han4syalnfw4mx35syh3r9"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-musl-arm64"; version = "7.0.7"; sha256 = "0dkzcanshijp0x836rdj1bydpzxnvwk13jjils9kl0503yk91ln5"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-musl-x64"; version = "7.0.7"; sha256 = "1a4m6dkl7plsxv3m0b64nkmdbh6jif0qxi2861qpdh8wd904nl51"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-arm"; version = "7.0.7"; sha256 = "0yb7rycgcvd4rg3rqb56pqfyqrixyz8a0j0iacsb5773k1l2c0lr"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-arm64"; version = "7.0.7"; sha256 = "0myh03v7czlc1sm3b9gqn4m5qm94vc6qar483678mi3d6fmb0c7x"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-x64"; version = "7.0.7"; sha256 = "1fq4zy6af3pidsjqi663kb6354cpayyrd30hd1zhfm14kz00cgg5"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.osx-x64"; version = "7.0.7"; sha256 = "1x15r1d66s0qn9s9lj5dad4g6qfx0pmphix7nbw88pb2fp2az0ia"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.osx-arm64"; version = "7.0.7"; sha256 = "0dd67jl5hd0mq1vl51f4nn4s6pwhssldj7gn4y2adb2vlpwd5zq7"; })
(fetchNuGet { pname = "runtime.linux-arm64.Microsoft.DotNet.ILCompiler"; version = "7.0.7"; sha256 = "12ayxmqacv8n38vvp79g23wd443zs2ws8k64p08pr8aymcpx22k6"; }) (fetchNuGet { pname = "runtime.linux-arm64.Microsoft.DotNet.ILCompiler"; version = "7.0.7"; sha256 = "12ayxmqacv8n38vvp79g23wd443zs2ws8k64p08pr8aymcpx22k6"; })
(fetchNuGet { pname = "runtime.linux-musl-arm64.Microsoft.DotNet.ILCompiler"; version = "7.0.7"; sha256 = "1bm9rzs5lr6a8qxavy7drjv5z1vwxyh1fcv9cag2d7g91q9ljhxn"; }) (fetchNuGet { pname = "runtime.linux-musl-arm64.Microsoft.DotNet.ILCompiler"; version = "7.0.7"; sha256 = "1bm9rzs5lr6a8qxavy7drjv5z1vwxyh1fcv9cag2d7g91q9ljhxn"; })
(fetchNuGet { pname = "runtime.linux-musl-x64.Microsoft.DotNet.ILCompiler"; version = "7.0.7"; sha256 = "1hb8dd0hwmng2j6bk1s76lkl9ap1rw687cjccv5g79h30fadcf2s"; }) (fetchNuGet { pname = "runtime.linux-musl-x64.Microsoft.DotNet.ILCompiler"; version = "7.0.7"; sha256 = "1hb8dd0hwmng2j6bk1s76lkl9ap1rw687cjccv5g79h30fadcf2s"; })

View file

@ -166,6 +166,14 @@
(fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHost"; version = "8.0.0-preview.5.23280.8"; sha256 = "13iavci8n0ahsl5k1xasribk93gmkxd3s67xgagasc1gzpkxm8q2"; }) (fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHost"; version = "8.0.0-preview.5.23280.8"; sha256 = "13iavci8n0ahsl5k1xasribk93gmkxd3s67xgagasc1gzpkxm8q2"; })
(fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy"; version = "8.0.0-preview.5.23280.8"; sha256 = "16aa6sgblm4l1fzsgllmxsxn57qnx430z12n6hm3m08qrlmcpyd9"; }) (fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy"; version = "8.0.0-preview.5.23280.8"; sha256 = "16aa6sgblm4l1fzsgllmxsxn57qnx430z12n6hm3m08qrlmcpyd9"; })
(fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver"; version = "8.0.0-preview.5.23280.8"; sha256 = "05k0h0p6yc02np4m7jdhmc8c2105b22wdldbsklx4rl3jqy7m6p3"; }) (fetchNuGet { pname = "runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver"; version = "8.0.0-preview.5.23280.8"; sha256 = "05k0h0p6yc02np4m7jdhmc8c2105b22wdldbsklx4rl3jqy7m6p3"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-musl-arm"; version = "8.0.0-preview.5.23280.8"; sha256 = "1yvaiqblqmsrydbf9gr18rp6d9rqqpzahzxhc62hixfh59l55mi7"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-musl-arm64"; version = "8.0.0-preview.5.23280.8"; sha256 = "06i72xhd0ji755wj8bczv8x8mynyf2kxhx7ysn70crrkk0b7921h"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-musl-x64"; version = "8.0.0-preview.5.23280.8"; sha256 = "02ks9j1mybb3f34mjky09nw22la6nhfmkjj5g5gczspqfcc6a2dw"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-arm"; version = "8.0.0-preview.5.23280.8"; sha256 = "15plhhljfyaj0cdpsqyq3n0q747p90nvl5kwj6amccadkcy7ahnk"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-arm64"; version = "8.0.0-preview.5.23280.8"; sha256 = "09vvjm9a7nh6bd8ldf1f0vz1iafp4v77q5d78382hfqan8r505id"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.linux-x64"; version = "8.0.0-preview.5.23280.8"; sha256 = "1p21siacj11nbba5czcg4ppk7wny2p3rc2wxg30vs1jj45qvf82c"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.osx-x64"; version = "8.0.0-preview.5.23280.8"; sha256 = "1h6xrjvgn0bl615bwmr5l5gpw4qxhbzsqd7sb57m8597cjqc8m35"; })
(fetchNuGet { pname = "Microsoft.NETCore.App.Crossgen2.osx-arm64"; version = "8.0.0-preview.5.23280.8"; sha256 = "0fymmvixx0wh1qa5hrazfr27n0hr3dj1gppipy3mslm325m1zdf4"; })
(fetchNuGet { pname = "runtime.linux-arm64.Microsoft.DotNet.ILCompiler"; version = "8.0.0-preview.5.23280.8"; sha256 = "0z6cny0jzbwd7skgc3lji00j1z061j4yacrjbhysnq5z5g563r75"; }) (fetchNuGet { pname = "runtime.linux-arm64.Microsoft.DotNet.ILCompiler"; version = "8.0.0-preview.5.23280.8"; sha256 = "0z6cny0jzbwd7skgc3lji00j1z061j4yacrjbhysnq5z5g563r75"; })
(fetchNuGet { pname = "runtime.linux-musl-arm64.Microsoft.DotNet.ILCompiler"; version = "8.0.0-preview.5.23280.8"; sha256 = "0f72algnr7kknbvw1b17vlw6wvkghw8v4n9fji7ppwbrd8g8i8b0"; }) (fetchNuGet { pname = "runtime.linux-musl-arm64.Microsoft.DotNet.ILCompiler"; version = "8.0.0-preview.5.23280.8"; sha256 = "0f72algnr7kknbvw1b17vlw6wvkghw8v4n9fji7ppwbrd8g8i8b0"; })
(fetchNuGet { pname = "runtime.linux-musl-x64.Microsoft.DotNet.ILCompiler"; version = "8.0.0-preview.5.23280.8"; sha256 = "1bcps96s8n5iwshxjqwbdvhhr5nkh1f1hn4k79gw1q8ic1c4giq9"; }) (fetchNuGet { pname = "runtime.linux-musl-x64.Microsoft.DotNet.ILCompiler"; version = "8.0.0-preview.5.23280.8"; sha256 = "1bcps96s8n5iwshxjqwbdvhhr5nkh1f1hn4k79gw1q8ic1c4giq9"; })

View file

@ -39,18 +39,7 @@ buildDotnetModule rec {
"EventStore.Projections.Core.Tests.Services.grpc_service.ServerFeaturesTests<LogFormat+V3,UInt32>.should_receive_expected_endpoints" "EventStore.Projections.Core.Tests.Services.grpc_service.ServerFeaturesTests<LogFormat+V3,UInt32>.should_receive_expected_endpoints"
]; ];
nugetBinariesToPatch = lib.optionals stdenv.isLinux [
"grpc.tools/2.49.1/tools/linux_x64/protoc"
"grpc.tools/2.49.1/tools/linux_x64/grpc_csharp_plugin"
];
postConfigure = '' postConfigure = ''
# Fixes execution of native protoc binaries during build
for binary in $nugetBinariesToPatch; do
path="$HOME/.nuget/packages/$binary"
patchelf --set-interpreter "$(cat $NIX_BINTOOLS/nix-support/dynamic-linker)" $path
done
# Fixes git execution by GitInfo on mac os # Fixes git execution by GitInfo on mac os
substituteInPlace "$HOME/.nuget/packages/gitinfo/2.0.26/build/GitInfo.targets" \ substituteInPlace "$HOME/.nuget/packages/gitinfo/2.0.26/build/GitInfo.targets" \
--replace "<GitExe Condition=\"Exists('/usr/bin/git')\">/usr/bin/git</GitExe>" " " \ --replace "<GitExe Condition=\"Exists('/usr/bin/git')\">/usr/bin/git</GitExe>" " " \