-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
bug: wagmi generate
with foundry plugin shuffles output, producing large diffs
#2528
Comments
Will take a look. Might be faster if you create a minimal example with only the code required to reproduce. |
Thanks! I can if necessary, but try the steps to reproduce above first--lmk if you run into any issues. |
@tmm can I work on this issue ? |
@Iamshankhadeep go for it! |
PR looks good, doesn't address the header diff but that's trivial to deal with using |
i can confirm we see the same thing happening in two different locals with identical environments: |
Would also like an option to disable the header - there's no need to check in a new timestamp. |
Yeah I think this is a reasonable use-case too. Usually people say not to check in "build outputs". But that assumes wagmi is another thing to add to the dev/watch/build/publish pipeline, and it's easier to just check it into GitHub. I wrote up the proposal here: |
Seeing this issue againLocal
In CI
Reordering, but only on specific OSs?
Steps to reproduce: Clone https://github.com/daimo-eth/daimo
...this should produce no diff on Mac and a large diff on Linux. See otherwise identical versions above ^ |
This issue has been locked since it has been closed for more than 14 days. If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion. |
Is there an existing issue for this?
Package Version
1.1.0
Current Behavior
Running
wagmi generate
outputs contracts in seemingly random order each time it's run.Expected Behavior
Running
wagmi generate
twice on identical inputs should, ideally, generate identical outputs.This has two main benefits:
Steps To Reproduce
To reproduce easily
This runs
wagmi generate
. Finally, runThis shows a big diff. The input contracts have not changed. Output
gen/contracts.ts
is functionally identical but reordered.Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
https://github.com/daimo-eth/daimo/tree/603a172eb9f902b11446f8d0721956cb338cd47a
Anything else?
This might be fixable by sorting the ABI items by name, internally, before generating output.
Finally, I recommend removing the date from the header line
at which point identical inputs = identical generated outputs.
The text was updated successfully, but these errors were encountered: