Kobzol / cargo-pgo

Cargo subcommand for optimizing Rust binaries/libraries with PGO and BOLT.
MIT License
573 stars 11 forks source link

v0.2.7 `cargo pgo run` adds '--config' argument wrongly #53

Closed hatoo closed 8 months ago

hatoo commented 8 months ago

In my project, I use cargo pgo like this

cargo pgo run -- --profile pgo -- -z 3m -c 900 --no-tui http://localhost:8888

...

Running `target/x86_64-unknown-linux-gnu/pgo/oha -z 3s -c 900 --no-tui 'http://localhost:8888' --config 'build.rustflags=['\\''-Cprofile-generate=/home/hatoo/oha/target/pgo-profiles'\\''] # <- errors

It had run without issue in v0.2.6 but fails in v0.2.7 due to --config argument

Kobzol commented 8 months ago

Hi, thanks for reporting! Is this on Linux? It's weird that in tests the config parameter worked fine. I will try to take a look ASAP, in the meantime you can try RUSTFLAGS="" cargo pgo ... as a hotfix.

hatoo commented 8 months ago

I've observed on Linux and arm mac.

You can see more log in my GitHub action log https://github.com/hatoo/oha-release-test/actions/runs/8518075678/job/23329605348 https://github.com/hatoo/oha-release-test/tree/1.4.5

No rush, because I can use v0.2.6.

Kobzol commented 8 months ago

Ooh, I see, we're passing the arguments to the final binary, instead to cargo.

Kobzol commented 8 months ago

Please try if this version works for you:

$ cargo install --git https://github.com/kobzol/cargo-pgo --branch fix-config-args
hatoo commented 8 months ago

Thank you, it works

Kobzol commented 8 months ago

Thank you for confirming.

Kobzol commented 8 months ago

Published v0.2.8 with the fix.