Skip to content

builder: build SSA before compiling packages - #5577

Open
jakebailey wants to merge 1 commit into
tinygo-org:devfrom
jakebailey:fix-ssa-race
Open

builder: build SSA before compiling packages#5577
jakebailey wants to merge 1 commit into
tinygo-org:devfrom
jakebailey:fix-ssa-race

Conversation

@jakebailey

@jakebailey jakebailey commented Aug 8, 2026

Copy link
Copy Markdown
Member

It seems as though while x/ssa is safe for concurrent use, if you are building one package while inspecting another in the same program, it may still race.

In my testing, just forcing a whole program build is enough to make the race go away. I don't like it, but, I'm fairly certain tinygo uses the entire program anyway.

So, do that, and just document that CompilePackage requires its input to already have been built. (There's no way to assert that either...)

Fixes #5576

@jakebailey
jakebailey requested a review from dgryski August 8, 2026 02:54

@dgryski dgryski left a comment

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.

This fixes the crashes for me. Not sure if anybody else has an idea for a "better" fix though.

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.

data race running my test corpus when compiler build with -race

2 participants