-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Remove unused OS macros from test_unistd_unlink #6142
Conversation
Nooooo... having these kinds of macros is useful when one natively compiles the same file to test for cross-platform differences. Tried to skim through the thread, and was still not sure why this kind of change was needed? Emscripten should never define |
NODERAWFS depends on native OS behaviors but without OS macros. We had some choices:
|
Disabling tests removes chances to catch and fix bugs... |
We could put the OS-specific macros back with their OS-specific expectations, but keep the expectation for emscripten the same as it is here (allowing 2 different behaviors). @juj is just saying the OS-specific macros are not actually unused (because he runs them outside emscripten), so they can stay. |
Ah thanks, now I understand - executing NODERAWFS under node.js causes different behavior depending on whether the host system is macOS or some other OS. Thanks for restoring the macros in that PR. I think it's good to keep
A third proposal might be to add Emscripten compile time flags For NODEFS we do already do something like 1. above and uniformize Windows behavior to look more like Linux/macOS behavior, so to me it's a fine solution, although 2. is fine as well, depending on which direction you'd like to author NODERAWFS towards to. What do you think? |
libuv tried it but failed, nodejs/node#18014 for example. The underlying Windows native APIs do not provide enough details to keep consistent behavior. IMO 2. would be the safest option. |
@juj Just FYI, emscripten does define |
Ohh, right.. indeed it does. This is both desirable and undesirable in some cases. It's nice to advertise to behave like Unix/Linux for a lot of scenarios, but for some others, it is not. I think this would be something we'd have two compilation modes for, there's already Emscripten "strict" mode, which might be used for this. |
According to this page, emscripten does not predefine any OS-related preprocessor macros other than
unix
,__unix
, and__unix__
. There are many apparently unused OS-related macros in the test code (such as__APPLE__
orWIN32
), which I think we can delete later.For this PR, I only deleted them from
test_unistd_unlink
, which was necessary for #6008 and #6121.