diff --git a/libraries/base/cbits/inputReady.c b/libraries/base/cbits/inputReady.c index 3f636c6b2875102e71e4d67fce2b4221c723fba2..d1c1da2e4c4986ae3cff4987d86dfbc83d7eabaf 100644 --- a/libraries/base/cbits/inputReady.c +++ b/libraries/base/cbits/inputReady.c @@ -153,6 +153,9 @@ compute_WaitForSingleObject_timeout(bool infinite, Time remaining) int fdReady(int fd, bool write, int64_t msecs, bool isSock) { +#if defined(wasm32_HOST_ARCH) + return 1; +#else bool infinite = msecs < 0; // if we need to track the time then record the end time in case we are @@ -477,4 +480,5 @@ fdReady(int fd, bool write, int64_t msecs, bool isSock) } } #endif +#endif // wasm32_HOST_ARCH } diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 7220e73f2cf3033cafacd4b175e7a8c30835d5f7..845b0b94199c6bfb71ef80f5c528106790a9e7bc 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -10,6 +10,8 @@ * Improve documentation of various functions * Implement primitives like `lstat` and `rmdir`, for the JS backend. + * Treat all FDs as "nonblocking" on wasm32 ([CLC proposal #234](https://github.com/haskell/core-libraries-committee/issues/234)) + ## 4.19.0.0 *October 2023* * Shipped with GHC 9.8.1 diff --git a/libraries/base/tests/IO/all.T b/libraries/base/tests/IO/all.T index 946d8ea510bd3b8c0f45df417693c0327d41fec4..5c1342014512c9992936ded6f0a5aeea423d39cd 100644 --- a/libraries/base/tests/IO/all.T +++ b/libraries/base/tests/IO/all.T @@ -63,7 +63,7 @@ test('hSetBuffering004', set_stdin('hSetBuffering004.hs'), compile_and_run, [''] test('ioeGetErrorString001', normal, compile_and_run, ['-cpp']) test('ioeGetFileName001', normal, compile_and_run, ['-cpp']) test('ioeGetHandle001', normal, compile_and_run, ['-cpp']) -test('isEOF001', [extra_run_opts('</dev/null'), when(arch('wasm32'), fragile(23275))], compile_and_run, ['']) +test('isEOF001', [extra_run_opts('</dev/null')], compile_and_run, ['']) test('misc001', [extra_run_opts('misc001.hs misc001.out')], compile_and_run, ['']) @@ -76,7 +76,7 @@ test('openFile005', js_broken(22261), compile_and_run, ['']) test('openFile006', [], compile_and_run, ['']) test('openFile007', js_broken(22261), compile_and_run, ['']) test('openFile008', [cmd_prefix('ulimit -n 1024; ')], compile_and_run, ['']) -test('openFile009', [when(arch('wasm32'), fragile(23284))], compile_and_run, ['']) +test('openFile009', [], compile_and_run, ['']) test('putStr001', normal, compile_and_run, ['']) test('readFile001', js_broken(22261), compile_and_run, ['']) @@ -155,7 +155,6 @@ test('encodingerror001', normal, compile_and_run, ['']) # Requires use of the FD interface which is not supported under WINIO test('T4808', [when(opsys('mingw32'), skip) - , when(arch('wasm32'), fragile(23284)) ,fragile_for(16909, concurrent_ways), exit_code(1)] , compile_and_run, ['']) test('T4895', normal, compile_and_run, ['']) diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index d6c0e4126a0f3b3fdf69eea97bc68c49e29e7673..90893d1096a0e50b1fd4b5f9db2e8c57eee26327 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -174,9 +174,8 @@ test('T7457', normal, compile_and_run, ['']) test('T7773', [when(opsys('mingw32'), skip), js_broken(22261), - expect_broken_for(23272, ['ghci-opt']), # unclear - when(arch('wasm32'), - fragile(23275))], + expect_broken_for(23272, ['ghci-opt']) # unclear + ], compile_and_run, ['']) # Andreas says that T7773 will not (and should not) work on Windows diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index d2b6038d0a432bf8f6f619d933e69cd555b0663c..fdb8c98a8e7a1656e6ed225e42263a771333d038 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -29,7 +29,7 @@ test('cgrun021', extra_ways(['nursery_chunks']), compile_and_run, ['']) test('cgrun022', normal, compile_and_run, ['']) test('cgrun024', normal, compile_and_run, ['']) test('cgrun025', - [ omit_ghci, extra_run_opts('cgrun025.hs < /dev/null'), exit_code(1), when(arch('wasm32'), fragile(23275))], + [ omit_ghci, extra_run_opts('cgrun025.hs < /dev/null'), exit_code(1) ], compile_and_run, ['']) test('cgrun026', normal, compile_and_run, ['']) test('cgrun027', normal, compile_and_run, [''])