-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
dotnet: fix problems with --runtime flags #432571
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
Conversation
|
@@ -26,7 +26,15 @@ buildDotnetModule rec { | |||
|
|||
nugetDeps = ./deps.json; | |||
|
|||
projectFile = "ArchiSteamFarm.sln"; | |||
projectFile = [ |
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.
An alternative to this would be to add a flag that allows the solution detection to be overridden so that we can disable --runtime for all phases.
I could also rewrite this to avoid repeating the names of the plugins if that's preferable.
@@ -26,7 +26,15 @@ buildDotnetModule rec { | |||
|
|||
nugetDeps = ./deps.json; | |||
|
|||
projectFile = "ArchiSteamFarm.sln"; | |||
projectFile = [ |
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.
projectFile = [ | |
projectFiles = [ |
lists usually have a s suffix
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.
Unfortunately buildDotnetModule
doesn't currently allow that. It probably should just be renamed to projectFiles
and testProjectFiles
.
I would solve the duplication like: diff --git a/pkgs/applications/misc/ArchiSteamFarm/default.nix b/pkgs/applications/misc/ArchiSteamFarm/default.nix
index 385747878758..432c5530b7fb 100644
--- a/pkgs/applications/misc/ArchiSteamFarm/default.nix
+++ b/pkgs/applications/misc/ArchiSteamFarm/default.nix
@@ -9,6 +9,14 @@
callPackage,
}:
+let
+ plugins = [
+ "ArchiSteamFarm.OfficialPlugins.ItemsMatcher"
+ "ArchiSteamFarm.OfficialPlugins.MobileAuthenticator"
+ "ArchiSteamFarm.OfficialPlugins.Monitoring"
+ "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper"
+ ];
+in
buildDotnetModule rec {
pname = "ArchiSteamFarm";
# nixpkgs-update: no auto update
@@ -26,13 +34,9 @@
nugetDeps = ./deps.json;
- projectFile = [
+ projectFiles = [
"ArchiSteamFarm"
- "ArchiSteamFarm.OfficialPlugins.ItemsMatcher"
- "ArchiSteamFarm.OfficialPlugins.MobileAuthenticator"
- "ArchiSteamFarm.OfficialPlugins.Monitoring"
- "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper"
- ];
+ ] ++ plugins;
testProjectFile = "ArchiSteamFarm.Tests";
executable = "ArchiSteamFarm";
@@ -76,10 +80,7 @@
dotnetInstallPhase
}
- buildPlugin ArchiSteamFarm.OfficialPlugins.ItemsMatcher
- buildPlugin ArchiSteamFarm.OfficialPlugins.MobileAuthenticator
- buildPlugin ArchiSteamFarm.OfficialPlugins.Monitoring
- buildPlugin ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
+ '' + lib.concatStringsSep (p: "buildPlugin ${p}\n") plugins + ''
chmod +x $out/lib/ArchiSteamFarm/ArchiSteamFarm.dll
wrapDotnetProgram $out/lib/ArchiSteamFarm/ArchiSteamFarm.dll $out/bin/ArchiSteamFarm
|
e43fd57
to
54425bb
Compare
Yeah, that looks good. Done. |
54425bb
to
4910a4d
Compare
@@ -1,5 +1,9 @@ | |||
# shellcheck shell=bash | |||
|
|||
_dotnetIsSolution() { | |||
dotnet sln ${1:+"$1"} list 2>/dev/null |
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.
@js6pak reminded me of .slnx, so I switched this to use dotnet sln list
to avoid duplicating that internal logic. There's also .slnf and various differences between versions.
|
Any more comments on this? I'd like to get it in before #433244 because they've fixed the pack flags upstream, which breaks our tests in their current state. |
Cc: @NixOS/dotnet
Fixes: #283430
This is a subtly breaking change as shown in ArchiSteamFarm.
Projects that use a directory in
projectFile
will now be correctly identify if they are building a solution and omit the runtime flags. If the project changesdotnetProjectFile
between phases (like ArchiSteamFarm) this can cause a mismatch in the build paths.Things done
passthru.tests
.nixpkgs-review
on this PR. See nixpkgs-review usage../result/bin/
.Add a 👍 reaction to pull requests you find important.