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

dotnet: add override mechanism for nuget packages #339953

Merged
merged 19 commits into from
Sep 7, 2024

Conversation

corngood
Copy link
Contributor

@corngood corngood commented Sep 6, 2024

Description of changes

Cc: @NixOS/dotnet

This is some of the stuff from #336824, plus a bunch of fixes for problems I found along the way. I've built all packages before and after a fetch-deps. I've run all the packages that depend on avalonia to ensure they at least show a UI.

  • various fixes to fetch-deps, mostly knock-ons of the switch to unpacked packages

  • clean up buildDotnetModule argument attribute sets

Stripping out what's used in nix, inheriting default values, etc.

  • move mkNugetDeps/Source into dotnetCorePackages (still inherited in all-packages)
  • split dotnetCorePackages.fetchNupkg** from mkNugetDeps, also in dotnetCorePackages

I wanted the fetcher to be exposed, but separated from the obsolete (?) fetchNuGet to make it a little less confusing.

  • remove mkNugetDeps from buildDotnetModule
  • add override mechanism for fetchNupkg

This is the important architectural change. Adding all the nuget deps as build inputs allows them to specify hooks, propagate dependencies, etc.

The override mechanism allows patching nuget packages by name. As an example I've dealt with some of the dependencies of skiasharp and avalonia.x11, and pulled the runtime deps out of the dependent packages.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Some packages assume TMPDIR is unshared, even in nix-shell.
This fixes nuget-to-nix in projects that use the source-built sdk and
`linkNugetPackages`.
Unpacking to the build root was a bad idea. stdenv uses dumpVars() to
create a file env-vars containing the entire environment.  This was
being installed in the derivation output, and since it contains lots of
store paths, it was bloating the closure for every nuget package.
@github-actions github-actions bot added the 6.topic: dotnet Language: .NET label Sep 6, 2024
@corngood corngood marked this pull request as draft September 6, 2024 02:18
@corngood
Copy link
Contributor Author

corngood commented Sep 6, 2024

Result of nixpkgs-review pr 339953 run on x86_64-linux 1

137 packages built:
  • ArchiSteamFarm
  • alttpr-opentracker
  • am2rlauncher
  • avalonia-ilspy
  • azure-functions-core-tools
  • beatsabermodmanager
  • bicep
  • blendfarm
  • boogie
  • btcpayserver
  • btcpayserver-altcoins
  • cavalier
  • celeste64
  • certdump
  • csharp-ls
  • csharpier
  • csharprepl
  • cyclonedx-cli
  • dafny
  • denaro
  • depotdownloader
  • discordchatexporter-cli
  • dotnet-outdated
  • dotnet-sdk
  • dotnet-sdk_7
  • dotnet-sdk_8
  • dotnetCorePackages.dotnet_8.aspnetcore
  • dotnetCorePackages.dotnet_8.runtime
  • dotnetCorePackages.dotnet_8.sdk
  • dotnetCorePackages.dotnet_8.sdk.artifacts
  • dotnetCorePackages.dotnet_8.sdk.packages
  • dotnetCorePackages.dotnet_8.vmr
  • dotnetCorePackages.dotnet_9.aspnetcore
  • dotnetCorePackages.dotnet_9.runtime
  • dotnetCorePackages.dotnet_9.sdk
  • dotnetCorePackages.dotnet_9.sdk.artifacts
  • dotnetCorePackages.dotnet_9.sdk.packages
  • dotnetCorePackages.dotnet_9.vmr
  • dotnetCorePackages.sdk_6_0_1xx
  • dotnetCorePackages.sdk_7_0_1xx
  • dotnetCorePackages.sdk_7_0_3xx
  • dotnetCorePackages.sdk_8_0_1xx
  • dotnetCorePackages.sdk_8_0_3xx
  • dotnetCorePackages.sdk_9_0
  • eventstore
  • fable
  • famistudio
  • fantomas
  • formula
  • fsautocomplete
  • galaxy-buds-client
  • garnet
  • gh-gei
  • git-credential-manager
  • github-runner
  • gitversion
  • godot3-mono
  • godot3-mono-debug-server
  • godot3-mono-export-templates
  • godot3-mono-headless
  • godot3-mono-headless.dev
  • godot3-mono-headless.man
  • godot3-mono-server
  • godot3-mono.dev
  • godot3-mono.man
  • ilspycmd
  • inklecate
  • jackett
  • jellyfin
  • jetbrains.clion
  • jetbrains.rider
  • juniper
  • kavita
  • knossosnet
  • kryptor
  • libation
  • lubelogger
  • lumafly
  • marksman
  • mqttmultimeter
  • msbuild
  • naps2
  • nbxplorer
  • netcoredbg
  • networkminer
  • nexusmods-app
  • nexusmods-app-unfree
  • nixpkgs-manual
  • nuget-to-nix
  • omnisharp-roslyn
  • openra
  • opentabletdriver
  • openutau
  • osu-lazer
  • pablodraw
  • parabolic
  • pbm
  • pinta
  • pre-commit
  • pre-commit.dist
  • ps3-disc-dumper
  • pupdate
  • python311Packages.asteroid-filterbanks
  • python311Packages.asteroid-filterbanks.dist
  • python311Packages.clr-loader
  • python311Packages.clr-loader.dist
  • python311Packages.pyannote-audio
  • python311Packages.pyannote-audio.dist
  • python311Packages.pythonnet
  • python311Packages.pythonnet.dist
  • python312Packages.asteroid-filterbanks
  • python312Packages.asteroid-filterbanks.dist
  • python312Packages.clr-loader
  • python312Packages.clr-loader.dist
  • python312Packages.pyannote-audio
  • python312Packages.pyannote-audio.dist
  • python312Packages.pythonnet
  • python312Packages.pythonnet.dist
  • recyclarr
  • retrospy
  • roslyn
  • roslyn-ls
  • ryujinx
  • scarab
  • slskd
  • sonarr
  • space-station-14-launcher
  • tagger
  • technitium-dns-server
  • tone
  • torrentstream
  • vimPluginsUpdater
  • wasabibackend
  • whisper-ctranslate2
  • whisper-ctranslate2.dist
  • wiseunpacker
  • xivlauncher

