diff options
author | Josh Meredith <joshmeredith2008@gmail.com> | 2023-04-18 08:56:17 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-04-25 18:12:38 -0400 |
commit | 8f656188e271fc55b31a50a1c2f3cf6ff9bbeeea (patch) | |
tree | f1355837ab8525dcbf97c8e64a999c1ac345fff7 | |
parent | ebd5b0781c6e6f4642db91353fab0f0ec04af3bc (diff) | |
download | haskell-8f656188e271fc55b31a50a1c2f3cf6ff9bbeeea.tar.gz |
JS: Fix h$base_access implementation (issue 22576)
-rw-r--r-- | hadrian/src/Settings/Builders/RunTest.hs | 6 | ||||
-rw-r--r-- | libraries/base/jsbits/base.js | 6 | ||||
-rw-r--r-- | testsuite/tests/ado/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 2 |
5 files changed, 11 insertions, 7 deletions
diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs index 5e4a1ad17b..b3acadbcbd 100644 --- a/hadrian/src/Settings/Builders/RunTest.hs +++ b/hadrian/src/Settings/Builders/RunTest.hs @@ -105,7 +105,11 @@ inTreeCompilerArgs stg = do tables_next_to_code <- flag TablesNextToCode targetWithSMP <- targetSupportsSMP - let ghcStage = succStage stg + cross <- flag CrossCompiling + + let ghcStage + | cross, Stage1 <- stg = Stage1 + | otherwise = succStage stg debugAssertions <- ghcDebugAssertions <$> flavour <*> pure ghcStage debugged <- ghcDebugged <$> flavour <*> pure ghcStage profiled <- ghcProfiled <$> flavour <*> pure ghcStage diff --git a/libraries/base/jsbits/base.js b/libraries/base/jsbits/base.js index 1f0123943b..46434298c0 100644 --- a/libraries/base/jsbits/base.js +++ b/libraries/base/jsbits/base.js @@ -14,11 +14,11 @@ function h$base_access(file, file_off, mode, c) { TRACE_IO("base_access") #ifndef GHCJS_BROWSER if(h$isNode()) { - h$fs.stat(fd, function(err, fs) { - if(err) { + h$fs.access(h$decodeUtf8z(file, file_off), mode, function(err) { + if (err) { h$handleErrnoC(err, -1, 0, c); } else { - c(mode & fs.mode); // fixme is this ok? + c(0); } }); } else diff --git a/testsuite/tests/ado/all.T b/testsuite/tests/ado/all.T index 0568cd00e9..a3b9b3c030 100644 --- a/testsuite/tests/ado/all.T +++ b/testsuite/tests/ado/all.T @@ -20,5 +20,5 @@ test('T15344', normal, compile_and_run, ['']) test('T16628', normal, compile_fail, ['']) test('T17835', normal, compile, ['']) test('T20540', normal, compile, ['']) -test('T16135', [when(compiler_debugged(),expect_broken(16135)), js_broken(22576)], compile_fail, ['']) +test('T16135', [when(compiler_debugged(),expect_broken(16135))], compile_fail, ['']) test('T22483', normal, compile, ['-Wall']) diff --git a/testsuite/tests/rep-poly/all.T b/testsuite/tests/rep-poly/all.T index 0be5b954af..43bccab16e 100644 --- a/testsuite/tests/rep-poly/all.T +++ b/testsuite/tests/rep-poly/all.T @@ -85,7 +85,7 @@ test('RepPolyUnliftedNewtype', normal, compile, ['-fno-warn-partial-type-signatures -fno-warn-deprecated-flags']) test('RepPolyWildcardPattern', normal, compile_fail, ['']) test('RepPolyWrappedVar', normal, compile_fail, ['']) -test('RepPolyWrappedVar2', js_broken(22576), compile, ['']) +test('RepPolyWrappedVar2', js_broken(23280), compile, ['']) test('UnliftedNewtypesCoerceFail', normal, compile_fail, ['']) test('UnliftedNewtypesLevityBinder', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 0ae1fdd646..f13dd45b08 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -328,7 +328,7 @@ test('T8262', normal, compile_fail, ['']) # TcCoercibleFail times out with the compiler is compiled with -DDEBUG. # This is expected (see comment in source file). -test('TcCoercibleFail', [when(compiler_debugged(), skip), js_broken(22576)], compile_fail, ['']) +test('TcCoercibleFail', [when(compiler_debugged(), skip)], compile_fail, ['']) test('TcCoercibleFail2', [], compile_fail, ['']) test('TcCoercibleFail3', [], compile_fail, ['']) |