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

add PROGENITOR_DEBUG=<PATH> environment variable to output macros to files #760

Open
ahl opened this issue Apr 3, 2024 · 5 comments
Open

Comments

@ahl
Copy link
Collaborator

ahl commented Apr 3, 2024

Sometimes users want to see the code the generate_api! macro produces. cargo-expand works, but it expands a lot of stuff. I think it would be useful to have an environment variable one could set that would result in the macro output landing in some file to examine after the build.

@ahl ahl added the help wanted label Apr 3, 2024
@jclulow
Copy link
Collaborator

jclulow commented Apr 3, 2024

Could it just always emit the files, into some place under target/? Or, at least, always emit them if some option is passed to generate_api!()?

@ahl
Copy link
Collaborator Author

ahl commented Apr 3, 2024

It could always mine bitcoin for 100ms while no one was looking! it's just software!

@andrewjstone
Copy link

+1 for just always writing them out, and possibly issuing a build log about where to find them to the console.

@ahl
Copy link
Collaborator Author

ahl commented Apr 4, 2024

I think build times may be slow enough already, but I'll think about it

@drahnr
Copy link
Contributor

drahnr commented Jun 7, 2024

I faced the same issue in #418 ( https://github.com/oxidecomputer/progenitor/pull/418/files#diff-249400e9b67720670451815acee092c499e96d31a9beefcc5cc63a6443d8bc5aR285-R296 in particular ) using https://github.com/drahnr/expander to expand a single TokenStream to file for the sake of debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants