diff --git a/test/fs/test_fs_enotdir.c b/test/fs/test_fs_enotdir.c index e221ed8e59304..0e776a732a248 100644 --- a/test/fs/test_fs_enotdir.c +++ b/test/fs/test_fs_enotdir.c @@ -17,7 +17,7 @@ int main() { assert(errno == ENOTDIR); } { - assert(open("./does-not-exist/", O_CREAT) == -1); + assert(open("./does-not-exist/", O_CREAT, 0777) == -1); assert(errno == EISDIR); } printf("success\n"); diff --git a/test/fs/test_fs_readdir_ino_matches_stat_ino.c b/test/fs/test_fs_readdir_ino_matches_stat_ino.c index 68e1f1da4e55d..3d231eb7a60e7 100644 --- a/test/fs/test_fs_readdir_ino_matches_stat_ino.c +++ b/test/fs/test_fs_readdir_ino_matches_stat_ino.c @@ -58,5 +58,6 @@ int main() { assert(a_ino == sta.st_ino); assert(b_ino == stb.st_ino); printf("success\n"); + closedir(dirp); return 0; } diff --git a/test/test_core.py b/test/test_core.py index 6846074f2dfa2..8075a42ade9bd 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -19,7 +19,7 @@ from tools.shared import PIPE from tools.shared import EMCC, EMAR, FILE_PACKAGER -from tools.utils import WINDOWS, MACOS, write_file, delete_file +from tools.utils import WINDOWS, MACOS, LINUX, write_file, delete_file from tools import shared, building, config, utils, webassembly import common from common import RunnerCore, path_from_root, requires_native_clang, test_file, create_file @@ -5546,8 +5546,8 @@ def test_fcntl(self): @also_with_nodefs_both @crossplatform def test_fcntl_open(self): - if '-DNODERAWFS' in self.emcc_args and WINDOWS: - self.skipTest('currently failing under windows and noderawfs') + if '-DNODERAWFS' in self.emcc_args and not LINUX: + self.skipTest('noderawfs fails here under non-linux') self.do_run_in_out_file_test('fcntl/test_fcntl_open.c') @also_with_wasm_bigint diff --git a/tools/system_libs.py b/tools/system_libs.py index 3b01a85fbf651..ef896f6ec96ac 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -471,14 +471,9 @@ def get_files(self): def generate_ninja(self, build_dir, libname): ensure_sysroot() utils.safe_ensure_dirs(build_dir) + self.build_dir = build_dir cflags = self.get_cflags() - if self.deterministic_paths: - source_dir = utils.path_from_root() - relative_source_dir = os.path.relpath(source_dir, build_dir) - cflags += [f'-ffile-prefix-map={source_dir}={DETERMINISITIC_PREFIX}', - f'-ffile-prefix-map={relative_source_dir}={DETERMINISITIC_PREFIX}', - f'-fdebug-compilation-dir={DETERMINISITIC_PREFIX}'] asflags = get_base_cflags(preprocess=False) input_files = self.get_files() ninja_file = os.path.join(build_dir, 'build.ninja') @@ -492,17 +487,11 @@ def build_objects(self, build_dir): with the `cflags` returned by `self.get_cflags()`. """ batch_inputs = int(os.environ.get('EMCC_BATCH_BUILD', '1')) + self.build_dir = build_dir batches = {} commands = [] objects = set() cflags = self.get_cflags() - if self.deterministic_paths: - source_dir = utils.path_from_root() - if batch_inputs: - relative_source_dir = os.path.relpath(source_dir, build_dir) - cflags += [f'-ffile-prefix-map={relative_source_dir}={DETERMINISITIC_PREFIX}'] - cflags += [f'-ffile-prefix-map={source_dir}={DETERMINISITIC_PREFIX}', - f'-fdebug-compilation-dir={DETERMINISITIC_PREFIX}'] case_insensitive = is_case_insensitive(build_dir) for src in self.get_files(): ext = shared.suffix(src) @@ -611,6 +600,12 @@ def get_cflags(self): if self.includes: cflags += ['-I' + utils.path_from_root(i) for i in self._inherit_list('includes')] + if self.deterministic_paths: + source_dir = utils.path_from_root() + relative_source_dir = os.path.relpath(source_dir, self.build_dir) + cflags += [f'-ffile-prefix-map={relative_source_dir}={DETERMINISITIC_PREFIX}'] + cflags += [f'-ffile-prefix-map={source_dir}={DETERMINISITIC_PREFIX}', + f'-fdebug-compilation-dir={DETERMINISITIC_PREFIX}'] return cflags def get_base_name_prefix(self):