-
Notifications
You must be signed in to change notification settings - Fork 5
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
MF_NON_INTERACTIVE does not seem to work at all #77
Comments
Based on our discussion this morning it seems like our logic might be lacking there. Here are some example expression that checks both xxx:
[[ -t 0 && -t 1 ]] && echo YES Both TTYs: $ make
[[ -t 0 && -t 1 ]] && echo YES
YES
$ echo foo | make
[[ -t 0 && -t 1 ]] && echo YES
make: *** [xxx] Error 1
$ make | cat
[[ -t 0 && -t 1 ]] && echo YES
make: *** [xxx] Error 1 It might be the case that performing this test directly in the recipe like this behaves differently to the way another sub-shell would detect it's
|
Yeah, I think that was part of it too. We do the detection inside a |
Confirmed that RESULT := $(shell [[ -t 0 && -t 1 ]] && echo interactive || echo non-interactive)
test:
@echo Direct:
@[[ -t 0 && -t 1 ]] && echo interactive || echo non-interactive
@echo Shell call:
@echo $(RESULT) I get the following results: $ make # both TTYs
Direct:
interactive
Shell call:
non-interactive
$ echo | make # STDIN not a TTY
Direct:
non-interactive
Shell call:
non-interactive
$ make | cat # STDOUT not a TTY
Direct:
non-interactive
Shell call:
non-interactive |
Currently we manually set
MF_NON_INTERACTIVE
totrue
under CI, and try to detect it otherwise. But I'm pretty sure the detection is not working at all. After looking into it, I'm not even sure it's possible to detect an interactive shell undermake
. None of the suggestions I have seen hold up to actual testing (e.g. https://stackoverflow.com/questions/4251559/how-can-i-tell-if-a-makefile-is-being-run-from-an-interactive-shell).Unless @jmalloc you have any ideas about how to actually detect non-interactivity under
make
, perhaps we should either:The following Makefile:
Gives the following output under various interactive and non-interactive circumstances:
The text was updated successfully, but these errors were encountered: