rust-reduce icon indicating copy to clipboard operation
rust-reduce copied to clipboard

Improve invocation

Open gilescope opened this issue 6 years ago • 4 comments

Any objections to a PR that walkdir to find .rs files in a crate's subdirs and then reduces them?

Looking to use this as a way to reduce an ICE found in rustc to a minimal reproduction.

gilescope avatar Jul 12 '19 08:07 gilescope

I think I've misunderstood. I see there's a parse_and_inline_modules. If I point it to main.rs or lib.rs it should drag everything else in. Will try that.

gilescope avatar Jul 12 '19 08:07 gilescope

That works, though a little fiddly the copy pasting of rustc command line and adding in the $1 arg. It would be even better if we could package it as cargo-reduce and then one could type cargo reduce "regex expression" and it would run cargo check repeatedly in place.

That would make it childs play to run. One could still provide an arg for a shell script to run if people wanted to run more than cargo check/regex.

gilescope avatar Jul 16 '19 18:07 gilescope

(Easy setup is important as when the test1.sh isn't quite pointing to the right file it deletes everything).

gilescope avatar Jul 16 '19 18:07 gilescope

I think you always need some kind of shell script as you need to somehow determine whether a particular compiler run is "interesting" or not. Inserting a shell script means the user can write arbitrary an arbitrary script to determine interestingness.

I'm open to ideas on this.

jethrogb avatar Dec 20 '19 12:12 jethrogb