Skip to content

Adding a prefix to Command args in fork() #18

@itamarst

Description

@itamarst

I would like to use the fork() API to run test code under Valgrind (in order to get CPU instruction counts, to be used in https://docs.rs/bigoish). So target/test/mytest or whatever it is should become valgrind --tool=callgrind target/test/mytest etc..

So this requires adding args to the start, rather than the end.

The current API almost allows this, but the process_modifier() gets called after the Command is constructed, so it's too late to add a prefix to command-line arguments. And e.g. making a new Command and replacing the passed in one with the new one doesn't work either because there's no way to access the temporary file so it's not possible to set it.

I'm not sure how to add this in backwards compatible way; if you have any ideas I might be able to do a PR. Or you can decide this is too niche/annoying to implement, and I will copy/paste the relevant code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions