Skip to content

[mono][aot] macOS: Permission issues with workloads #53545

@radical

Description

@radical

Based off #53314 .

Steps to reproduce:

  1. install dotnet preview 4 (https://dotnet.microsoft.com/download/dotnet/6.0), into a system location
  2. install the workload packs with: dotnet workload install microsoft-net-sdk-blazorwebassembly-aot. You would need to run that as root
  3. create a new blazor project with dotnet new blazorwasm
  4. Add <RunAOTCompilation>true</RunAOTCompilation>, and <PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="6.0.0-preview.4.21253.5" /> to the project
  5. build with dotnet publish -c:release -p:RunAOTCompilation=true -bl

Fails with:

                     System.ComponentModel.Win32Exception (13): Permission denied
                        at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UIn
                        at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) in System.Diagnostics.Process.dll:token 0x6000105+0x1aa
                        at System.Diagnostics.Process.Start() in System.Diagnostics.Process.dll:token 0x60000de+0xab
                        at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) in System.Diagnostics.Process.dll:token 0x60000e2+0x1b
                        at Utils.RunProcess(String path, String args, IDictionary`2 envVars, String workingDir, Boolean ignoreErrors, Boolean silent, MessageImportance outputMessageImportance, MessageImportance debugMessageImporta
                        at MonoAOTCompiler.PrecompileLibrary(ITaskItem assemblyItem, String monoPaths) in MonoAOTCompiler.dll:token 0x600002b+0x436 (TaskId:149)

-rwxr--r-- 1 root wheel 12062648 May 3 14:42 /usr/local/share/dotnet/packs/microsoft.netcore.app.runtime.aot.osx-x64.cross.browser-wasm/6.0.0-preview.4.21253.7/Sdk/../tools/mono-aot-cross*

Problem 1. mono-aot-cross has execute permission only for the owner(root).

fixing the permission for that, and building again fails with:

/var/folders/7c/zpmy8k_d4d1grky_s154kk640000gp/T/tmp6376bf6641524777815553f841d39a51.exec.cmd: line 2: /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.Emscripten.2.0.12.Sdk.osx-x64/6.0.0-preview.4.21220.1/tools/emscripten/emcc: Permission denied

-rwxr--r-- 1 root wheel 716 Sep 23 2020 /usr/local/share/dotnet/packs/Microsoft.NET.Runtime.Emscripten.2.0.12.Sdk.osx-x64/6.0.0-preview.4.21220.1/tools/emscripten/emcc*

Problem 2: emcc (and possibly other emscripten files) don't have the right permissions

cc @lewing @akoeplinger @steveisok

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions