Skip to content

Commit

Permalink
feat: Enable WSL emsdk folder compression
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Mar 24, 2020
1 parent 9fbbb8c commit b270071
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Uno.Wasm.Bootstrap/ShellTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -699,13 +699,25 @@ private string TryConvertLongPath (string path)

private string ValidateEmscripten()
{

if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
var emsdkBaseFolder = BaseIntermediateOutputPath + $"\\emsdk-{Constants.EmscriptenMinVersion}";

if(!File.Exists(Environment.GetEnvironmentVariable("WINDIR") + "\\sysnative\\bash.exe"))
{
throw new InvalidCastException("The is not installed, please install Ubuntu 18.04 by visiting https://docs.microsoft.com/en-us/windows/wsl/install-win10.");
}

// Enable compression for the emsdk folder
var emsdkBaseFolderRaw = emsdkBaseFolder.Replace(@"\\?\", "");
if (!Directory.Exists(emsdkBaseFolderRaw))
{
Log.LogMessage($"Creating {emsdkBaseFolder}");
Directory.CreateDirectory(emsdkBaseFolderRaw);
Process.Start("compact", $"/c \"/s:{emsdkBaseFolder}\"");
}

var emscriptenSetupScript = Path.Combine(BuildTaskBasePath, "scripts", "emscripten-setup.sh");

// Adjust line endings
Expand All @@ -717,7 +729,7 @@ private string ValidateEmscripten()

if (result.exitCode == 0)
{
return BaseIntermediateOutputPath + $"\\emsdk-{Constants.EmscriptenMinVersion}\\emsdk";
return emsdkBaseFolder + $"\\emsdk";
}

var dotnetSetupScript = Path.Combine(BuildTaskBasePath, "scripts", "dotnet-setup.sh");
Expand Down

0 comments on commit b270071

Please sign in to comment.