-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
T-bugType: bugType: bugT-to-discussType: requires discussionType: requires discussionT-to-investigateType: to investigateType: to investigate
Description
Component
Forge
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
v1.3.5-nightly
What version of Foundryup are you on?
v1.3.0
What command(s) is the bug in?
forge test
Operating System
macOS (Apple Silicon)
Describe the bug
Problem
forge test
fails to find library artifacts for workspace dependencies, while forge build
works fine.
Error:
Error: wasn't able to find artifact for library Helpers at ../node_modules/@sablier/lockup/src/libraries/Helpers.sol
Structure
monorepo/
├── foundry.toml # Base config: "@sablier/=../node_modules/@sablier/"
├── node_modules/@sablier/
│ └── lockup -> ../../lockup # Bun workspace symlink
├── lockup/ # Workspace package with Helpers library
│ └── out/Helpers.sol/Helpers.json ✅ Artifact exists
└── airdrops/ # Workspace package depending on lockup
├── foundry.toml # Inherits base config
└── tests/ # Tests fail to link Helpers library
Dependency
The airdrops
package depends upon the lockup
package like so:
"@sablier/lockup": "workspace:*"
Note
Switching to a remote version of the package, e.g. github:sablier-labs/lockup#staging
, doesn't solve the issue.
Root Cause
I think the root cause is that the test runner's library linking can't resolve artifacts through Bun workspace symlinks, even though compilation works.
Possible related issue: #11587
Repro
- Clone https://github.com/sablier-labs/evm-monorepo
bun install
cd airdrops
forge test
The tests in all other packages work.
Environment
- bun v1.2.21 with workspaces enabled
- forge v1.3.5-nightly
jjranalli
Metadata
Metadata
Assignees
Labels
T-bugType: bugType: bugT-to-discussType: requires discussionType: requires discussionT-to-investigateType: to investigateType: to investigate
Type
Projects
Status
Backlog