You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when I use rust-script in a shebang line, the first execution of the script hangs for quite a while as all the dependencies are being compiled. This is fine for me personally, since I know what it's doing, but I worry that if I shipped a script like that to other users they might think it was broken and Ctrl-C it or similar. Is there an option to tell rust-script to print something to stderr (or just un-suppress Cargo output) when it needs to build?
The text was updated successfully, but these errors were encountered:
Ah I totally missed that. Looks like #! /usr/bin/env -S rust-script -o does the trick. My problem with that solution is that it always prints Cargo output. So for example, subsequent runs of my scripts look something like:
Finished release [optimized] target(s) in 0.01s
Running `/home/jacko/.cache/rust-script/binaries/release/test_74853f43f948f18a031eff82`
some output
Would it be possible to tell from the hash of the script itself that it doesn't need to be rebuilt, and avoid output (and possibly avoid invoking Cargo entirely) in this case? I realize that this might be a substantially larger change than this issue was originally asking about.
Would it be possible to tell from the hash of the script itself that it doesn't need to be rebuilt, and avoid output (and possibly avoid invoking Cargo entirely) in this case? I realize that this might be a substantially larger change than this issue was originally asking about.
Version 0.23.0 has just been released, and does it just as described above! Thanks for the feedback.
Also, note that the short option for --cargo-output has been changed from -o to -c.
Currently when I use
rust-script
in a shebang line, the first execution of the script hangs for quite a while as all the dependencies are being compiled. This is fine for me personally, since I know what it's doing, but I worry that if I shipped a script like that to other users they might think it was broken and Ctrl-C it or similar. Is there an option to tellrust-script
to print something to stderr (or just un-suppress Cargo output) when it needs to build?The text was updated successfully, but these errors were encountered: