[build] Inline xxHash submodule into src-ThirdParty/#11657
Open
jonathanpeppers wants to merge 1 commit into
Open
[build] Inline xxHash submodule into src-ThirdParty/#11657jonathanpeppers wants to merge 1 commit into
jonathanpeppers wants to merge 1 commit into
Conversation
We only consume the `xxhash.h` header from xxHash, and we use it in inline mode (`XXH_INLINE_ALL`). Vendor the header into `src-ThirdParty/xxHash/` and remove the `external/xxHash` git submodule to reduce one more clone-time dependency and align with the ongoing external/ cleanup (PRs dotnet#11529, dotnet#11568, dotnet#11580, dotnet#11608, dotnet#11613, dotnet#11631). Changes: * Copy `external/xxHash/xxhash.h` verbatim to `src-ThirdParty/xxHash/xxhash.h` (BSD-2-Clause, already attributed in `THIRD-PARTY-NOTICES.TXT`). * Replace the dead `XXHASH_DIR` variable in `src/native/CMakeLists.txt` with a new `THIRDPARTY_DIR` pointing at `${REPO_ROOT_DIR}/src-ThirdParty` and add it next to `${EXTERNAL_DIR}` in the six `target_include_directories` blocks so `<xxHash/xxhash.h>` resolves from the new location (`shared/xxhash.hh` already wraps it transparently). * Remove the submodule entry from `.gitmodules` and the corresponding dependabot ignore entry from `.github/dependabot.yml`. * Update `.github/skills/update-tpn/SKILL.md` to list xxHash under "Vendored Source" instead of "Git Submodules". Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the external/xxHash git submodule and vendors the single consumed upstream artifact (xxhash.h) into src-ThirdParty/xxHash/, updating native CMake include paths so #include <xxHash/xxhash.h> continues to resolve on case-sensitive filesystems. This fits the repo’s ongoing external/ cleanup by converting a header-only dependency from submodule → in-tree vendored source.
Changes:
- Vendor
xxhash.hundersrc-ThirdParty/xxHash/and rely on existing header-only inline usage (XXH_INLINE_ALL). - Introduce
THIRDPARTY_DIRinsrc/native/CMakeLists.txtand add it to the relevanttarget_include_directoriesblocks across CLR/Mono/NativeAOT native targets. - Remove the
external/xxHashsubmodule wiring and related maintenance/docs entries (.gitmodules, Dependabot ignore, TPN update skill doc).
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src-ThirdParty/xxHash/xxhash.h |
Adds the vendored xxHash header (BSD-2-Clause) at the include path expected by #include <xxHash/xxhash.h>. |
src/native/CMakeLists.txt |
Defines THIRDPARTY_DIR and wires it into CLR include directories; removes the unused XXHASH_DIR. |
src/native/clr/host/CMakeLists.txt |
Adds ${THIRDPARTY_DIR} to host target include paths so xxHash/xxhash.h resolves. |
src/native/clr/shared/CMakeLists.txt |
Adds ${THIRDPARTY_DIR} to shared CLR target include paths. |
src/native/mono/monodroid/CMakeLists.txt |
Adds ${THIRDPARTY_DIR} to Mono monodroid target include paths. |
src/native/mono/shared/CMakeLists.txt |
Adds ${THIRDPARTY_DIR} to Mono shared target include paths (BUILD_INTERFACE). |
src/native/nativeaot/host/CMakeLists.txt |
Adds ${THIRDPARTY_DIR} to NativeAOT host target include paths. |
.gitmodules |
Removes the external/xxHash submodule entry. |
.github/dependabot.yml |
Drops external/xxHash from the gitsubmodule ignore list. |
.github/skills/update-tpn/SKILL.md |
Moves xxHash from submodules to vendored sources and clarifies header-only usage. |
Member
Author
|
I'm on the fence about doing this, we can discuss. |
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.
Context: aligned with the ongoing
external/cleanup campaign (#11529, #11568, #11580, #11608, #11613, #11631).We only consume the
xxhash.hheader from xxHash, and we use it in inline mode only (XXH_INLINE_ALL) viasrc/native/common/include/shared/xxhash.hh:No
.cfrom upstream is ever compiled. Vendor that one header intosrc-ThirdParty/xxHash/and drop the git submodule.Changes
external/xxHash/xxhash.hverbatim tosrc-ThirdParty/xxHash/xxhash.h(BSD-2-Clause). Directory case isxxHash(capital H) to match the existing<xxHash/xxhash.h>include path on case-sensitive filesystems.src/native/CMakeLists.txt:XXHASH_DIRvariable (it was set but never referenced).THIRDPARTY_DIR = ${REPO_ROOT_DIR}/src-ThirdPartyvariable.${THIRDPARTY_DIR}next to${EXTERNAL_DIR}in the sixtarget_include_directoriesblocks that previously resolved<xxHash/xxhash.h>fromexternal/:src/native/CMakeLists.txt(CLR macro)src/native/clr/host/CMakeLists.txtsrc/native/clr/shared/CMakeLists.txtsrc/native/nativeaot/host/CMakeLists.txtsrc/native/mono/monodroid/CMakeLists.txtsrc/native/mono/shared/CMakeLists.txt[submodule "external/xxHash"]block from.gitmodules.external/xxHashfrom the gitsubmodule ignore list in.github/dependabot.yml..github/skills/update-tpn/SKILL.md- movexxHashfrom the "Git Submodules" table to the "Vendored Source" table; reword the "Native Libraries" line to reflect the new header-only inline usage.THIRD-PARTY-NOTICES.TXTalready has a full BSD-2-ClauseCyan4973/xxHashblock, so no TPN edits are required.Why
THIRDPARTY_DIRpoints atsrc-ThirdParty/(notsrc-ThirdParty/xxHash/)The include in our wrapper header is written as
<xxHash/xxhash.h>, so the search root we add totarget_include_directoriesmust be the parent ofxxHash/— i.e.src-ThirdParty/— for thexxHash/prefix to resolve. This mirrors how${EXTERNAL_DIR}already works today: it'sexternal/(parent of all submodule dirs), notexternal/xxHash/. The wrapper headersrc/native/common/include/shared/xxhash.hhis intentionally unchanged.The variable is named generically (
THIRDPARTY_DIRrather thanXXHASH_DIR) so future inlinings of otherexternal/submodules that use the same<dir-name/header.h>include style (e.g.robin-map,constexpr-xxh3,libunwind) can reuse the same variable instead of either duplicating the${REPO_ROOT_DIR}/src-ThirdPartyliteral across sixtarget_include_directoriesblocks or adding yet another per-project*_DIRvariable.Verification
git grep "external/xxHash"-> no matches.git grep XXHASH_DIR-> no matches.git submodule status->external/xxHashis gone.dotnet-local.cmd build Xamarin.Android.slnbuilds the Mono native projects (which transitively include<shared/xxhash.hh>-><xxHash/xxhash.h>) cleanly: 0 Errors, all surviving warnings pre-date this PR.