-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
./x.py build --on-fail=/bin/bash has no effect #47645
Comments
I can reproduce, but so far have not been able to determine the cause. |
It appears as if cargo(?) has been changed recently to:
thus breaking the hack that this feature was relying on to work. |
Not sure if we want to fix this feature or just reduce it to a plain |
I would prefer that we fix this feature... but that seems somewhat complicated, based on your conclusions. I'd be okay with |
If I may wish for something, that would be for an easy and convenient way to debug ICE's like #43982. I would not necessarily need to be dropped to a shell when something fails -- capturing the debug output of rustc would be a much better option for me. |
Triage: the issue still persists. |
triage: the behavior here has changed recently: #!/bin/sh
// stdin_empty.sh
use_real_rustc=0
for flag in "$@"; do
case $flag in
-v*|--print=file-names)
use_real_rustc=1;
break
;;
*) ;;
esac
done
if [ $use_real_rustc = 1 ]; then
exec rustc +$RUSTUP_TOOLCHAIN "$@"
fi
timeout .1 bash -c 'read -r x'
status=$?
if [ $status = 124 ]; then
# stdin not closed (we timed out)
exit 0
else
# stdin closed
exit 1
fi
I tried --on-fail=bash with #98673, but it behaves very strangely:
I think cargo has done something to the terminal that breaks stdout from bash (maybe buffered output or something like that?). But this is definitely closer than in the previous release :) |
ok, this does work on beta: $ cat interactive.sh
#!/bin/sh
/usr/bin/env bash --norc --noprofile -i "$@" </dev/tty >/dev/tty
$ x check --on-fail=$(realpath ./interactive.sh) I'll see if I can find some way to make this less painful for people who don't want to mess with /dev/tty, etc. |
Trying to look into #43982, I was running
./x.py build --jobs=4 --on-fail=/bin/bash
. Once I hit the ICE, the build exited without dropping me to a shell as I had expected. @nagisa wanted to try and repro this.re-uploaded build log as a gist:
https://gist.github.com/Mark-Simulacrum/f660624e0195d733da752649a6cf7538
The text was updated successfully, but these errors were encountered: