-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
base: master
Are you sure you want to change the base?
dnspy: init at 6.5.1 #348390
Conversation
lib.intersectLists args.meta.platforms dotnet-sdk.meta.platforms | ||
args.meta.platforms |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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/wrapper.nix
Outdated
updateScript = writeShellScript "update-dnspy" '' | ||
${lib.getExe nix-update} "dnspy.unwrapped" | ||
"$(nix-build -A "$UPDATE_NIX_ATTR_PATH.unwrapped.fetch-deps" --no-out-link)" | ||
''; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.