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

cargo flamegraph should set cargo environment variables #244

Open
kuviman opened this issue Nov 22, 2022 · 3 comments
Open

cargo flamegraph should set cargo environment variables #244

kuviman opened this issue Nov 22, 2022 · 3 comments

Comments

@kuviman
Copy link

kuviman commented Nov 22, 2022

When using cargo run normally, cargo sets environment variables that can be detected from the binary

https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates

Would be nice if running via cargo flamegraph would do same

@djc
Copy link
Contributor

djc commented Nov 28, 2022

Sure, would you be able to submit a PR?

@kuviman
Copy link
Author

kuviman commented Nov 29, 2022

I probably would be able, yes

I was wondering though if this is actually wanted. I dont know if people are using those variables from the binary and not during compilation, my use case might be too specific and i can easily work without this

@djc
Copy link
Contributor

djc commented Nov 29, 2022

Yeah, I do think those variables are mainly intended for compilation time. Since flamegraph doesn't try to compile (it only reuses the Cargo metadata to find compilation targets IIRC), I don't think it would really apply here?

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

No branches or pull requests

2 participants