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

dnspy: init at 6.5.1 #348390

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

dnspy: init at 6.5.1 #348390

wants to merge 7 commits into from

Conversation

js6pak
Copy link
Member

@js6pak js6pak commented Oct 14, 2024

https://github.com/dnSpyEx/dnSpy

dnSpy(Ex) is a decompiler frontend and debugger for .NET assemblies. One small issue is that it's windows-only which makes this package a little cursed, but hey, it works. :)

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.

@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Oct 14, 2024
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
pkgs/by-name/dn/dnspy/deps.nix Outdated Show resolved Hide resolved
pkgs/by-name/dn/dnspy/deps.nix Outdated Show resolved Hide resolved
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Oct 14, 2024
@github-actions github-actions bot added the 6.topic: dotnet Language: .NET label Oct 14, 2024
@ofborg ofborg bot added the 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild label Oct 30, 2024
@ofborg ofborg bot requested review from kuznero, corngood and mdarocha October 30, 2024 20:20
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 10, 2024
@corngood corngood mentioned this pull request Dec 4, 2024
13 tasks
@github-actions github-actions bot removed 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-darwin: 501+ 10.rebuild-linux: 501+ labels Dec 23, 2024
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-darwin: 501+ and removed 2.status: merge conflict This PR has merge conflicts with the target branch labels Dec 23, 2024
Comment on lines -98 to +97
lib.intersectLists args.meta.platforms dotnet-sdk.meta.platforms
args.meta.platforms
Copy link
Contributor

Choose a reason for hiding this comment

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

Changing this will make so that other .NET packages support platforms that they don't.

The correct thing would be changing the .NET SDK and/or runtime to include windows.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually the first issue with this code is that it should take the meta.platforms of the dotnet-runtime not dotnet-sdk right? (@corngood)

Also this is an artifact of when this PR was using self-contained, with which you can make a derivation for platforms that nixpkgs doesn't have a runtime package for (because it can download the runtime from nuget).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, the correct would be for it to get the runtime's platforms. In this case it doesn't really matter but I guess there could be cases where a runtime exists for a platform which the SDK doesn't in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure we should even be intersecting the platforms here, or providing a default. Are there examples of this in other languages?

It seems like we should just let the dependencies fail to eval.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if there are examples of this in other languages, however I don't see the point in allowing platforms where the packages will not be able to run on.
If we can provide this safeguard without too much trouble I don't see why not.

Copy link
Member Author

Choose a reason for hiding this comment

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

however I don't see the point in allowing platforms where the packages will not be able to run on

As I mentioned before, it's useful for self-contained builds. But that could be solved by checking if dotnet-runtime is null first.

If we can provide this safeguard without too much trouble I don't see why not

The problem with intersecting like this is that you are just silently dropping platforms the user provided. A better option could be using assert?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we can provide this safeguard without too much trouble I don't see why not

The problem with intersecting like this is that you are just silently dropping platforms the user provided. A better option could be using assert?

We could do that, but it'd break pretty much every .NET package in existence currently and a breaking change we'd need to document.

And it'd make the process of packaging more annoying because instead of lib.platforms.linux, one would instead need to type [ "x64_86-linux" "aarch64-linux" ], which isn't a lot of work so I wouldn't consider this a blocker, just a "I'd prefer not to have to".

pkgs/by-name/dn/dnspy/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/dn/dnspy/wrapper.nix Outdated Show resolved Hide resolved
Comment on lines 71 to 74
updateScript = writeShellScript "update-dnspy" ''
${lib.getExe nix-update} "dnspy.unwrapped"
"$(nix-build -A "$UPDATE_NIX_ATTR_PATH.unwrapped.fetch-deps" --no-out-link)"
'';
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't this be in a separate shell file with the nix-shell shebang instead of writeShellScript?
It'd enable analysis with shell check.

Copy link
Member 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 it's worth it for 2 lines. I think the real solution is making nix-update run fetch-deps? Other packages would benefit from it aswell

Copy link
Contributor

Choose a reason for hiding this comment

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

True, given that we now have nix-update it'd be good to make it automagically run fetch-deps.
I'll see if I can't get a PR running for it eventually.

Copy link
Contributor

Choose a reason for hiding this comment

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

take a look at tone.updateScript:

#!/usr/bin/env nix-shell
#!nix-shell --pure -i bash -p bash nix nix-update git cacert
set -eo pipefail

prev_version=$(nix eval --raw -f. tone.version)
nix-update tone
[[ $(nix eval --raw -f. tone.version) == "$prev_version" ]] ||
  "$(nix-build . -A tone.fetch-deps --no-out-link)"

I think it's important not to run fetch-deps unconditionally.

Copy link
Contributor

Choose a reason for hiding this comment

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

With recent changes to nix-update, fetch-deps is automagically called by it if it exists, so it doesn't need to be done here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did notice that, but it's not in a nix-update release yet.

pkgs/development/compilers/dotnet/combine-packages.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/dotnet/combine-packages.nix Outdated Show resolved Hide resolved
pkgs/by-name/dn/dnspy/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/dn/dnspy/wrapper.nix Show resolved Hide resolved
pkgs/development/compilers/dotnet/update.sh Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: dotnet Language: .NET 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 501+ 10.rebuild-darwin: 5001+ 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants