Skip to content

roslyn-ls: 4.10.0-2.24124.2 -> 4.12.0-1.24359.11 #318497

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

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

konradmalik
Copy link
Contributor

@konradmalik konradmalik commented Jun 9, 2024

Description of changes

Updating the package.
Added dotnet sdk 9 and removed all other sdks - whether they're present or not, the app compiles and works the same, and the generated deps.nix are also the same.

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.

@konradmalik
Copy link
Contributor Author

cannot fetch-deps, possible cause? #315574

@konradmalik konradmalik changed the title roslyn-ls: 4.10.0-2.24124.2 -> 4.11.0-2.24267.3 roslyn-ls: 4.10.0-2.24124.2 -> 4.11.0-2.24259.4 Jun 9, 2024
@konradmalik konradmalik changed the title roslyn-ls: 4.10.0-2.24124.2 -> 4.11.0-2.24259.4 roslyn-ls: 4.10.0-2.24124.2 -> 4.11.0-2.24267.3 Jun 9, 2024
@konradmalik konradmalik added the 2.status: work-in-progress This PR isn't done label Jun 9, 2024
@konradmalik konradmalik marked this pull request as ready for review June 11, 2024 12:04
@konradmalik konradmalik removed the 2.status: work-in-progress This PR isn't done label Jun 11, 2024
@konradmalik
Copy link
Contributor Author

konradmalik commented Jun 11, 2024

eh, current status: linux - works, darwin - build error, reproducible locally with plain dotnet build

Looks like upstream issue: dotnet/roslyn#73439

A part of our log:

  Microsoft.CodeAnalysis.CSharp net8.0 failed with 14333 error(s) (17.5s)
    /private/tmp/nix-build-roslyn-ls-4.11.0-3.24307.2.drv-0/tmp.DDpdZBNUmZ/.nuget/packages/microsoft.net.compilers.toolset/4.11.0-2.24270.4/tasks/netcore/Microsoft.CSharp.Core.targets(85,5): error : Process terminated. System.InsufficientExecutionStackException: Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space.
    /private/tmp/nix-build-roslyn-ls-4.11.0-3.24307.2.drv-0/tmp.DDpdZBNUmZ/.nuget/packages/microsoft.net.compilers.toolset/4.11.0-2.24270.4/tasks/netcore/Microsoft.CSharp.Core.targets(85,5): error :    at System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack()
    /private/tmp/nix-build-roslyn-ls-4.11.0-3.24307.2.drv-0/tmp.DDpdZBNUmZ/.nuget/packages/microsoft.net.compilers.toolset/4.11.0-2.24270.4/tasks/netcore/Microsoft.CSharp.Core.targets(85,5): error :    at Microsoft.CodeAnalysis.StackGuard.EnsureSufficientExecutionStack(Int32 recursionDepth)
    /private/tmp/nix-build-roslyn-ls-4.11.0-3.24307.2.drv-0/tmp.DDpdZBNUmZ/.nuget/packages/microsoft.net.compilers.toolset/4.11.0-2.24270.4/tasks/netcore/Microsoft.CSharp.Core.targets(85,5): error :    at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.Visit(SyntaxNode node)

@konradmalik konradmalik marked this pull request as draft June 11, 2024 15:35
@konradmalik konradmalik changed the title roslyn-ls: 4.10.0-2.24124.2 -> 4.11.0-2.24267.3 roslyn-ls: 4.10.0-2.24124.2 -> 4.11.0-3.24307.2 Jun 13, 2024
@konradmalik konradmalik added the 2.status: wait-for-upstream Waiting for upstream fix (or their other action). label Jun 13, 2024
@konradmalik konradmalik changed the title roslyn-ls: 4.10.0-2.24124.2 -> 4.11.0-3.24307.2 roslyn-ls: 4.10.0-2.24124.2 -> 4.12.0-1.24359.11 Jul 25, 2024
@konradmalik
Copy link
Contributor Author

konradmalik commented Jul 28, 2024

Because the fix for darwin build in the upstream repo is nowhere in sight, could we try a different approach here?

I have a working example in my personal repo where I install roslyn-ls from the Nuget packages published to this feed - those are official Microsoft builds.

This is the same approach that VSCode's C# Dev Kit extension uses to install this server based on: dotnet/roslyn#71474 (comment)

@SuperSandro2000 could we have something like that in nixpkgs? It would simplify this package quite a bit, but the downside is that we would rely on binary blobs published to nuget. On the other hand, we already rely on them when downloading nuget dependencies for any dotnet project.

FYI: my proposition here: #330683

@SuperSandro2000
Copy link
Member

Sounds fine to me

@corngood
Copy link
Contributor

I seem to be able to work around the stack overflow error by doing this:

diff --git a/pkgs/by-name/ro/roslyn-ls/deps.nix b/pkgs/by-name/ro/roslyn-ls/deps.nix
index 2bbb08488396..7eb95212be3a 100644
--- a/pkgs/by-name/ro/roslyn-ls/deps.nix
+++ b/pkgs/by-name/ro/roslyn-ls/deps.nix
@@ -63,7 +63,6 @@
   (fetchNuGet { pname = "Microsoft.Extensions.Options.ConfigurationExtensions"; version = "8.0.0"; hash = "sha256-A5Bbzw1kiNkgirk5x8kyxwg9lLTcSngojeD+ocpG1RI="; url = "https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/45bacae2-5efb-47c8-91e5-8ec20c22b4f8/nuget/v3/flat2/microsoft.extensions.options.configurationextensions/8.0.0/microsoft.extensions.options.configurationextensions.8.0.0.nupkg"; })
   (fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "8.0.0"; hash = "sha256-FU8qj3DR8bDdc1c+WeGZx/PCZeqqndweZM9epcpXjSo="; url = "https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/45bacae2-5efb-47c8-91e5-8ec20c22b4f8/nuget/v3/flat2/microsoft.extensions.primitives/8.0.0/microsoft.extensions.primitives.8.0.0.nupkg"; })
   (fetchNuGet { pname = "Microsoft.IO.Redist"; version = "6.0.0"; hash = "sha256-pa3MT+QWrWeehQwUWtTS/Rwto8IIDgAt+zLqaUAQoJ0="; url = "https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/45bacae2-5efb-47c8-91e5-8ec20c22b4f8/nuget/v3/flat2/microsoft.io.redist/6.0.0/microsoft.io.redist.6.0.0.nupkg"; })
