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

fix: [Wasm] Add net8 p/invoke workaround #1651

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
-->
<WasmShellILLinkerEnabled>false</WasmShellILLinkerEnabled>
</PropertyGroup>
<ItemGroup>
<WasmShellAdditionalPInvokeLibrary Include="libc" />
<WasmShellAdditionalPInvokeLibrary Include="libc.so" />
</ItemGroup>
<ItemGroup>
<WasmShellMonoEnvironment Include="MSDL_PROXY_LOCATION" Value="$(MsdlApiBaseLocation)" />

Expand Down
9 changes: 7 additions & 2 deletions Uno/NuGetPackageExplorer.Wasm/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.IO;
using System.Linq;

using System.Runtime.InteropServices;
using Uno.UI;

using Microsoft.UI.Xaml;

namespace PackageExplorer
Expand All @@ -18,5 +17,11 @@ static int Main(string[] args)

return 0;
}

// In net8, calls to chmod for a separate library are causing issues
// https://github.com/NuGet/NuGet.Client/blob/824a3c7d8823c3be1cf48e08e5f1993d2e8eb4ab/src/NuGet.Core/NuGet.Configuration/Utility/FileSystemUtility.cs#L53
// Declaring the import in the main assembly help getting the p/invoke call resolved.
[DllImport("libc.so", SetLastError = true)]
private static extern int chmod(string pathname, int mode);
}
}
Loading