Skip to content

Commit

Permalink
fix: Ensure emscripten can run with linker disabled (interpreter only)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Oct 11, 2022
1 parent 8342e7e commit 8cbc518
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
7 changes: 7 additions & 0 deletions .vsts-ci-windows-tests.yml
Expand Up @@ -66,6 +66,13 @@ jobs:
env:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
# Static linking test (net5) without the linker
- pwsh: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Interpreter
dotnet clean -c Release /p:DISABLE_CLIHOST_NET6=true
dotnet publish -c Release /m:1 /p:DISABLE_CLIHOST_NET6=true /p:WasmShellEmccLinkOptimization=false /p:WasmShellILLinkerEnabled=false /bl:$(build.artifactstagingdirectory)/SampleNet5-nolinker-win.binlog
displayName: Build StaticLinking.Aot Sample (net5)
# Static linking test (net5)
- pwsh: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Aot.Net5
Expand Down
27 changes: 16 additions & 11 deletions src/Uno.Wasm.Bootstrap/ShellTask.cs
Expand Up @@ -979,21 +979,26 @@ private void CleanupLinkerRemovedFiles(string workAotPath)
{
// Debugger.Launch();

//
// Additional assemblies are created as part of the packager processing
// remove those files so they're not part of the final payload.
//
var temporaryFilesToDelete = Directory
.GetFiles(Path.Combine(workAotPath, "linker-out"), "*.aot-only")
.SelectMany(f => new[] {
var linkerOut = Path.Combine(workAotPath, "linker-out");

if (MonoILLinker)
{
//
// Additional assemblies are created as part of the packager processing
// remove those files so they're not part of the final payload.
//
var temporaryFilesToDelete = Directory
.GetFiles(linkerOut, "*.aot-only")
.SelectMany(f => new[] {
Path.ChangeExtension(Path.GetFileName(f), ".dll"),
Path.ChangeExtension(Path.GetFileName(f), ".pdb")
})
.ToList();
})
.ToList();

RemoveMonoConfigJsonFiles(temporaryFilesToDelete);
RemoveMonoConfigJsonFiles(temporaryFilesToDelete);

temporaryFilesToDelete.ForEach(f => File.Delete(Path.Combine(_workDistPath, "managed", f)));
temporaryFilesToDelete.ForEach(f => File.Delete(Path.Combine(_workDistPath, "managed", f)));
}
}

private void RemoveMonoConfigJsonFiles(IEnumerable<string> deletedFiles)
Expand Down

0 comments on commit 8cbc518

Please sign in to comment.