Skip to content
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

fix: Allow detect_missing_libraries only while building #803

Closed
wants to merge 12 commits into from

Conversation

MBerguer
Copy link
Contributor

@MBerguer MBerguer commented Jan 3, 2025

What 💻

The purpose of this PR is to remove the possibility of using the detect_missing_libraries from the config toml file because it does not make sense to have it there. This flag works by showing a list of missing libraries. It does not output any bytecode, but there are some other scenarios where this could happen, so the best way to fix it is to remove this from all the commands (script, test, create), which is the same as disabling it by default in all places and enabling it only for the build.

Why ✋

We were experiencing issues with this flag (#710) because it was enabled for all the available subcommands.
And the error we were getting down the line was nearly understandable. Now, the user will still get the problem eventually, but if he looks above in the stack trace, there will be a message explaining why this happened, so he can change the config file and continue.

Evidence 📷

image

Notes 📝

  • Foundry book has to be updated to reflect this change.

@MBerguer MBerguer requested a review from a team as a code owner January 3, 2025 02:47
The purpouse of this PR is to remove the possiblitityto use the detect_missing_libraries from the config toml file, because it does not makes sense to havie it there.
The way this flags works, is to show a list of libraries that are missing, and it does not output any bytecode, but there some other scenarios where this could happen, so the best way to fix it is to remove this from all the commands (script, test, create) which is the same as disable it by default in all places and enabling it only for the build.
finally, if there is someone still using this flag in the config, we show a warning mentioning that this is not the way to go.

fix
@MBerguer MBerguer force-pushed the tincho/detect-missing-libraries branch from 02d9b9c to 4667606 Compare January 3, 2025 02:48
Copy link
Contributor

@elfedy elfedy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo if we are removing the option from everything but build, we should remove it from shared config and only keep the build flag

crates/cli/src/opts/build/zksync.rs Outdated Show resolved Hide resolved
crates/cli/src/opts/build/zksync.rs Outdated Show resolved Hide resolved
crates/forge/bin/cmd/build.rs Outdated Show resolved Hide resolved
crates/cli/src/opts/build/zksync.rs Outdated Show resolved Hide resolved
crates/forge/bin/cmd/build.rs Outdated Show resolved Hide resolved
crates/forge/bin/cmd/build.rs Outdated Show resolved Hide resolved
- Removing the warning for all the commands besides build
- Cleaning up the three tests
zk_detect_missing_libraries since we have this naming convention
@MBerguer MBerguer changed the title Allow detect_missing_libraries only while building fix: Allow detect_missing_libraries only while building Jan 6, 2025
Jrigada and others added 5 commits January 6, 2025 17:54
Rename it back so the compiler understand
fixing the test to assert for the missing library
@MBerguer
Copy link
Contributor Author

MBerguer commented Jan 8, 2025

Closing this in favor of #821.
See #722 for more details.

@MBerguer MBerguer closed this Jan 8, 2025
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.

3 participants