foundry: `Text file busy (os error 26)` due to race condition in SVM when doing multiple installations

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

nightly

What command(s) is the bug in?

forge build

Operating System

Linux

Describe the bug

Our monorepo has a bunch of packages, each using foundry nightly in CI (via foundry-rs/foundry-toolchain@v1). Each of these use forge build in their build step and we recently tried to turn on parallel builds (via pnpm), but it failed with

Text file busy (os error 26)

The logs weren’t specific about where this was coming from, but I later saw a log line that mentioned solc-0.8.13:

image

Unclear if this is a foundry issue or solc issue, but it originates from forge build, so I’m starting here.

Ultimately would like to be able to run forge build for multiple foundry projects in parallel. Is this an issue with some sort of global cache? Or strictly just a ulimit thing?

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 3
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

since we already have is in forge, seems like there is actually a use case for an install solc subcommand

at LUKSO with the lsp-smart-contracts, we fixed it by running forge build first as well in the CI and setting forge test as dependant on the build command in the turbo.json first.

See this commit for details: https://github.com/lukso-network/lsp-smart-contracts/pull/894/commits/25ba13438c0336cc99222f0e74222403e837f23f

image image

And the potential resolution is to foundryup then forge build once, then running all the forge build steps in parallel should work

yes, missing solc bins are lazily installed during forge build, looks like the file lock in svm that should prevent these cases where two processes potentially write to and execute the same binary isn’t working as expected

This should be bypassed if you trigger forge b once before starting the parallel job

Text file busy (os error 26)

https://stackoverflow.com/a/16764967/6242846