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

Unknown keys in Forc.toml print the same warning for each compiled library #928

Closed
eureka-cpu opened this issue Mar 11, 2022 · 4 comments
Closed
Assignees
Labels
bug Something isn't working forc

Comments

@eureka-cpu
Copy link
Contributor

eureka-cpu commented Mar 11, 2022

Found while testing #918

adding an unused key [[foo]], as intended gets: WARNING! unused manifest key: foo, however I get that warning twice. Once at the beginning of the build, and once at the end before Compiled script "address_test". I think what's happening is that it's passing the warning for each library that gets compiled...

Edit: The issue may be that we're reading the manifest a second time in forc_build::BuildPlan which is causing the warning to appear twice.

@eureka-cpu
Copy link
Contributor Author

Ah this is likely due to Manifest::validate method getting called within the Manifest constructor, and the constructor getting called multiple times during a forc build. Ideally the Manifest should only be constructed once per package, but its convenient for some of the graph related code to construct it on demand. This would be easier to address with #885.

@eureka-cpu
Copy link
Contributor Author

#4709 is actually a duplicate of this issue and @gr00vytvniks is working on it I believe

@kayagokalp
Copy link
Member

kayagokalp commented Jul 25, 2023

#4709 and this one seems unrelated and i am not really sure if this is a problem. If the same issue is present in each library shouldn't we print that issue for each of them?

If you believe the same warning or error for the same package gets printed twice, then that is a problem but I believe from_file constructors (which prints these warnings) are called only once and then we are using a in-memory cache for reaching manifests (ManifestMap) basically it is done like that so that we do not do extensive I/O. If i am not mistaken this should not happen after #3368

@eureka-cpu
Copy link
Contributor Author

Figured this out with @kayagokalp it's no longer an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forc
Projects
None yet
Development

No branches or pull requests

2 participants