-
Notifications
You must be signed in to change notification settings - Fork 92
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
Fix support for GHCJS_BROWSER compilation flag of GHC #333
Fix support for GHCJS_BROWSER compilation flag of GHC #333
Conversation
I was pushing code from gitlab, there seem to be some ghost commits in the history... |
function h$js_futimes(fd,atime,mtime) { | ||
#ifdef GHCJS_BROWSER | ||
throw "h$js_futimes unsupported"; | ||
#else | ||
if (!h$isNode()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be
if (!h$isNode()) { | |
if (!h$isNode() || defined(GHCJS_BROWSER)) { |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean, we want a preprocessor-level if
, not a runtime-level if
here; sources are preprocessed via emcc
before compilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other words if ghc is compiled with -DGHCJS_BROWSER
then h$isNode()
is undefined at runtime and we don't want to include this code at all.
Please rebase cleanly on |
ping @Swordlash |
f0bebdd
to
b9b134d
Compare
LGTM. @luite Could you review it too please? |
Thanks @hasufell :) |
I'm going to close this PR for now since we agreed to remove the macro altogether. |
See https://gitlab.haskell.org/ghc/ghc/-/issues/25613#note_602248
When compiling
ghc
under GHCJS_BROWSER, all the environment checking code should be removed by the preprocessor. This is not the case for thejsbits
of theunix
library, which causes troubles for Google Closure Compiler and bundlers. This PR adds missing directives.