@corngood corngood marked this pull request as ready for review September 6, 2024 04:23
@corngood
Copy link
Contributor Author

corngood commented Sep 6, 2024

Result of nixpkgs-review run on aarch64-darwin 1

8 packages marked as broken and skipped:
  • certdump
  • pablodraw
  • python311Packages.pyannote-audio
  • python311Packages.pyannote-audio.dist
  • python312Packages.pyannote-audio
  • python312Packages.pyannote-audio.dist
  • whisper-ctranslate2
  • whisper-ctranslate2.dist
82 packages built:
  • ArchiSteamFarm
  • avalonia-ilspy
  • azure-functions-core-tools
  • bicep
  • blendfarm
  • boogie
  • btcpayserver
  • btcpayserver-altcoins
  • csharp-ls
  • csharpier
  • csharprepl
  • cyclonedx-cli
  • dafny
  • depotdownloader
  • dotnet-outdated
  • dotnet-sdk
  • dotnet-sdk_7
  • dotnet-sdk_8
  • dotnetCorePackages.dotnet_8.aspnetcore
  • dotnetCorePackages.dotnet_8.runtime
  • dotnetCorePackages.dotnet_8.sdk
  • dotnetCorePackages.dotnet_8.sdk.artifacts
  • dotnetCorePackages.dotnet_8.sdk.packages
  • dotnetCorePackages.dotnet_8.vmr
  • dotnetCorePackages.dotnet_9.aspnetcore
  • dotnetCorePackages.dotnet_9.runtime
  • dotnetCorePackages.dotnet_9.sdk
  • dotnetCorePackages.dotnet_9.sdk.artifacts
  • dotnetCorePackages.dotnet_9.sdk.packages
  • dotnetCorePackages.dotnet_9.vmr
  • dotnetCorePackages.sdk_6_0_1xx
  • dotnetCorePackages.sdk_7_0_1xx
  • dotnetCorePackages.sdk_7_0_3xx
  • dotnetCorePackages.sdk_8_0_1xx
  • dotnetCorePackages.sdk_8_0_3xx
  • dotnetCorePackages.sdk_9_0
  • famistudio
  • fantomas
  • formula
  • fsautocomplete
  • garnet
  • gh-gei
  • git-credential-manager
  • github-runner
  • gitversion
  • ilspycmd
  • jackett
  • jellyfin
  • juniper
  • knossosnet
  • kryptor
  • libation
  • lubelogger
  • marksman
  • msbuild
  • nbxplorer
  • netcoredbg
  • nixpkgs-manual
  • nuget-to-nix
  • omnisharp-roslyn
  • openutau
  • pre-commit
  • pre-commit.dist
  • python311Packages.asteroid-filterbanks
  • python311Packages.asteroid-filterbanks.dist
  • python311Packages.clr-loader
  • python311Packages.clr-loader.dist
  • python311Packages.pythonnet
  • python311Packages.pythonnet.dist
  • python312Packages.asteroid-filterbanks
  • python312Packages.asteroid-filterbanks.dist
  • python312Packages.clr-loader
  • python312Packages.clr-loader.dist
  • python312Packages.pythonnet
  • python312Packages.pythonnet.dist
  • recyclarr
  • roslyn
  • roslyn-ls
  • sonarr
  • torrentstream
  • vimPluginsUpdater
  • wiseunpacker

