Skip to content

Fix wasm toolchain #2531

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

Merged
merged 3 commits into from
Feb 28, 2024
Merged

Fix wasm toolchain #2531

merged 3 commits into from
Feb 28, 2024

Conversation

timcassell
Copy link
Collaborator

I think this should fix dotnet/performance#3984, but I couldn't get wasm to work locally, so I couldn't test it. PTAL @LoopedBard3

@LoopedBard3
Copy link
Member

I think this is along the correct path for the fix, but this specific iteration ends up hitting this error when trying to generate the boiler plate code:

// Generate Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path '/home/pbibus/performance/artifacts/bin/MicroBenchmarks/Release/net9.0/Job-SXNDZX/bin/Release/net9.0/browser-wasm/AppBundle/test-main.js.config'.
    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
    at System.IO.File.Create(String path)
    at BenchmarkDotNet.Toolchains.GeneratorBase.GenerateAppConfig(BuildPartition buildPartition, ArtifactsPaths artifactsPaths)
    at BenchmarkDotNet.Toolchains.GeneratorBase.GenerateProject(BuildPartition buildPartition, ILogger logger, String rootArtifactsFolderPath)
// BenchmarkDotNet has failed to build the auto-generated boilerplate code

@timcassell
Copy link
Collaborator Author

@LoopedBard3 Hm, well I'm not sure about that issue. Can you take over from here? It's hard for me to do anything without being able to run it.

@timcassell timcassell closed this Feb 26, 2024
@LoopedBard3
Copy link
Member

I am still trying out some things. I will keep the main tracking issue updated with any findings and what not 👍.

@caaavik-msft
Copy link
Contributor

caaavik-msft commented Feb 27, 2024

I believe adding artifactsPaths.AppConfigPath.EnsureFolderExists(); to GeneratorBase.GenerateAppConfig() will fix this issue. The problem is that the AppBundle folder doesn't exist yet when it tries to generate the app config.

@caaavik-msft
Copy link
Contributor

I've made a PR to add an integration test which should help with local testing, you need to have the wasm-tools workload installed (dotnet workload install wasm-tools) and have installed the v8 engine though: #2532

@timcassell
Copy link
Collaborator Author

and have installed the v8 engine

Yeah, that's the part I got stuck on on my Windows machine. 😞

@timcassell
Copy link
Collaborator Author

I believe adding artifactsPaths.AppConfigPath.EnsureFolderExists(); to GeneratorBase.GenerateAppConfig() will fix this issue. The problem is that the AppBundle folder doesn't exist yet when it tries to generate the app config.

@LoopedBard3 Does that change make it work?

@LoopedBard3
Copy link
Member

I did get a successful local run with the branch for the PR caaavik put up: #2532

@timcassell timcassell reopened this Feb 27, 2024
@timcassell timcassell changed the title Wasm paths Fix wasm toolchain Feb 27, 2024
@timcassell timcassell marked this pull request as ready for review February 27, 2024 20:20
@timcassell timcassell added this to the v0.14.0 milestone Feb 27, 2024
Update wasmcsproj template.
@LoopedBard3
Copy link
Member

This ran successfully with a local wasm wasm test run. 👍

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timcassell thanks a lot! LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wasm runs failing with empty WasmAssembliesToBundle
4 participants