@@ -27,19 +27,18 @@ def get_binaryen_root(repository_ctx):
27
27
elif 'aarch64' in repository_ctx .os .arch :
28
28
return repository_ctx .path (Label ("@emscripten_bin_linux_arm64//:all" )).dirname
29
29
else :
30
- repository_ctx . fail ('Unsupported architecture for Linux' )
30
+ fail ('Unsupported architecture for Linux' )
31
31
elif repository_ctx .os .name .startswith ('mac' ):
32
32
if 'amd64' in repository_ctx .os .arch or 'x86_64' in repository_ctx .os .arch :
33
33
return repository_ctx .path (Label ("@emscripten_bin_mac//:all" )).dirname
34
34
elif 'aarch64' in repository_ctx .os .arch :
35
35
return repository_ctx .path (Label ("@emscripten_bin_mac_arm64//:all" )).dirname
36
36
else :
37
- repository_ctx . fail ('Unsupported architecture for MacOS' )
37
+ fail ('Unsupported architecture for MacOS' )
38
38
elif repository_ctx .os .name .startswith ('windows' ):
39
39
return repository_ctx .path (Label ("@emscripten_bin_win//:all" )).dirname
40
40
else :
41
- repository_ctx .fail ('Unsupported operating system' )
42
- return ''
41
+ fail ('Unsupported operating system' )
43
42
44
43
def _emscripten_cache_impl (repository_ctx ):
45
44
# Read the default emscripten configuration file
@@ -71,7 +70,9 @@ def _emscripten_cache_impl(repository_ctx):
71
70
embuilder_args = [embuilder_path ] + flags + ["build" ] + libraries
72
71
# Run embuilder
73
72
repository_ctx .report_progress ("Building secondary cache" )
74
- repository_ctx .execute (embuilder_args , quiet = False )
73
+ result = repository_ctx .execute (embuilder_args , quiet = False )
74
+ if result != 0 :
75
+ fail ("Embuilder exited with a non-zero return code" )
75
76
# Override Emscripten's cache with the secondary cache
76
77
default_config += "CACHE = '{}'\n " .format (repository_ctx .path ('cache' ))
77
78
0 commit comments