Copy link
Contributor

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think someone with more dotnet knowledge should also review, but I'm impressed with the overall direction!

Being able to apply overrides to the deps resolved by fetch-deps is a massive improvement, as is getting transitive runtime deps automagically.

Comment on lines +128 to +144
removeAttrs args [
"nugetDeps"
"installPath"
"executables"
"projectFile"
"projectReferences"
"runtimeDeps"
"runtimeId"
"disabledTests"
"testProjectFile"
"buildType"
"selfContainedBuild"
"useDotnet"
"useAppHost"
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change unfortunately. roslyn-ls for example, was using $projectFile, and needed to be changed to $dotnetProjectFiles.

It's a little unintuitive that something like:

projectFile = "foo";
buildPhase = "echo $projectFile";

doesn't work. @tie you did #339335. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I ask, what's the motivation for prefixing dotnet-specific derivation args in the first place?

I struggle to see how name conflicts would happen, for instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For buildDotnetModules I agree. I probably wouldn't have prefixed them.

For hooks like dotnet-sdk-setup-hook I'm trying to be careful about collisions, because I want that stuff to work well in a mixed build environment. Ideally I'd like it to be as easy to build a dotnet project with stdenv[NoCC] as with buildDotnetModule.

Copy link
Contributor

@MattSturgeon MattSturgeon Sep 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For hooks like dotnet-sdk-setup-hook I'm trying to be careful about collisions, because I want that stuff to work well in a mixed build environment.

Makes sense. 👍

This is a breaking change unfortunately. roslyn-ls for example, was using $projectFile, and needed to be changed to $dotnetProjectFiles.

From my perspective, we have the verbose/prefixed names for anything handled by the dotnet hook, since that hook may be used with arbitrary stdenv derivations and therefore should avoid potential name collisions.

The arguments used by buildDotnetModule could therefore almost be thought of as aliases, since the verbosity is redundant in that context.

Looking at it from this perspective, I don't think it is such a bad thing for buildDotnetModule to pass all its arguments to stdenv.

On reflection I think this is the least surprising behaviour, even if it does feel a little messy internally; an end user (packager) would likely expect any argument they've passed to a builder function to be also made available in stdenv.

Ideally I'd like it to be as easy to build a dotnet project with stdenv[NoCC] as with buildDotnetModule.

That sounds great!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On reflection I think this is the least surprising behaviour, even if it does feel a little messy internally; an end user (packager) would likely expect any argument they've passed to a builder function to be also made available in stdenv.

One problem with that is sometimes, like with nugetDeps, there are negative consequences to including it.

Stripping them definitely feels wrong though. Like either it should be two separate attrset arguments, or one as an attribute in the other.

pkgs/build-support/dotnet/build-dotnet-module/default.nix Outdated Show resolved Hide resolved
@MattSturgeon MattSturgeon added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Sep 6, 2024
@corngood corngood requested a review from tie September 6, 2024 14:13
@khaneliman
Copy link
Contributor

khaneliman commented Sep 6, 2024

Getting this error trying to build:

> patchPhase completed in 59 seconds
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Updating Autotools / GNU config script to a newer upstream version: ./src/runtime/src/native/external/zlib-ng/tools/config.sub
       > Running phase: configurePhase
       >   ./.dotnet SDK directory exists...it will not be installed
       > =========/private/tmp/nix-build-dotnet-vmr-9.0.0-preview.7.drv-0/dotnet-9.0.0-preview.7.24405.7/eng/detect-binaries.sh: line 135:  6460 Bus error: 10           /private/tmp/nix-build-dotnet-vmr-9.0.0-preview.7.drv-0/dotnet-9.0.0-preview.7.24405.7/.dotnet/dotnet run --project /private/tmp/nix-build-dotnet-vmr-9.0.0-preview.7.drv-0/dotnet-9.0.0-preview.7.24405.7/eng/tools/BinaryToolKit -c Release --property:RestoreSources=/nix/store/7zl5mn4dsynlbfws5ffi4zs4jlnkcnjw-Private.SourceBuilt.Artifacts.9.0.100-preview.7.24380.1.centos.9-x64 clean /private/tmp/nix-build-dotnet-vmr-9.0.0-preview.7.drv-0/dotnet-9.0.0-preview.7.24405.7 -o /private/tmp/nix-build-dotnet-vmr-9.0.0-preview.7.drv-0/dotnet-9.0.0-preview.7.24405.7/artifacts/log/binary-report -ab /private/tmp/nix-build-dotnet-vmr-9.0.0-preview.7.drv-0/dotnet-9.0.0-preview.7.24405.7/eng/allowed-sb-binaries.txt -l Debug -p CustomPackageVersionsProps=/nix/store/7zl5mn4dsynlbfws5ffi4zs4jlnkcnjw-Private.SourceBuilt.Artifacts.9.0.100-preview.7.24380.1.centos.9-x64/PackageVersions.props

iirc though, dotnet 9 is broken on darwin already. i'll try to just build one of the GUI applications.

@corngood
Copy link
Contributor Author

corngood commented Sep 6, 2024

iirc though, dotnet 9 is broken on darwin already. i'll try to just build one of the GUI applications.

Hmm, I was able to build dotnet 9 on darwin, even in the sandbox. Maybe it's dependent on OS version?

If you could try any of the avalonia apps, that would be great. avalonia-ilspy is probably a good option.

@khaneliman
Copy link
Contributor

image

@khaneliman
Copy link
Contributor

khaneliman commented Sep 6, 2024

I'm running it again to see if there were any transient errors. It seems to take a while on a few packages. Dotnet 8 not building would trouble me more than 9....

Result of nixpkgs-review pr 339953 run on aarch64-darwin 1

8 packages marked as broken and skipped:
  • certdump
  • pablodraw
  • python311Packages.pyannote-audio
  • python311Packages.pyannote-audio.dist
  • python312Packages.pyannote-audio
  • python312Packages.pyannote-audio.dist
  • whisper-ctranslate2
  • whisper-ctranslate2.dist
12 packages failed to build:
  • dotnetCorePackages.dotnet_8.aspnetcore
  • dotnetCorePackages.dotnet_8.runtime
  • dotnetCorePackages.dotnet_8.sdk
  • dotnetCorePackages.dotnet_8.sdk.artifacts
  • dotnetCorePackages.dotnet_8.sdk.packages
  • dotnetCorePackages.dotnet_8.vmr
  • dotnetCorePackages.dotnet_9.aspnetcore
  • dotnetCorePackages.dotnet_9.runtime
  • dotnetCorePackages.dotnet_9.sdk
  • dotnetCorePackages.dotnet_9.sdk.artifacts
  • dotnetCorePackages.dotnet_9.sdk.packages
  • dotnetCorePackages.dotnet_9.vmr
70 packages built:
  • ArchiSteamFarm
  • avalonia-ilspy
  • azure-functions-core-tools
  • bicep
  • blendfarm
  • boogie
  • btcpayserver
  • btcpayserver-altcoins
  • csharp-ls
  • csharpier
  • csharprepl
  • cyclonedx-cli
  • dafny
  • depotdownloader
  • dotnet-outdated
  • dotnet-sdk
  • dotnet-sdk_7
  • dotnet-sdk_8
  • dotnetCorePackages.sdk_6_0_1xx
  • dotnetCorePackages.sdk_7_0_1xx
  • dotnetCorePackages.sdk_7_0_3xx
  • dotnetCorePackages.sdk_8_0_1xx
  • dotnetCorePackages.sdk_8_0_3xx
  • dotnetCorePackages.sdk_9_0
  • famistudio
  • fantomas
  • formula
  • fsautocomplete
  • garnet
  • gh-gei
  • git-credential-manager
  • github-runner
  • gitversion
  • ilspycmd
  • jackett
  • jellyfin
  • juniper
  • knossosnet
  • kryptor
  • libation
  • lubelogger
  • marksman
  • msbuild
  • nbxplorer
  • netcoredbg
  • nixpkgs-manual
  • nuget-to-nix
  • omnisharp-roslyn
  • openutau
  • pre-commit
  • pre-commit.dist
  • python311Packages.asteroid-filterbanks
  • python311Packages.asteroid-filterbanks.dist
  • python311Packages.clr-loader
  • python311Packages.clr-loader.dist
  • python311Packages.pythonnet
  • python311Packages.pythonnet.dist
  • python312Packages.asteroid-filterbanks
  • python312Packages.asteroid-filterbanks.dist
  • python312Packages.clr-loader
  • python312Packages.clr-loader.dist
  • python312Packages.pythonnet
  • python312Packages.pythonnet.dist
  • recyclarr
  • roslyn
  • roslyn-ls
  • sonarr
  • torrentstream
  • vimPluginsUpdater
  • wiseunpacker

@khaneliman
Copy link
Contributor

Result of nixpkgs-review pr 339953 run on aarch64-darwin 1

8 packages marked as broken and skipped:
  • certdump
  • pablodraw
  • python311Packages.pyannote-audio
  • python311Packages.pyannote-audio.dist
  • python312Packages.pyannote-audio
  • python312Packages.pyannote-audio.dist
  • whisper-ctranslate2
  • whisper-ctranslate2.dist
6 packages failed to build:
  • dotnetCorePackages.dotnet_9.aspnetcore
  • dotnetCorePackages.dotnet_9.runtime
  • dotnetCorePackages.dotnet_9.sdk
  • dotnetCorePackages.dotnet_9.sdk.artifacts
  • dotnetCorePackages.dotnet_9.sdk.packages
  • dotnetCorePackages.dotnet_9.vmr
76 packages built:
  • ArchiSteamFarm
  • avalonia-ilspy
  • azure-functions-core-tools
  • bicep
  • blendfarm
  • boogie
  • btcpayserver
  • btcpayserver-altcoins
  • csharp-ls
  • csharpier
  • csharprepl
  • cyclonedx-cli
  • dafny
  • depotdownloader
  • dotnet-outdated
  • dotnet-sdk
  • dotnet-sdk_7
  • dotnet-sdk_8
  • dotnetCorePackages.dotnet_8.aspnetcore
  • dotnetCorePackages.dotnet_8.runtime
  • dotnetCorePackages.dotnet_8.sdk
  • dotnetCorePackages.dotnet_8.sdk.artifacts
  • dotnetCorePackages.dotnet_8.sdk.packages
  • dotnetCorePackages.dotnet_8.vmr
  • dotnetCorePackages.sdk_6_0_1xx
  • dotnetCorePackages.sdk_7_0_1xx
  • dotnetCorePackages.sdk_7_0_3xx
  • dotnetCorePackages.sdk_8_0_1xx
  • dotnetCorePackages.sdk_8_0_3xx
  • dotnetCorePackages.sdk_9_0
  • famistudio
  • fantomas
  • formula
  • fsautocomplete
  • garnet
  • gh-gei
  • git-credential-manager
  • github-runner
  • gitversion
  • ilspycmd
  • jackett
  • jellyfin
  • juniper
  • knossosnet
  • kryptor
  • libation
  • lubelogger
  • marksman
  • msbuild
  • nbxplorer
  • netcoredbg
  • nixpkgs-manual
  • nuget-to-nix
  • omnisharp-roslyn
  • openutau
  • pre-commit
  • pre-commit.dist
  • python311Packages.asteroid-filterbanks
  • python311Packages.asteroid-filterbanks.dist
  • python311Packages.clr-loader
  • python311Packages.clr-loader.dist
  • python311Packages.pythonnet
  • python311Packages.pythonnet.dist
  • python312Packages.asteroid-filterbanks
  • python312Packages.asteroid-filterbanks.dist
  • python312Packages.clr-loader
  • python312Packages.clr-loader.dist
  • python312Packages.pythonnet
  • python312Packages.pythonnet.dist
  • recyclarr
  • roslyn
  • roslyn-ls
  • sonarr
  • torrentstream
  • vimPluginsUpdater
  • wiseunpacker

@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Sep 6, 2024
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Sep 6, 2024
@corngood
Copy link
Contributor Author

corngood commented Sep 6, 2024

@khaneliman interesting. I'm not sure why it worked for me. Both 8 and 9 are broken on trunk due to swift (#327836).

In any case, I don't think there's a regression here.

Thanks for testing the GUI app. That looks correct.

@MattSturgeon
Copy link
Contributor

I'm not sure why it worked for me. Both 8 and 9 are broken on trunk

Just a hunch, but IIRC nixpkgs-review merges the PR against the local checked-out nixpkgs branch (or maybe it fetches an up-to-date base-branch, I don't recall).

So if you try building on this branch directly you may get a different result to if you try building with this branch merged onto a more up-to-date base-branch.

@corngood
Copy link
Contributor Author

corngood commented Sep 6, 2024

Just a hunch, but IIRC nixpkgs-review merges the PR against the local checked-out nixpkgs branch (or maybe it fetches an up-to-date base-branch, I don't recall).

For a PR, by default it fetches the target branch (master) and merges it. So we may not have been building the exact same thing. However, swift has been broken for quite a while on master, so I think there's some non-deterministic behaviour going on. It might be related to sandbox settings, OS versions, or just intermittent.

@khaneliman
Copy link
Contributor

khaneliman commented Sep 6, 2024

Thanks for testing the GUI app. That looks correct.

Np :)

However, swift has been broken for quite a while on master, so I think there's some non-deterministic behaviour going on. It might be related to sandbox settings, OS versions, or just intermittent.

This is how I've treated darwin reviews for a bit... some stuff can be pretty consistent, but it doesn't surprise me when things aren't behaving the same for everyone with darwin in nixpkgs. Swift being a perfect example, I haven't had any issues building it locally, but it's been an issue for a lot of people and hydra..

Copy link
Contributor

@GGG-KILLER GGG-KILLER left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty good, only a few minor changes that can be done later

@@ -4,6 +4,8 @@ tmp=$(mktemp -d)
trap 'chmod -R +w "$tmp" && rm -fr "$tmp"' EXIT

HOME=$tmp/.home
export TMPDIR="$tmp/.tmp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to restore this after the script is over so people don't have to restart their shells

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really meant to be sourced in a user shell. It's only meant to be called via nix-shell in the package-fetch-deps script.

I actually would have preferred to make it all work in one file with nix-shell shebangs, but I couldn't find a way to pass the derivation path, etc.

Comment on lines +57 to +59
mkNugetSource = callPackage ../../../build-support/dotnet/make-nuget-source { };
mkNugetDeps = callPackage ../../../build-support/dotnet/make-nuget-deps { };
fetchNupkg = callPackage ../../../build-support/dotnet/fetch-nupkg { };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can leave this for later, but it'd be nice to document these so people know what they are and what they do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think mkNugetSource/Deps serve a purpose now, and hopefully fetchNupkg can replace fetchNuGet.

@@ -60,7 +64,7 @@ configureNuget() {
done
fi

if [[ -f paket.dependencies ]]; then
if [[ -z ${keepNugetConfig-} && -f paket.dependencies ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs to be documented (I know it already existed, but I forgot to mention this when it was added)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't really fit in the buildDotnetModule docs, because you shouldn't have to worry about it there, but i do think there could be a whole section about the nuget package and dotnet-sdk hooks, and the variables they use: linkNugetPackages, etc.

@corngood
Copy link
Contributor Author

corngood commented Sep 7, 2024

Anyone have any thoughts on casing of Nuget vs NuGet? There's a bit of a mix already with e.g. mkNugetDeps, fetchNuGet, nugetDeps, etc.

From VMR :)

➜  dotnet git:(aecea31ead) g ls-files | grep NuGet | wc -l
4427
➜  dotnet git:(aecea31ead) g ls-files | grep Nuget | wc -l
226
➜  dotnet git:(aecea31ead) g ls-files | grep nuget | wc -l
5434
➜  dotnet git:(aecea31ead) g ls-files | grep nuGet | wc -l
0

A variable starting with nuGet looks especially stupid to me, but the official name seems to have a big G.

Maybe we try to stick with NuGet and nuget, but NOT Nuget or nuGet (i.e. treat it as one word, but capitalise the N and G together)?

I've added some Nuget things recently, and I'm having some regret. It looks like the only thing in this PR is createInstallableNugetSource, but that's unlikely to be used in packages, so I probably won't go back and fix it right now.

@GGG-KILLER
Copy link
Contributor

GGG-KILLER commented Sep 7, 2024

I think ideally we should try to follow the project's naming, so your idea of using either NuGet or nuget looks good to me (solely on me agreeing that nuGet looks weird).

Typing it is more annoying but I don't know if that warrants not leaving the G uppercase.

@corngood corngood merged commit 13a9751 into NixOS:master Sep 7, 2024
24 checks passed
@corngood corngood deleted the nuget-overrides branch September 7, 2024 12:00
@trofi
Copy link
Contributor

trofi commented Sep 13, 2024

Caused minor eval failures. Proposed the change as:

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

Successfully merging this pull request may close these issues.

7 participants