Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip wasm-opt in PHP builds #34

Merged
merged 2 commits into from
Jan 18, 2023
Merged

Conversation

ereslibre
Copy link
Contributor

@ereslibre ereslibre commented Jan 17, 2023

Allow to skip wasm-opt invocations that might come from clang when linking the WebAssembly final module.

This way we decide what are the passes we want to perform on the resulting binary.

@ereslibre ereslibre requested a review from a team January 17, 2023 14:20
By exporting the WASMLABS_SKIP_WASM_OPT envvar, the wasm-opt wrapper
present in the wasm-base container image will make the wasm-opt call a
no-op.

This is useful for cases when we don't desire wasm-opt to be called,
for example when invoked directly by
clang (llvm/llvm-project#55781).
@ereslibre
Copy link
Contributor Author

ereslibre commented Jan 17, 2023

An example of how the output looks:

2023-01-17T17:18:23,238172663+00:00 | Building 'cgi'...
2023-01-17T17:18:24,448285925+00:00 | wasm-opt (with args "sapi/cgi/php-cgi -O2 -o sapi/cgi/php-cgi") was intercepted; this invocation will be a no-op
2023-01-17T17:18:24,450023531+00:00 | Preparing artifacts...
2023-01-17T17:18:24,451319589+00:00 | Running wasm-opt with the asyncify pass on php-cgi...
2023-01-17T17:18:24,452850525+00:00 | wasm-opt (with args "-O2 --asyncify --pass-arg=asyncify-ignore-imports -o /wlr/build-output/php/php-7.4.32/bin/php-cgi.wasm sapi/cgi/php-cgi") was intercepted; executing /opt/bin/wasm-opt
2023-01-17T17:20:02,011862979+00:00 | DONE. Artifacts in /wlr/build-output/php/php-7.4.32

@ereslibre ereslibre changed the title Skip wasm-opt in the PHP builds Skip wasm-opt in PHP builds Jan 17, 2023
Copy link
Contributor

@Angelmmiguel Angelmmiguel left a comment

Choose a reason for hiding this comment

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

LGTM! 👏

@Angelmmiguel
Copy link
Contributor

Just for tracking on this PR, this is related to llvm/llvm-project#55781

@ereslibre ereslibre merged commit 8aec06d into vmware-labs:main Jan 18, 2023
@ereslibre ereslibre deleted the skip-wasm-opt branch January 18, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants