@@ -350,11 +350,18 @@ def write_library_config(prefix, name, config, quiet):
350350def make_emscripten_libffi (context , working_dir ):
351351 validate_emsdk_version (context .emsdk_cache )
352352 prefix = context .build_paths ["prefix_dir" ]
353- libffi_config = load_config_toml ()["libffi" ]
353+ libffi_config = load_config_toml ()["dependencies" ]["libffi" ]
354+ with open (EMSCRIPTEN_DIR / "make_libffi.sh" , "rb" ) as f :
355+ libffi_config ["make_libffi_shasum" ] = hashlib .file_digest (f , "sha256" ).hexdigest ()
354356 if not should_build_library (
355357 prefix , "libffi" , libffi_config , context .quiet
356358 ):
357359 return
360+
361+ if context .check_up_to_date :
362+ print ("libffi out of date, expected to be up to date" , file = sys .stderr )
363+ sys .exit (1 )
364+
358365 url = libffi_config ["url" ]
359366 version = libffi_config ["version" ]
360367 shasum = libffi_config ["shasum" ]
@@ -378,10 +385,14 @@ def make_emscripten_libffi(context, working_dir):
378385def make_mpdec (context , working_dir ):
379386 validate_emsdk_version (context .emsdk_cache )
380387 prefix = context .build_paths ["prefix_dir" ]
381- mpdec_config = load_config_toml ()["mpdec" ]
388+ mpdec_config = load_config_toml ()["dependencies" ][ " mpdec" ]
382389 if not should_build_library (prefix , "mpdec" , mpdec_config , context .quiet ):
383390 return
384391
392+ if context .check_up_to_date :
393+ print ("libmpdec out of date, expected to be up to date" , file = sys .stderr )
394+ sys .exit (1 )
395+
385396 url = mpdec_config ["url" ]
386397 version = mpdec_config ["version" ]
387398 shasum = mpdec_config ["shasum" ]
@@ -678,6 +689,14 @@ def main():
678689 help = "Build all static library dependencies" ,
679690 )
680691
692+ for cmd in [make_mpdec_cmd , make_libffi_cmd , make_dependencies_cmd ]:
693+ cmd .add_argument (
694+ "--check-up-to-date" ,
695+ action = "store_true" ,
696+ default = False ,
697+ help = ("If passed, will fail if dependency is out of date" ),
698+ )
699+
681700 make_build = subcommands .add_parser (
682701 "make-build-python" , help = "Run `make` for the build Python"
683702 )
@@ -705,15 +724,15 @@ def main():
705724 help = (
706725 "If passed, will add the default test arguments to the beginning of the command. "
707726 "Default arguments loaded from Platforms/emscripten/config.toml"
708- )
727+ ),
709728 )
710729 run .add_argument (
711730 "args" ,
712731 nargs = argparse .REMAINDER ,
713732 help = (
714733 "Arguments to pass to the emscripten Python "
715734 "(use '--' to separate from run options)" ,
716- )
735+ ),
717736 )
718737 add_cross_build_dir_option (run )
719738
0 commit comments