Skip to content

Don't embed OUT_DIR in proc-macros - #1778

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:less-embed
Nov 4, 2026
Merged

alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:less-embed

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

This causes problems with reproducible builds and caches and such, so instead change the meaning of WIT_BINDGEN_DEBUG=.. to require a specific directory to be placed into. This is then used in debugging rather than the target out-dir.

Closes #1777

This causes problems with reproducible builds and caches and such, so
instead change the meaning of `WIT_BINDGEN_DEBUG=..` to require a
specific directory to be placed into. This is then used in debugging
rather than the target out-dir.

Closes bytecodealliance#1777
@alexcrichton
alexcrichton requested a review from dicej November 4, 2026 16:31
@alexcrichton
alexcrichton added this pull request to the merge queue Nov 4, 2026
Merged via the queue into bytecodealliance:main with commit 35e8507 Nov 4, 2026
31 checks passed
@alexcrichton
alexcrichton deleted the less-embed branch November 4, 2026 17:43
accusitive pushed a commit to accusitive/wasmtime that referenced this pull request Nov 4, 2026
This is the equivalent of bytecodealliance/wit-bindgen#1778 over here in
the Wasmtime repository. In short by embedding `$OUT_DIR` in the proc
macro it makes the build unreproducible and can reduce cache hits in
larger build systems. Keep Wasmtime's debugging-only feature in parity
with `wit-bindgen`'s feature here by shuffling around how this works.

This additionally deletes the `include_generated_code_from_file` macro
option as that's basically subsumed by `debug` which is a bit of a
clearer name.
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.

wit-bindgen-rust-macro misses build caches across checkouts - DEBUG_OUTPUT_DIR embeds the absolute OUT_DIR

2 participants