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

wasm-linker: emit build_id section #14820

Merged
merged 2 commits into from
Mar 8, 2023
Merged

Conversation

jedisct1
Copy link
Contributor

@jedisct1 jedisct1 commented Mar 6, 2023

Make our wasm linker emit the build ID, a value that uniquely identifies a build.

It is intended to capture the "meaning" or inputs of the build, and is usually associated with debug info.

References:

Support for this was also recently added to LLVM: llvm/llvm-project@c7af9ae

Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

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

Please check the value of wasm.base.options.build_id and use that to determine whether to emit a build ID. If you wish to change the default of whether build ids are enabled or disabled, that code lives in Compilation.create.

Please also ensure that the build id makes it into the wasm linker hash, now that this option affects the output. Alternately, ensure that incremental linking notices a change in the build id flag and modifies the output appropriately. For many settings this is already the case since the header is flushed unconditionally.

src/link/Wasm.zig Show resolved Hide resolved
@Luukdegram
Copy link
Sponsor Member

You beat me to it. Nice work Frank!

src/link/Wasm.zig Show resolved Hide resolved
The Build ID is a value that uniquely identifies a build.

It is intended to capture the "meaning" or inputs of the build,
and is usually associated with debug info.

Reference: https://github.com/WebAssembly/tool-conventions/blob/main/BuildId.md
Also use TurboSHAKE instead of BLAKE3 now that we have it.
@jedisct1 jedisct1 enabled auto-merge (squash) March 8, 2023 08:02
@jedisct1 jedisct1 merged commit fea14c7 into ziglang:master Mar 8, 2023
@jedisct1 jedisct1 deleted the wasm-build-id branch March 9, 2023 21:32
truemedian pushed a commit to truemedian/zig that referenced this pull request Mar 30, 2023
The Build ID is a value that uniquely identifies a build.

It is intended to capture the "meaning" or inputs of the build,
and is usually associated with debug info.

Reference: https://github.com/WebAssembly/tool-conventions/blob/main/BuildId.md
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.

3 participants