-  (fetchNuGet { pname = "Microsoft.Net.Compilers.Toolset"; version = "4.11.0-2.24270.4"; hash = "sha256-R4+eMGnUz3Jt4kc0WZdaixaqxO2osKa9RJeMMAMaFAw="; url = "https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/d1622942-d16f-48e5-bc83-96f4539e7601/nuget/v3/flat2/microsoft.net.compilers.toolset/4.11.0-2.24270.4/microsoft.net.compilers.toolset.4.11.0-2.24270.4.nupkg"; })
   (fetchNuGet { pname = "Microsoft.NET.StringTools"; version = "17.10.4"; hash = "sha256-nXY7YaIx6sXn7aMqpF4bW4d2J5U1KNb9sXqRSd8MpOc="; url = "https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/45bacae2-5efb-47c8-91e5-8ec20c22b4f8/nuget/v3/flat2/microsoft.net.stringtools/17.10.4/microsoft.net.stringtools.17.10.4.nupkg"; })
   (fetchNuGet { pname = "Microsoft.NET.StringTools"; version = "17.3.4"; hash = "sha256-xLPrrL8iS3gNMIa/C/Wv0fBfHIehUHeQ4Y+F+gbqkhk="; url = "https://pkgs.dev.azure.com/azure-public/3ccf6661-f8ce-4e8a-bb2e-eff943ddd3c7/_packaging/491596af-6d2d-439e-80bb-1ebb3b54f9a8/nuget/v3/flat2/microsoft.net.stringtools/17.3.4/microsoft.net.stringtools.17.3.4.nupkg"; })
   (fetchNuGet { pname = "Microsoft.NET.StringTools"; version = "17.4.0"; hash = "sha256-+9uBaUDZ3roUJwyYJUL30Mz+3C6LE16FzfQKgS0Yveo="; url = "https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/45bacae2-5efb-47c8-91e5-8ec20c22b4f8/nuget/v3/flat2/microsoft.net.stringtools/17.4.0/microsoft.net.stringtools.17.4.0.nupkg"; })
diff --git a/pkgs/by-name/ro/roslyn-ls/package.nix b/pkgs/by-name/ro/roslyn-ls/package.nix
index 56a86295efdb..42274eb9206f 100644
--- a/pkgs/by-name/ro/roslyn-ls/package.nix
+++ b/pkgs/by-name/ro/roslyn-ls/package.nix
@@ -43,6 +43,7 @@ buildDotnetModule rec {
   dotnetFlags = [
     # this removes the Microsoft.WindowsDesktop.App.Ref dependency
     "-p:EnableWindowsTargeting=false"
+    "-p:UsingToolMicrosoftNetCompilers=false"
   ];
 
   # two problems solved here:

However, I haven't tested the resulting binary (other than roslyn-ls.tests).

I was able to track down the stack overflow to a specific csc invocation, and wasn't able to reproduce it using the compiler from the 9.0 preview 6 sdk. I believe the change above will cause it to use the SDK compiler.

@corngood
Copy link
Contributor

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

1 package built:
  • roslyn-ls

@corngood
Copy link
Contributor

I also built this on darwin, but I had to disable the sandbox due to NixOS/nix#4119.

@konradmalik
Copy link
Contributor Author

Thank you @corngood for the help and fix! I'm building and testing on darwin right now.
I also think we can remove sdk_6_0 from here. I'll follow up.

@konradmalik konradmalik requested a review from corngood July 29, 2024 15:46
@konradmalik konradmalik removed the 2.status: wait-for-upstream Waiting for upstream fix (or their other action). label Jul 29, 2024
@konradmalik konradmalik marked this pull request as ready for review July 29, 2024 16:03
@konradmalik
Copy link
Contributor Author

ok, I removed all sdks except for 9_0 - it does not influence deps.nix anymore and the app still builds and works fine.

@konradmalik
Copy link
Contributor Author

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

1 package built:
  • roslyn-ls

@corngood
Copy link
Contributor

Thanks! Looks good to me. Are you happy if I merge it now?

@corngood
Copy link
Contributor

Have you tested with a project that isn't using SDK 9? I assume so, but I just want to double check that the SDK change doesn't reduce compatibility.

@konradmalik
Copy link
Contributor Author

Result of nixpkgs-review pr 318497 run on x86_64-darwin 1

1 package built:
  • roslyn-ls

@konradmalik
Copy link
Contributor Author

konradmalik commented Jul 29, 2024

@corngood now I am ok to merge, as darwin has just built 😄
I've tested it with a project that uses dotnet 8 and works fine.

@corngood corngood merged commit a8e896a into NixOS:master Jul 29, 2024
17 of 18 checks passed
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux and removed 10.rebuild-darwin: 1 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 labels Jul 29, 2024
@konradmalik konradmalik mentioned this pull request Jul 30, 2024
17 tasks
@konradmalik konradmalik added the 6.topic: dotnet Language: .NET label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: dotnet Language: .NET 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 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.

3 participants