summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Meredith <joshmeredith2008@gmail.com>2023-04-18 08:56:17 +0000
committerJosh Meredith <joshmeredith2008@gmail.com>2023-04-21 12:36:44 +0000
commit77794face29c1109a859bfadbba2e96a35320e29 (patch)
treeb24ce0c8ca3661568ae75e7de0ea990757df288c
parent1532a8b2b222fee73959a0760ac8867be7f19ce6 (diff)
downloadhaskell-wip/js-base_access.tar.gz
JS: Fix h$base_access implementation (issue 22576)wip/js-base_access
-rw-r--r--hadrian/src/Settings/Builders/RunTest.hs6
-rw-r--r--libraries/base/jsbits/base.js6
-rw-r--r--testsuite/tests/ado/all.T2
-rw-r--r--testsuite/tests/rep-poly/all.T2
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T2
5 files changed, 11 insertions, 7 deletions
diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs
index 1a0f411d97..136300f025 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 b9e0b84ce1..b88afd90fd 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, [''])