Skip to content

Conversation

@jacob-hughes
Copy link
Collaborator

Previously, libstd depended on libbdwgc (our bindings layer for
libgc.so). Historically this made sense when we tried statically linking
libgc.a because the interface was tightly coupled with code in
library/std/gc.rs.

However, this was always a pain-point: liballoc must also depend on
libbdwgc, but libstd depends on liballoc, causing this confusing and
error-prone cyclic dependency. This reared its head in two main ways:
(1) very slow rustc compile times, because libbdwgc would always
cache-bust libstd recompiles; (2) occassionally, the build artefacts
would end up in a irreparable state and require a full clean (this
mostly happened when sending a SIGINT to x.py while it was busy
building).

This commit fixes both these issues, but it is also a necessary
prerequesite for the changes to our stat collection, which require
libbdwgc to be isolated from libstd in order to prevent duplicate metric
collection.

@jacob-hughes
Copy link
Collaborator Author

Force-pushed a fix to rebase this with the base branch

@ltratt ltratt added this pull request to the merge queue Jun 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 11, 2025
@jacob-hughes
Copy link
Collaborator Author

These run-make tests are a real pain. It seems I need to conditionally import bdwgc for stage 2. Trying this now.

@jacob-hughes
Copy link
Collaborator Author

Fixed here fc72607

Previously, libstd depended on libbdwgc (our bindings layer for
libgc.so). Historically this made sense when we tried statically linking
libgc.a because the interface was tightly coupled with code in
library/std/gc.rs.

However, this was always a pain-point: liballoc must also depend on
libbdwgc, but libstd depends on liballoc, causing this confusing and
error-prone cyclic dependency. This reared its head in two main ways:
(1) very slow rustc compile times, because libbdwgc would always
cache-bust libstd recompiles; (2) occassionally, the build artefacts
would end up in a irreparable state and require a full clean (this
mostly happened when sending a SIGINT to `x.py` while it was busy
building).

This commit fixes both these issues, but it is also a necessary
prerequesite for the changes to our stat collection, which require
libbdwgc to be isolated from libstd in order to prevent duplicate metric
collection.
Building libgc now happens inside the bootstrapper which handles the
relevant build args.
@ltratt
Copy link
Member

ltratt commented Jun 11, 2025

Please squash.

@jacob-hughes jacob-hughes force-pushed the move-bdwgc-to-liballoc branch from fc72607 to 942a788 Compare June 11, 2025 20:33
@jacob-hughes
Copy link
Collaborator Author

Squashed

@ltratt ltratt added this pull request to the merge queue Jun 11, 2025
Merged via the queue into softdevteam:master with commit 3d1d918 Jun 11, 2025
2 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