Solved bash 5.1.4_1 error: "cc: error: no such file or directory: 'yes'"

Very confusing error while compiling shells/bash version 5.1.4_1.

Code:
...
rm -f mkbuiltins.o                                                                                       
cc -c  -DHAVE_CONFIG_H -DSHELL   -I. -I..  -I.. -I../include -I../lib -I.  -DHEREDOC_PIPESIZE=4096 yes -DDEFAULT_PATH_VALUE='"/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"'  -DSTANDARD_UTILS_PATH='"/sbin:/bin:/usr/sbin:/usr/bin"' -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing mkbuiltins.c
cc: error: no such file or directory: 'yes'                                                             
*** Error code 1

mkbuiltins.c appears in /usr/ports/shells/bash/work/bash-5.1/mkbuiltins
'yes' is available as /usr/bin/yes.
No other builds via portmaster -a appear to be effected.
Compiling "normally" via make produces the same error.
Replacing the ports tree via rm -rf /usr/ports/* /var/db/portsnap/* && portsnap fetch extract does not fix.
I can find nothing in /usr/ports/UPDATING that appears to address this.

I'm guessing this is coming from an include? Is there a way to expand the cc command to at least see which file is throwing the error?
 
It seems like the expansion of the macro was not done properly:

Code:
-DHEREDOC_PIPESIZE=4096 yes
"yes" string is the actual input file for cc.

I was able to compile this version though ( Makefile # $FreeBSD: head/shells/bash/Makefile 560707 2021-01-07 13:22:20Z bapt $ )
 
Did you enable or disable one of the options? It builds fine with the default options, so it might be caused by an option you enabled or disabled.
 
It seems like the expansion of the macro was not done properly:

Code:
-DHEREDOC_PIPESIZE=4096 yes
"yes" string is the actual input file for cc.

I was able to compile this version though ( Makefile # $FreeBSD: head/shells/bash/Makefile 560707 2021-01-07 13:22:20Z bapt $ )
Yah, I can compile it fine on other computers too... [sigh]
And I have the same version of shells/bash/Makefile

per SirDice, I also removed my /etc/make.conf (lot's of old knobs in there, but nothing that seems relevant) and /var/db/ports/shells_bash/options (which had NLS and DOCS disabled, and added SYSLOG and FDESCFS); so recompiling with all defaults. And it still fails:

Code:
===>  Building for bash-5.1.4_1
bison -y -d ./parse.y
touch parser-built
rm -f mkbuiltins.o
cc -c  -DHAVE_CONFIG_H -DSHELL   -I. -I..  -I.. -I../include -I../lib -I.  -DHEREDOC_PIPESIZE=4096 yes -DDEFAULT_PATH_VALUE='"/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"'  -DSTANDARD_UTILS_PATH='"/sbin:/bin:/usr/sbin:/usr/bin"' -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing mkbuiltins.c
cc: error: no such file or directory: 'yes'
*** [mkbuiltins.o] Error code 1

If I attempt the same compilation on a different machine (also 12.2), I get different output from make:

Code:
===>  Building for bash-5.1.4_1
--- y.tab.c ---
--- ./builtins/builtext.h ---
--- y.tab.c ---
bison -y -d ./parse.y
--- ./builtins/builtext.h ---
--- mkbuiltins.o ---
rm -f mkbuiltins.o
cc -c  -DHAVE_CONFIG_H -DSHELL   -I. -I..  -I.. -I../include -I../lib -I.  -DHEREDOC_PIPESIZE=4096  -DDEFAULT_PATH_VALUE='"/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"'  -DSTANDARD_UTILS_PATH='"/sbin:/bin:/usr/sbin:/usr/bin"' -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing mkbuiltins.c

The broken version is missing all the '---' decoration and it has add 'yes' in the cc command.
Both appear to be using the same version of make (composed a simply Makefile to echo
Code:
$(MAKE_VERSION)
and they both return '20200710').
 
When in shells/bash and you do make clean && make build what does your work/bash-5.1/builtins/Makefile say about LOCAL_CFLAGS ?

By any chance don't you have something set in your user profile that could affect this ? Like CFLAGS, DEBUG ..
 
That's it!
Thank you.

Code:
** root@olivia ** ~/tmp ** Wed Feb 17 09:19:28
# grep LOCAL_CFLAGS /usr/ports/shells/bash/work/bash-5.1/builtins/Makefile
LOCAL_CFLAGS = -DHEREDOC_PIPESIZE=4096 ${DEBUG}
         ${INCLUDES} $(LOCAL_CFLAGS)
 ** root@olivia ** ~/tmp ** Wed Feb 17 09:19:53
# printenv | grep DEBUG
DEBUG=yes
 
Back
Top