Skip to content

Commit 036c822

Browse files
committed
Fix file embedding tests under windows that were broken by #16050
1 parent 9a0fa6b commit 036c822

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ jobs:
444444
# note we do *not* build all libraries and freeze the cache; as we run
445445
# only limited tests here, it's more efficient to build on demand
446446
- run-tests:
447-
test_targets: "other.test_emcc_cflags other.test_stdin other.test_bad_triple core2.test_sse1 core2.test_ccall other.test_closure_externs other.test_binaryen_debug other.test_js_optimizer_parse_error other.test_output_to_nowhere other.test_emcc_dev_null other.test_cmake* other.test_system_include_paths other.test_emar_response_file core2.test_utf16 other.test_special_chars_in_arguments other.test_toolchain_profiler other.test_realpath_nodefs other.test_response_file_encoding other.test_libc_progname"
447+
test_targets: "other.test_emcc_cflags other.test_stdin other.test_bad_triple core2.test_sse1 core2.test_ccall other.test_closure_externs other.test_binaryen_debug other.test_js_optimizer_parse_error other.test_output_to_nowhere other.test_emcc_dev_null other.test_cmake* other.test_system_include_paths other.test_emar_response_file core2.test_utf16 other.test_special_chars_in_arguments other.test_toolchain_profiler other.test_realpath_nodefs other.test_response_file_encoding other.test_libc_progname other.test_realpath other.test_embed_file_dup"
448448
test-mac:
449449
executor: mac
450450
environment:

tools/file_packager.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ def err(*args):
134134
print(*args, file=sys.stderr)
135135

136136

137+
def to_unix_path(p)
138+
return p.replace(os.path.sep, '/')
139+
140+
137141
def base64_encode(b):
138142
b64 = base64.b64encode(b)
139143
return b64.decode('ascii')
@@ -265,7 +269,7 @@ def generate_object_file(data_files):
265269
err('embedding %s at %s' % (f.srcpath, f.dstpath))
266270

267271
size = os.path.getsize(f.srcpath)
268-
name = to_asm_string(f.dstpath)
272+
name = to_asm_string(to_unix_path(f.dstpath))
269273
out.write(dedent(f'''
270274
.section .rodata.{f.c_symbol_name},"",@
271275
@@ -462,7 +466,7 @@ def main():
462466

463467
for file_ in data_files:
464468
# name in the filesystem, native and emulated
465-
file_.dstpath = file_.dstpath.replace(os.path.sep, '/')
469+
file_.dstpath = to_unix_path(file_.dstpath)
466470
# If user has submitted a directory name as the destination but omitted
467471
# the destination filename, use the filename from source file
468472
if file_.dstpath.endswith('/'):

0 commit comments

Comments
 (0)