@@ -351,10 +351,17 @@ def make_emscripten_libffi(context, working_dir):
351351 validate_emsdk_version (context .emsdk_cache )
352352 prefix = context .build_paths ["prefix_dir" ]
353353 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" ]
@@ -382,6 +389,10 @@ def make_mpdec(context, working_dir):
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 )
0 commit comments