Skip to content

Use separate lib build paths for different configurations - #27694

Merged
dschuff merged 2 commits into
emscripten-core:mainfrom
dschuff:relative_build_dir
Sep 10, 2026
Merged

Use separate lib build paths for different configurations#27694
dschuff merged 2 commits into
emscripten-core:mainfrom
dschuff:relative_build_dir

Conversation

@dschuff

@dschuff dschuff commented Sep 9, 2026

Copy link
Copy Markdown
Member

Libraries with different configurations use different directories in the sysroot (e.g. wasm64-emscripten/pic) but currently all use the same build directory across configurations. When using Ninja, these intermediate directories persist and can result in corruption if one configuration is built after another. We could solve this by just clearing them, but keeping the build directories around can be useful for local development, and will also allow building all the configurations at once (in a future PR).

This PR just makes the build directory share the path logic with the lib directory. (The ports system has its own separate logic).

Libraries with different configurations use different directories in the sysroot
(e.g. wasm64-emscripten/pic) but currently all use the same build directory
across configurations. When using Ninja, these intermediate directories persist
and can result in corruption if one configuration is built after another.
We could solve this by just clearing them, but keeping the build directories
around can be useful for local development, and will also allow building
all the configurations at once (in a future PR).

This PR just makes the build directory share the path logic with the
lib directory. (The ports system has its own separate logic).
@dschuff
dschuff requested a review from kripken September 9, 2026 22:35
Comment thread tools/ports/__init__.py
@staticmethod
def get_build_dir():
return system_libs.get_build_dir()
return cache.get_path('build')

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.

Why change this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The ports system has its own method of mangling library build paths (see the top lines of build_port above) and I wasn't intending to change that in this PR.

We could further merge the logic to standardize on the structure used by the system libs; one thing that would have to change is that when a port is upgraded or redownloaded, it deletes all the builds at once from the shared build directory, so we'd have to update that logic. It might be better as a separate PR.

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.

Ok, sg.

Comment thread tools/ports/__init__.py
@staticmethod
def get_build_dir():
return system_libs.get_build_dir()
return cache.get_path('build')

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.

Ok, sg.

@dschuff
dschuff enabled auto-merge (squash) September 9, 2026 23:51
@dschuff
dschuff merged commit df49c00 into emscripten-core:main Sep 10, 2026
42 checks passed
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.

2 participants