Skip to content

Add design doc for using git subtree to manage external libraries - #27593

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:add_subtree_design_doc
Sep 4, 2026
Merged

sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:add_subtree_design_doc

Conversation

@sbc100

@sbc100 sbc100 commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Covers external libraries in system/lib/ as candidates for
git subtree, recommending mimalloc as the initial pilot and
primary example, followed by musl and LLVM runtime libraries.

This was done successfully in wasi-libc:
WebAssembly/wasi-libc#797

See: #27515

@sbc100
sbc100 force-pushed the add_subtree_design_doc branch from 2014a37 to 6888a75 Compare August 22, 2026 04:48
@sbc100
sbc100 force-pushed the add_subtree_design_doc branch from 6888a75 to ff1598e Compare September 4, 2026 18:26
@sbc100 sbc100 changed the title Add design doc for using a git subtree to import musl changes Add design doc for using git subtree to manage external libraries Sep 4, 2026
@sbc100
sbc100 requested review from kleisauke and kripken September 4, 2026 18:26
Covers external libraries in `system/lib/` as candidates for
`git subtree`, recommending `mimalloc` as the initial pilot and
primary example, followed by `musl` and LLVM runtime libraries.

This was done successfully in wasi-libc:
WebAssembly/wasi-libc#797

See: emscripten-core#27515
@sbc100
sbc100 force-pushed the add_subtree_design_doc branch from ff1598e to ef126a5 Compare September 4, 2026 18:35
@sbc100
sbc100 requested a review from dschuff September 4, 2026 20:15
| **`llvm-libc`** | `system/lib/llvm-libc` | [llvm/llvm-project](https://github.com/llvm/llvm-project) | Fork + `update_llvm_libc.py` | **Medium Priority**. Same monorepo considerations as `compiler-rt`. |
| **`openmp`** | `system/lib/openmp` | [llvm/llvm-project](https://github.com/llvm/llvm-project) | Fork + `update_openmp.py` | **Medium Priority**. Same monorepo considerations as `compiler-rt`. |
| **`dlmalloc`** | `system/lib/dlmalloc.c` | Doug Lea (v2.8.6) | Vendored single file | **Low Priority / Skip**. Upstream is inactive; heavily customized for Emscripten. |
| **`stb_image`** | `system/lib/stb_image.c` | [nothings/stb](https://github.com/nothings/stb) | Vendored single file | **Low Priority**. Low update frequency; single file. |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps also ports like SDL...?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, although we don't current have any of those in-tree, to update.

We could potentially bring them in-tree I guess?

@sbc100
sbc100 merged commit a593e00 into emscripten-core:main Sep 4, 2026
42 checks passed
@sbc100
sbc100 deleted the add_subtree_design_doc branch September 4, 2026 23:12
@kleisauke

Copy link
Copy Markdown
Collaborator

Nice! One thing to watch out for is squash-merging these PRs when they set up the git subtree. See for example:
https://github.com/orgs/community/discussions/84731#discussioncomment-8400698
and:

In other words, if you use squash merge in GitHub when creating a subtree, git will not understand that this directory is in fact a subtree. All because the commit message which creates the subtree uses a carriage return!
From: https://noahtallen.com/2024/02/19/github-breaks-git-subtrees-in-the-weirdest-way/

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