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

dotnet workload always installs maui workload as root. This is making it impossible to build a project as a regular user on Manjaro/Arch Linux #40692

Open
v1k7-992 opened this issue May 5, 2024 · 7 comments
Labels
Area-Workloads untriaged Request triage from a team member

Comments

@v1k7-992
Copy link

v1k7-992 commented May 5, 2024

Hi, recently I installed am trying to build a Maui app, and it seems all my projects when I either use VSCode, Rider or even dotnet build as a regular user, fail with this error:

/usr/share/dotnet/sdk/8.0.204/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: maui-android

Running dotnet workload list, gives me this output:

dotnet workload list

Installed Workload Id      Manifest Version      Installation Source
--------------------------------------------------------------------

Use `dotnet workload list` to find additional workloads to install.

But running the same command as sudo I can see that I have all the workloads installed:

Installed Workload Id      Manifest Version      Installation Source
--------------------------------------------------------------------
maui-tizen                 8.0.7/8.0.100         SDK 8.0.200        
wasi-experimental          8.0.4/8.0.100         SDK 8.0.200        
android                    34.0.95/8.0.100       SDK 8.0.200        
maui-android               8.0.7/8.0.100         SDK 8.0.200        
wasm-tools                 8.0.4/8.0.100         SDK 8.0.200       

What could be causing this? Could it be some odd permission problem I might have stumbled on?

More info:
I am using Manjaro Linux using dotnet version 8.0.204. The SDK, runtime and targeting tools are from the AUR.

@dotnet-policy-service dotnet-policy-service bot added the untriaged Request triage from a team member label May 5, 2024
@danmoseley danmoseley transferred this issue from dotnet/runtime May 5, 2024
@Forgind
Copy link
Member

Forgind commented May 9, 2024

Interesting...I tried this out with 8.0.100 on ubuntu, and it didn't seem to repro even when I switched to a new user after installing a workload. I'm curious what the differences are between ubuntu and monjaro or if we have a regression between 100 and 204

@v1k7-992
Copy link
Author

What I am using, in case of manjaro, is the AUR package for dotnet sdk. This package to be specific: https://aur.archlinux.org/packages/dotnet-sdk-bin. Could it be possible that the PKGBUILD is to blame?

@Forgind
Copy link
Member

Forgind commented May 10, 2024

I downloaded the 8.0.204 package for x64 from that link, extracted the contents, and copied them into my dotnet folder. I ran dotnet workload list (empty as expected), then install maui-android (failed: need admin rights), then sudo dotnet workload install maui-android (succeeded).

Then I ran dotnet workload list again (without sudo), and it showed maui-android as installed.

It's possible there's something special with the manjaro file system where it fakes a path at some point or prevents non-admin processes from accessing things in protected directories?

@v1k7-992
Copy link
Author

v1k7-992 commented May 12, 2024

@Forgind thank you for investigating into this.

I managed to find the reason why it is not working. It seems that manjaro (and arch linux does this as well), have given incorrect permissions to the folders /usr/share/dotnet/packs and /usr/share/dotnet/sdk-manifests. What is missing is the execution permission. Without that, dotnet build cannot use the Maui workload pkgs, and that is why I couldn't build. It gave an error saying that the packages were not downloaded and installed in my original comment, but it's valid, although confusing abit. Setting the folders using sudo chmod go+x sdk-manifests packs have solved the problem.

The solution for the future might lie in contacting the person maintaining the AUR package, that the PKGBUILD should create those two directories, and assign execution privileges for the folder. This is a little dangerous, so there probably exists a much better solution to this. Probably using groups, idk for now.

Should we close the issue here?

@Forgind
Copy link
Member

Forgind commented May 13, 2024

Thanks for your help with the investigation! I asked my PM where we should go from here, and he suggested transferring this issue to another dotnet repo that is a more central location for issues related to building dotnet from source, as in this case. They should be able to help us find the optimal solution here.

@Forgind
Copy link
Member

Forgind commented May 13, 2024

This issue was moved to dotnet/source-build#4397

@Forgind Forgind closed this as completed May 13, 2024
@MichaelSimons MichaelSimons reopened this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Workloads untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants