-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Create a build.rs script for forc-client to auto update proxy abi from file to source code #6527
Comments
Yep, this is one of the first problems I ran into after starting at fuel. There is any issue for this in the fuels repo here From memory it is also one of the main blockers for why we don't support windows as we need relative paths to resolve in the abigen! macro. I'm not sure what the best approach here is still. Ideally we would could use the functionality for what Utilising a |
Exactly 💯 I really want to do this without build.rs as well :) I wonder if ordered macro expansions possible without changing rust compiler, because with that we would be able to use include str 🤔 |
Related #6427 |
Could we force the ordering by making |
If I'm reading this correctly, for file paths the evil way would be to inject a unique string into the source as a comment or attribute, then walk the filesystem looking for that unique string 🙃 |
We have an interesting problem,
abigen!
macro from sdk needs either a file location, or a raw abi string. Using file location fails becuase cargo flattens all packages before releasing them and changing the location we hold our abi file in. Using raw str is troublesome and error prone. We discussed usinginclude_str!
macro from std but then the problem is the order of macro expansions. We cannot ensure thatnclude_str!
is expanded beforeabigen!
.We can create a
build.rs
file that updates the contents of the proxy abi raw str embedded in the code to come to a middle ground, where we use raw str for abigen macro but do not need to update it manually.The text was updated successfully, but these errors were encountered: