Skip to content

[sync_deps.py] Touch Binaryen's config.h.in after syncing - #28064

Open
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:sync_deps_binaryen_version
Open

sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:sync_deps_binaryen_version

Conversation

@sbc100

@sbc100 sbc100 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

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 #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. If/when this lands we can remove this change on the emscripten side.

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
@sbc100
sbc100 requested a review from kripken October 23, 2026 21:05

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tools/maint/sync_deps.py
Comment on lines +189 to +190
if not DRY_RUN:
os.utime(config_h_in)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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}')

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant