Skip to content

Commit f75f339

Browse files
committed
Drop Windows support for secondary caches
1 parent d7f0173 commit f75f339

File tree

2 files changed

+17
-41
lines changed

2 files changed

+17
-41
lines changed

bazel/emscripten_cache.bzl

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def get_root_and_script_ext(repository_ctx):
3333
else:
3434
fail('Unsupported architecture for MacOS')
3535
elif repository_ctx.os.name.startswith('windows'):
36-
return (repository_ctx.path(Label("@emscripten_bin_win//:BUILD.bazel")).dirname, '.bat')
36+
fail('Using a secondary cache is not supported on Windows')
37+
#return (repository_ctx.path(Label("@emscripten_bin_win//:BUILD.bazel")).dirname, '.bat')
3738
else:
3839
fail('Unsupported operating system')
3940

@@ -73,35 +74,10 @@ def _emscripten_cache_impl(repository_ctx):
7374
embuilder_args = [embuilder_path] + flags + ["build"] + libraries
7475
# Run embuilder
7576
repository_ctx.report_progress("Building secondary cache")
76-
result = repository_ctx.execute(embuilder_args, quiet=False)
77+
result = repository_ctx.execute(embuilder_args, quiet=True)
7778
if result.return_code != 0:
78-
### TEST
79-
80-
cwd = external_root
81-
dir_result = repository_ctx.execute(['dir'], quiet=False, working_directory=str(cwd))
82-
print('dir_result(external_root).return_code = {}\n\n'.format(dir_result.return_code))
83-
print('dir_result(external_root).stderr = {}\n\n'.format(dir_result.stderr))
84-
print('dir_result(external_root).stdout = {}\n\n'.format(dir_result.stdout))
85-
86-
cwd = cwd.get_child('nodejs_windows_amd64')
87-
dir_result = repository_ctx.execute(['dir'], quiet=False, working_directory=str(cwd))
88-
print('dir_result(nodejs_windows_amd64).return_code = {}\n\n'.format(dir_result.return_code))
89-
print('dir_result(nodejs_windows_amd64).stderr = {}\n\n'.format(dir_result.stderr))
90-
print('dir_result(nodejs_windows_amd64).stdout = {}\n\n'.format(dir_result.stdout))
91-
92-
cwd = cwd.get_child('bin')
93-
dir_result = repository_ctx.execute(['dir'], quiet=False, working_directory=str(cwd))
94-
print('dir_result(bin).return_code = {}\n\n'.format(dir_result.return_code))
95-
print('dir_result(bin).stderr = {}\n\n'.format(dir_result.stderr))
96-
print('dir_result(bin).stdout = {}\n\n'.format(dir_result.stdout))
97-
98-
cwd = cwd.get_child('nodejs')
99-
dir_result = repository_ctx.execute(['dir'], quiet=False, working_directory=str(cwd))
100-
print('dir_result(nodejs).return_code = {}\n\n'.format(dir_result.return_code))
101-
print('dir_result(nodejs).stderr = {}\n\n'.format(dir_result.stderr))
102-
print('dir_result(nodejs).stdout = {}\n\n'.format(dir_result.stdout))
103-
104-
### TEST
79+
# Windows fails here because external/nodejs_windows_amd64/bin/nodejs/node.exe
80+
# does not exist at this point (while the equivalent on Linux and MacOS does)
10581
fail("Embuilder exited with a non-zero return code")
10682
# Override Emscripten's cache with the secondary cache
10783
default_config += "CACHE = '{}'\n".format(cache)

test/test_bazel.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ if (-not $?) { Exit $LastExitCode }
1010

1111
Set-Location test_external
1212

13-
# bazel build //:hello-world-wasm
14-
# if (-not $?) { Exit $LastExitCode }
13+
bazel build //:hello-world-wasm
14+
if (-not $?) { Exit $LastExitCode }
1515

16-
# bazel build //long_command_line:long_command_line_wasm
17-
# if (-not $?) { Exit $LastExitCode }
16+
bazel build //long_command_line:long_command_line_wasm
17+
if (-not $?) { Exit $LastExitCode }
1818

19-
# bazel build //:hello-embind-wasm --compilation_mode dbg # debug
20-
# if (-not $?) { Exit $LastExitCode }
19+
bazel build //:hello-embind-wasm --compilation_mode dbg # debug
20+
if (-not $?) { Exit $LastExitCode }
2121

22-
# # Test use of the closure compiler
23-
# bazel build //:hello-embind-wasm --compilation_mode opt # release
24-
# if (-not $?) { Exit $LastExitCode }
22+
# Test use of the closure compiler
23+
bazel build //:hello-embind-wasm --compilation_mode opt # release
24+
if (-not $?) { Exit $LastExitCode }
2525

26-
Set-Location ..\test_secondary_lto_cache
26+
# Set-Location ..\test_secondary_lto_cache
2727

28-
bazel build //:hello-world-wasm
29-
if (-not $?) { Exit $LastExitCode }
28+
# bazel build //:hello-world-wasm
29+
# if (-not $?) { Exit $LastExitCode }
3030

0 commit comments

Comments
 (0)