Deduplicate headers across the per-target sysroots - #656
Merged
Conversation
This commit is an attempt at addressing WebAssembly#655 to remove duplicate header files across the sysroot. I don't know of an easy way of doing this with the built-in installation processes so a small script is added here which implements the logic of moving files around. The build process now configures the include install directory to be in a non-final location and the script will assemble it into the final location. The end result is that `share/wasi-sysroot/include` directly includes header files which are the exact same across all targets and configurations. This doesn't include all headers, however, and per-target sysroots are still present for headers that differ like `wasi/version.h` or exception-related things in libcxx. Overall this shaved ~300M off a local install which seems like a nice size reduction. Closes WebAssembly#655
ruvalcab8eduardo-collab
approved these changes
Sep 10, 2026
dicej
approved these changes
Sep 10, 2026
| // Bring all iterators up to `name` | ||
| for (other, src) in rest.iter_mut() { | ||
| while let Some((e, ft)) = other.next_if(|(e, _)| e < name) { | ||
| // cp_r(&mut src.join(&e), ft, &mut dst_root.join(&dst).join(&e)); |
alexcrichton
enabled auto-merge (squash)
September 10, 2026 22:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit is an attempt at addressing #655 to remove duplicate header files across the sysroot. I don't know of an easy way of doing this with the built-in installation processes so a small script is added here which implements the logic of moving files around. The build process now configures the include install directory to be in a non-final location and the script will assemble it into the final location.
The end result is that
share/wasi-sysroot/includedirectly includes header files which are the exact same across all targets and configurations. This doesn't include all headers, however, and per-target sysroots are still present for headers that differ likewasi/version.hor exception-related things in libcxx.Overall this shaved ~300M off a local install which seems like a nice size reduction.
Closes #655