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

Issue: nuget gsudo is copying the executable and runtime folders to osx and others #398

Open
sn4k3 opened this issue Mar 10, 2025 · 2 comments

Comments

@sn4k3
Copy link

sn4k3 commented Mar 10, 2025

Issue Description

"C:\Program Files\dotnet\dotnet.exe" publish project --configuration Release --self-contained true --property:PublishReadyToRun=true --runtime osx-x64 --output artifacts\publish\osx-x64_v0.0.1

Image

Steps to Reproduce

Publish ready to run to osx or linux with gsudo nuget in solution
dotnet add package gsudo --version 2.6.0

Build system

Windows 11 with dotnet 9

Expected

gsudo only included in universal publish and under windows.

@gerardog
Copy link
Owner

I dont have a clear picture of what would the best behaviour of the Nuget package be before making a change here. I need to research a little bit, and I accept feedback.

On the other hand you can temporarily handle this issue on your side by adding a conditional reference to gsudo nuget package:

  <ItemGroup Condition="$(RuntimeIdentifier.StartsWith('win'))">
    <PackageReference Include="gsudo" Version="2.6.0" />
  </ItemGroup>

@sn4k3
Copy link
Author

sn4k3 commented Mar 12, 2025

I had a look into your nuget package, but I also have no clue...
In my mind, when you publish a project, everything inside runtime/RID get copied over to root and runtime folder is excluded from copy, but is not the case with gsudo somehow.

I have another C# project (used from dotnet5, 6 and now 9) that always worked fine with other nuget package that library have runtimes for windows, linux and macos, I reference them all in my solution and on publish time the correct runtime is copied to the root and I never get a runtime folder nor wrong dependency for the given rid.

Thanks for providing a solution, that will help with the workflow.
I need to include empty runtime, due universal build and while developing builds.

<PackageReference Include="gsudo" Version="2.6.0" Condition="$(RuntimeIdentifier.StartsWith('win')) Or $(RuntimeIdentifier.Equals(''))" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants