Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a config.toml flag for dynamic linking #160

Merged
merged 2 commits into from
Mar 5, 2025

Conversation

jacob-hughes
Copy link
Collaborator

This allows a shared BDWGC build to be dynamically linked using the following config.toml flag:

[alloy]
bdwc-link-shared = true

This flag is false by default.

Previously we set GC_LINK_DYNAMIC=true to link BWDGC dynamically. While this works, it does not invalidate the compilation cache if it's the only thing that has been changed between builds.

This was noticed in benchmarking, where we if we get unlucky and alternate between building BDWGC staticlly and dynamically (e.g. for perf and memory testing) then we ended up with the wrong build but no obvious failures.

This allows a shared BDWGC build to be dynamically linked using the
following config.toml flag:

```toml
[alloy]
bdwc-link-shared = true

```

This flag is false by default.

Previously we set GC_LINK_DYNAMIC=true to link BWDGC dynamically. While
this works, it does not invalidate the compilation cache if it's the
only thing that has been changed between builds.

This was noticed in benchmarking, where we if we get unlucky and
alternate between building BDWGC staticlly and dynamically (e.g. for
perf and memory testing) then we ended up with the wrong build but no
obvious failures.
@ltratt ltratt added this pull request to the merge queue Mar 3, 2025
@jacob-hughes
Copy link
Collaborator Author

I should have mentioned that this does not remove legacy support for using a shared BDWGC with the GC_LINK_DYNAMIC environment variable. It just adds a more robust option too.

@ltratt
Copy link
Member

ltratt commented Mar 3, 2025

Should we get rid of the env var route at some point soon?

@jacob-hughes
Copy link
Collaborator Author

I think so. I just didn't want to inadvertantly break anything for now. We should also similarly make GC_DEBUG_ASSERTIONS a toml feature as it will suffer from the same issues.

@ltratt
Copy link
Member

ltratt commented Mar 3, 2025

Maybe raise brief issues so we don't forget them?

@jacob-hughes
Copy link
Collaborator Author

Great minds

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 3, 2025
@jacob-hughes
Copy link
Collaborator Author

I don't think this one ever hit CI for whatever reason. Would you mind giving it another kick?

@ltratt
Copy link
Member

ltratt commented Mar 3, 2025

There was (in the end, after a timeout that wasn't this PR's fault) a test failure https://ci.soft-dev.org/#/builders/3/builds/2610/steps/3/logs/stdio

@jacob-hughes
Copy link
Collaborator Author

Oof ok

@ltratt ltratt added this pull request to the merge queue Mar 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 4, 2025
A recent commit in grmtools (2ffcffb) uses the recently stabilied Rust
feature: slice `split_at_checked`. Alloy is forked from an older version
of Rust where this is still feature-gated, so unless we pin to an older
version of grmtools which predates this we will get warnings about
unsupported features.
@jacob-hughes
Copy link
Collaborator Author

Funnily enough it seems the original failure we saw was a CI quirk, but now we make it past that we experience a genuine error caused by running the grmtools test suite without pinning it to a version.

The tl;dr is that a very recent commit in grmtools uses a feature which was stabilised in Rust 1.80.0. Alloy is a fork of 1.79.0 so we get a missing feature error. I've fixed this here c7d233e and if you're happy I think this should remain a separate commit.

@ltratt ltratt added this pull request to the merge queue Mar 5, 2025
Merged via the queue into softdevteam:master with commit 7a7d36d Mar 5, 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