-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Scripting borked: No such file or directory (os error 2) #6154
Comments
thanks for looking into this. is this public by any chance? can you charge the logs that you get from running with RUST_LOG like |
can you also try after foundryup, we fixed a few issues the last few days. sorry for the inconveniences |
Yeah of course! I think the traces at the end of the logs are probably what we are after anyway. I can also pass the Note that this is the output when run from the Ubuntu on WSL (AMD64 arch) setup. |
hmm, I believe this is a linking bug, but hard to debug/fix without a proper way to reproduce... could you perhaps try:
|
Unfortunately that did not fix the bug, still getting "No such file or directory (os error 2)" A linking bug would make sense as the nuking .svm file solution I found was taken from the NixOS thread below, which appears to be a similar issue though I am not using NixOS or a FHS-challenged Linux distro. The fact that I use Ubuntu VMs on both WSL and Apple M1 silicon seems similar enough, but what is confusing is that now the error is appearing on a plain jane Ubuntu AMD64 architecture desktop and vanilla MacOS on M1. I piped the entire output of the If these are not enough information to properly debug, I will provide a reproducible branch for you to examine. At the moment one submodule is private so I'd just need to remove that one and delete references to it |
@mattsse I've reconfigured the repository for debugging purposes so the problem is directly reproducible. Your help is deeply appreciated as I don't know what else to do. Here is the repository: https://github.com/0xStation/groupos/tree/linking-bug The branch I've configured for debugging is called
I believe the One thing to note is that |
unable to compile this because |
Thanks for the quick support! I thought I removed it from both the host repository and the 0xRails submodule in the Is it still present for you in the GroupOS |
ptal @Evalir |
Sorry to bother, @Evalir, but is there any updates on this? I have been using |
Good news! I seem to have found the offending file, though I have not yet identified the exact problem. For context, there was a submodule dependency that was using both HardHat and Foundry, so the What's interesting is that the ERC4337 file causing the problem is one that doesn't contain any contract declaration; only a struct. It's also worth noting that the struct declaration uses the name Perhaps Foundry or Solc is expecting to find a contract artifact instead of a lonely struct, or perhaps the lonely struct is not expected to share the same name of the file without a contract. Another thing I can't explain is that simply upgrading the pragma version declaration from I'm relieved to have scripts working again and am hoping this information is enough to help you identify the source of the bug. Let me know if there's any more I can do to help. |
Yep @robriks, glad to hear scripts are working for you again! I spent some time looking at the issue today, and this is a combination of dependencies having either outdated or extremely complicated remappings, and also a bug on our side in Wondering if we can close this, to track on compilers? |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (602460e 2023-10-24T00:16:58.926357929Z)
What command(s) is the bug in?
forge script
Operating System
Linux
Describe the bug
Running
forge script
has started to fail with error "No such file or directory (os error 2)" and I am not sure why.For example,
forge script script/accountGroup/AccountGroup.s.sol
on a file that definitely exists (see screenshot) fails.Relevant items that I have investigated to no avail:
../.svm
worked once, but I can no longer use this fix since the .svm file is either no longer being generated or only worked the first time. Have had trouble finding documentation around the .svm file and what generates it. I feel like it is the strongest lead since nuking it fixed the problem onceforge build --force
orforge update
is invoked). I discovered this by switching to Ubuntu WSL running on Windows 10, which worked briefly before borking. Same for switching to Ubuntu 22.04 desktop on AMD64.vm.readFile()
that sometimes doesn't exist, but for months it had given a more verbose warning reminding me to create the file and not caused any issues of this scale. The os error 2 warning is different, and creating the file in both the 0xRails git submodule and the GroupOS parent repository does not resolve the errorforge install purged_submodule
did not make a differencesrc/=src/
andtest/=test/
etcCan provide a reference branch to reproduce this issue, but I need to make some changes first.
Please help, I am running out of leads to investigate! I feel like the .svm and the git submodule leads are most relevant since I confirmed issues WRT both, but resolving them does not fix the problem.
Possibly related?
forge update
fails with errors caused by submodule dependencies like the below:fatal: Needed a single revision fatal: Unable to find current origin/v1.3.0 revision in submodule path 'lib/forge-std' fatal: Needed a single revision fatal: Unable to find current origin/v4.9.3 revision in submodule path 'lib/openzeppelin-contracts' fatal: Needed a single revision fatal: Unable to find current origin/v0.3.1 revision in submodule path 'lib/erc6551'
The text was updated successfully, but these errors were encountered: