-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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: august 2024 upgrades #335969
dotnet: august 2024 upgrades #335969
Conversation
Result of 13 packages failed to build:
75 packages built:
|
4b6e6cf
to
2ac5f6a
Compare
Result of 3 packages failed to build:
132 packages built:
|
2ac5f6a
to
39db502
Compare
This fixes intermittent ArgumentOutOfRangeExceptions when building certain packages (e.g. roslyn-ls).
Result of 2 packages failed to build:
157 packages built:
|
This is an ongoing problem: #325857
This is also broken in master, but I'm not 100% sure why |
@@ -1,9 +1,9 @@ | |||
{ lib, fetchFromGitHub, buildDotnetModule, dotnetCorePackages, stdenvNoCC, testers, roslyn-ls, jq }: | |||
let | |||
pname = "roslyn-ls"; | |||
dotnet-sdk = dotnetCorePackages.sdk_9_0; | |||
dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_6_0 sdk_7_0 sdk_8_0 sdk_9_0 ]; |
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.
perhaps this is my lack of understanding, but why do we add those other SDKs back here?
In the last PR for this package I've removed them which did not change deps.nix at all.
Also there is #326335 which requires to stop using sdk_7_0.
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.
roslyn-ls uses the runtime packages from dotnet 6, 7, 8, and 9. Including 7 here removes the dependency on its packages. Unfortunately 6 and 8 are still present using older versions (6.0.32 and 8.0.7).
I think this is because sdk 9 preview 7 has hardcoded references to 6.0.32, 7.0.20, and 8.0.7, but I haven't had a chance to go digging for that yet.
I'm not sure what the best solution to this is.
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.
This might be an option:
diff --git a/pkgs/by-name/ro/roslyn-ls/package.nix b/pkgs/by-name/ro/roslyn-ls/package.nix
index 3207eea29d09..5f5096f28f4d 100644
--- a/pkgs/by-name/ro/roslyn-ls/package.nix
+++ b/pkgs/by-name/ro/roslyn-ls/package.nix
@@ -1,9 +1,9 @@
{ lib, fetchFromGitHub, buildDotnetModule, dotnetCorePackages, stdenvNoCC, testers, roslyn-ls, jq }:
let
pname = "roslyn-ls";
- dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_6_0 sdk_7_0 sdk_8_0 sdk_9_0 ];
+ dotnet-sdk = dotnetCorePackages.sdk_9_0;
# need sdk on runtime as well
- dotnet-runtime = dotnetCorePackages.sdk_9_0;
+ dotnet-runtime = dotnet-sdk;
project = "Microsoft.CodeAnalysis.LanguageServer";
in
@@ -45,6 +45,14 @@ buildDotnetModule rec {
# see this comment: https://github.com/NixOS/nixpkgs/pull/318497#issuecomment-2256096471
# we can remove below line after https://github.com/dotnet/roslyn/issues/73439 is fixed
"-p:UsingToolMicrosoftNetCompilers=false"
+ # force everything to net9.0
+ "-p:NetRoslyn=net9.0"
+ "-p:NetRoslynSourceBuild=net9.0"
+ "-p:NetRoslynAll=net9.0"
+ "-p:NetRoslynBuildHostNetCoreVersion=net9.0"
+ "-p:NetRoslynNext=net9.0"
+ "-p:NetVSCode=net9.0"
+ "-p:NetVSShared=net9.0"
];
# two problems solved here:
@konradmalik what would you think of that? it allows all the reference dependencies to be removed.
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.
Another option is to look into forcing KnownAppHost
to use the versions we actually have in nixpkgs.
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 fine with that if it works. Do you want to include it here, or should I create a PR? could try KnownAppHost there as well.
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.
We could also just leave it as @Smaug123 suggested. Not sure what it means for the deprecated dotnet 7 though.
Also an idea - we could try setting props such that this branch will be used
which, if I understand correctly, will force using only NetCurrent and NetPrevious which is set to net9.0 in arcade and net8.0 respectively.
All that being said - maybe I should do it in a separate PR aimed just at roslyn-ls.
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.
Also an idea - we could try setting props such that this branch will be used
I did try this, but DotNetBuildFromSource
seems to cause other problems. I think it might be meant for building as part of the VMR?
I think I'll leave it as is for now. If we ever improve KnownAppHost
in the build infrastructure, the dependencies will be reduced on the next fetch-deps, but only if we used the combined sdks.
Result of 2 packages marked as broken and skipped:
6 packages failed to build:
87 packages built:
|
All package tests on linux also passed, so this is ready for review. |
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.
Personally I'd stick with the "all the runtimes" in roslyn-ls if it has hard-coded requirements for it, rather than adding our own msbuild property overrides. But 1) I don't use roslyn-ls, 2) my opinion is weakly held, and 3) I value consistency with upstream quite highly to reduce work.
@@ -34,6 +34,7 @@ in writeShellScriptBin "patch-nupkgs" ('' | |||
if [ "$magic" = $'\177ELF' ]; then return 0; else return 1; fi | |||
} | |||
cd "$1" | |||
'' + lib.optionalString stdenv.isLinux '' |
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.
This change looks obviously correct; do you know why this wasn't there before?
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.
For VMR, packages weren't being patched on darwin before, but 9.0 now needs the ilcompiler fix below.
I suppose this could actually use stdenv.hostPlatform.isElf
.
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 think I'll leave this as-is for now. isElf
is something to consider for the future, but everything else is using isLinux
and isDarwin
. I think realistically this can happen if/when we make dotnet work on BSD.
Description of changes
FYI @NixOS/dotnet
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.