Repository navigation
Conversation
Binaryen currently only runs `git describe` when configuring CMake, so switching git revisions and running an incremental build leaves `config.h` (and `wasm-opt --version`) stale unless CMake re-runs. This can cause the version check added in emscripten-core#28053 to report a stale Binaryen revision after running `tools/maint/sync_deps.py`. Touch `config.h.in` after checking out a new Binaryen revision so CMake re-runs on the next build. See: WebAssembly/binaryen#9299
There was a problem hiding this comment.
Code Review
This pull request updates tools/maint/sync_deps.py to return a boolean from sync_repo indicating whether a repository was updated. If the binaryen repository is updated, the script now touches config.h.in to force CMake to re-run on the next build. The feedback suggests wrapping the os.utime call in a try-except block to prevent potential filesystem errors from crashing the script after a successful synchronization.
| if not DRY_RUN: | ||
| os.utime(config_h_in) |
There was a problem hiding this comment.
Wrapping the os.utime call in a try-except block is safer. Since the main repository synchronization has already completed successfully, any unexpected file system permission issue or OS error when touching config.h.in shouldn't cause the entire script to crash with a traceback.
| if not DRY_RUN: | |
| os.utime(config_h_in) | |
| if not DRY_RUN: | |
| try: | |
| os.utime(config_h_in) | |
| except OSError as e: | |
| print(f' Warning: Failed to touch {config_h_in}: {e}') |
Binaryen currently only runs
git describewhen configuring CMake, so switching git revisions and running an incremental build leavesconfig.h(andwasm-opt --version) stale unless CMake re-runs. This can cause the version check added in #28053 to report a stale Binaryen revision after runningtools/maint/sync_deps.py.Touch
config.h.inafter checking out a new Binaryen revision so CMake re-runs on the next build.See WebAssembly/binaryen#9299. If/when this lands we can remove this change on the emscripten side.