-
Notifications
You must be signed in to change notification settings - Fork 570
syscall.Stat_t: consider shimming os.Ctime #1047
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
Comments
Could you provide a broader context for this? What are the |
Yes, I saw the link GitHub helpfully added to the issue 🙂 Unfortunately, the commit by itself doesn't really answer any of my questions, for example what this From maintainability perspective, it's a lot better for us to invest time in making GopherJS more compatible with regular Go than to keep adding patches for the standard library. Every patch to the standard library we make means more work upgrading to the next release, which is already a time-consuming process. Hope that makes sense 🙂 |
@nevkontakte it builds with GOOS=js and GOARCH=wasm but if you try to build it with gopherjs you get time.Unix and os.Ctime not defined errors. The reason why I submit this issue is because this is a case where gopherjs requires an entirely separate build flagged file for removing this call, when it's supported in wasm. Don't we expect things that work in wasm to also build and run in gopherjs? Like syscall/js? The function is taking the creation time from a file handle. I'll see if I can make a small repro without the rest of go git. |
Oh, I think I see what's going on. I was thrown off by the variable But now I realized that
Unfortunately that probably means no easy fix. GopherJS uses the syscall extension, which calls directly to the host OS native syscalls, so under linux and macos we end up building slightly different versions of the syscall package. If we forcibly replace the definition of the struct, the syscall will simply break. I would actually like to switch GopherJS to the However, for go-git purposes you probably can reuse its linux implementation of this function for now, since that's the syscall version GopherJS currently uses. |
Adds a separate build file for wasm and gopherjs environments. Issues filed relating to no "gopherjs" tag being set - requiring the more awkward "js,!wasm" condition, as well as the os.Ctime incompatibility: - gopherjs/gopherjs#1047 - gopherjs/gopherjs#1046 Now the "gopherjs build -v" command works in this repository. Signed-off-by: Christian Stewart <[email protected]>
Adds a separate build file for wasm and gopherjs environments. Issues filed relating to no "gopherjs" tag being set - requiring the more awkward "js,!wasm" condition, as well as the os.Ctime incompatibility: - gopherjs/gopherjs#1047 - gopherjs/gopherjs#1046 Now the "gopherjs build -v" command works in this repository. Signed-off-by: Christian Stewart <[email protected]>
Such that the following code (from go-git) compiles properly without requiring a separate logic for GopherJS:
Does this make sense to do?
The text was updated successfully, but these errors were encountered: