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

panic: mkdir /tmp/jsii-runtime: not implemented on js wasm_exec.js #3281

Closed
1 of 5 tasks
Hunter-Thompson opened this issue Dec 21, 2021 · 6 comments
Closed
1 of 5 tasks
Labels
bug This issue is a bug. language/go Regarding GoLang bindings module/runtime Issues affecting the `jsii-runtime` needs-reproduction This issue needs reproduction. p1

Comments

@Hunter-Thompson
Copy link
Contributor

Hunter-Thompson commented Dec 21, 2021

🐛 Bug Report

Affected Languages

  • TypeScript or Javascript
  • Python
  • Java
  • .NET (C#, F#, ...)
  • Go

General Information

  • JSII Version: 1.46.0
  • Platform: Firefox on Ubuntu Linux : )

What is the problem?

While running cdk8s synth from the browser using web assembly for Golang, I get the following JSII Runtime errors.

Verbose Log

panic: mkdir /tmp/jsii-runtime.843980924: not implemented on js wasm_exec.js:51:14
<empty string> wasm_exec.js:51:14
goroutine 1 [running]: wasm_exec.js:51:14
github.com/aws/jsii-runtime-go/internal/kernel.GetClient.func1() wasm_exec.js:51:14
	/build/vendor/github.com/aws/jsii-runtime-go/internal/kernel/client.go:44 +0xd wasm_exec.js:51:14
sync.(*Once).doSlow(0x2372058, 0x690828) wasm_exec.js:51:14
	/usr/local/go/src/sync/once.go:68 +0x9 wasm_exec.js:51:14
sync.(*Once).Do(0x2372058, 0x690828) wasm_exec.js:51:14
	/usr/local/go/src/sync/once.go:59 +0x6 wasm_exec.js:51:14
github.com/aws/jsii-runtime-go/internal/kernel.GetClient() wasm_exec.js:51:14
	/build/vendor/github.com/aws/jsii-runtime-go/internal/kernel/client.go:37 +0x2 wasm_exec.js:51:14
github.com/aws/jsii-runtime-go/runtime.RegisterClass({0x458a63, 0x14}, {0x8d1d30, 0x26fdc0}, {0x24a3750, 0x4, 0x4}, 0x6907e0) wasm_exec.js:51:14
	/build/vendor/github.com/aws/jsii-runtime-go/runtime/runtime.go:50 +0x2 wasm_exec.js:51:14
github.com/aws/constructs-go/constructs/v3.init.0() wasm_exec.js:51:14
	/build/vendor/github.com/aws/constructs-go/constructs/v3/constructs.init.go:10 +0x12

Notes

  1. The stack traces to a function called TempDir() which calls os.MkdirTemp()
  2. Related issue: Support creating temporary files and directories WebAssembly/WASI#306

Reproduction Repo

https://github.com/Hunter-Thompson/jsii-webasembly-bug

@Hunter-Thompson Hunter-Thompson added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 21, 2021
@Hunter-Thompson
Copy link
Contributor Author

I can write a small example project that can be viewed publicly so that this issue can be reproduced if required.

@NGL321 NGL321 added language/go Regarding GoLang bindings module/runtime Issues affecting the `jsii-runtime` needs-reproduction This issue needs reproduction. p1 and removed needs-triage This issue or PR still needs to be triaged. labels Dec 23, 2021
@NGL321
Copy link
Contributor

NGL321 commented Dec 23, 2021

Thank you for reporting this @Hunter-Thompson!

A gist or repo with reproduction code and steps would almost certainly be helpful!

@Hunter-Thompson
Copy link
Contributor Author

@NGL321 I created a repo with all the code, and very minimal reproduction steps.

https://github.com/Hunter-Thompson/jsii-webasembly-bug

@RomainMuller
Copy link
Contributor

Yeah, the jsii runtime needs to be able to access the file system in order to operate properly. It creates a temporary directory in which it will unpack NPM modules to load them up in a Node/JS VM.

If your environment does not support the fs module of the node standard library, then it is not supported at the moment, unfortunately.

@Hunter-Thompson
Copy link
Contributor Author

Yeah, the jsii runtime needs to be able to access the file system in order to operate properly. It creates a temporary directory in which it will unpack NPM modules to load them up in a Node/JS VM.

This seems to be quite an important step. Maintainers can close this issue if they don't think there is an alternative to this in the near future.

@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. language/go Regarding GoLang bindings module/runtime Issues affecting the `jsii-runtime` needs-reproduction This issue needs reproduction. p1
Projects
None yet
Development

No branches or pull requests

3 participants