-
Notifications
You must be signed in to change notification settings - Fork 80
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
Use base CClockId as ClockId type #209
Conversation
Is there some way this can be properly tested with WebAssembly? I'd prefer not to take a sequence of fixes. |
Sorry, this PR was meant to be the last one related to wasm!
If you don't mind, I can add a CI job to test it; just FYI the fork including this change is already used/tested in the wasm32-wasi ghc head bindist. |
Yes, if you can please add a CI job to run the test suites with wasm. |
c0c8bda
to
514d0c9
Compare
Hi @AshleyYakeley, I've added a CI pipeline that builds and runs a simple test case. Due to |
Is there a parallel github issue for the What do you need right now? I can merge this PR, though ideally I'd like to see test-main & test-unix pass. However, I'm not planning on doing another release as I just did one a few days ago. |
Not yet; the
It would be helpful to merge it as it currently is :) Not doing another release immediately is totally fine, the wasm work is targeting 9.6 anyway so we still got quite some |
The build gives this warning, can you clarify? Is there a way of fixing it?
|
We used to define ClockId as hsc2hs-detected ${type clockid_t} type. Unfortunately, certain libcs (e.g. wasi-libc) define clockid_t as a pointer type, and hsc2hs only supports detecting C integral/floating-point types, so clockid_t will mistakenly be detected as a floating-point type, resulting in incorrect code generation. We should really just use the base CClockId type here. base handles C pointer types correctly, since it uses its own custom autoconf logic instead of hsc2hs, and similar issues have been reported & fixed before, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6896 and https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6912. Also make tzset conditional.
514d0c9
to
b35924e
Compare
@AshleyYakeley The warning is harmless, since Neverthless, I added an explicit cast to handle this warning. Also, now we run |
We used to define ClockId as hsc2hs-detected ${type clockid_t} type. Unfortunately, certain libcs (e.g. wasi-libc) define clockid_t as a pointer type, and hsc2hs only supports detecting C integral/floating-point types, so clockid_t will mistakenly be detected as a floating-point type, resulting in incorrect code generation.
We should really just use the base CClockId type here. base handles C pointer types correctly, since it uses its own custom autoconf logic instead of hsc2hs, and similar issues have been reported & fixed before, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6896 and https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6912.