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

Error reading files using tinygo #3

Open
adamreese opened this issue Mar 19, 2023 · 8 comments
Open

Error reading files using tinygo #3

adamreese opened this issue Mar 19, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@adamreese
Copy link
Contributor

When trying to read a file in tinygo it returns the error open /test.txt: errno 76

Here is my test application https://github.com/adamreese/spin-fs-issue

@itowlson
Copy link
Contributor

That seems to be a capabilities error:

https://github.com/bytecodealliance/wasi/blob/9ec04a7d8ebb1bbb9e3291503425cee1ec38a560/src/lib_generated.rs#L223

@dicej am I reading that right? Does it mean the Go os.ReadFile is trying to do more with the file than WASI allows?

@dicej
Copy link
Collaborator

dicej commented Mar 21, 2023

@dicej am I reading that right? Does it mean the Go os.ReadFile is trying to do more with the file than WASI allows?

Possibly. What's interesting is that, although the "rights" system has been removed entirely from WASI Preview 2, this same issue happens there, also. Also, ERRNO_NOTCAPABLE doesn't appear in either the Preview 1 or Preview 2 source code, nor in the cap-std or system-interface crates on which they are based, so maybe it's coming straight from the OS? This will require some debugging, apparently.

@itowlson
Copy link
Contributor

It might be informative to know if this happens (and if it has the same error number) on Windows or Linux; needless to say, Adam ran into it the very week I am away from my Windows/WSL machine...

@adamreese
Copy link
Contributor Author

I tested on linux amd64 and got the same error

@kate-goldenring
Copy link

this is still an issue. Was able to repro on arm macOS

@kate-goldenring kate-goldenring added the bug Something isn't working label Aug 24, 2023
@lann lann transferred this issue from spinframework/spin Jun 19, 2024
@lann
Copy link
Contributor

lann commented Jun 19, 2024

Still an issue today, as reported by @asteurer

@lann
Copy link
Contributor

lann commented Jun 19, 2024

Possibly related, though this specific issue is allegedly fixed: tinygo-org/tinygo#2382

@lann
Copy link
Contributor

lann commented Jun 19, 2024

Also possibly related: bytecodealliance/wizer#24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants