diff --git a/Brewfile b/Brewfile index c22487e041..953b28a583 100644 --- a/Brewfile +++ b/Brewfile @@ -8,6 +8,7 @@ # changing it automatically invalidates the cache. brew "autoconf" +brew "bison" brew "coreutils" brew "gnu-tar" brew "libuv" diff --git a/configure b/configure index 4a94419960..dfd062ad9f 100755 --- a/configure +++ b/configure @@ -912,6 +912,7 @@ echo_n sort RAGEL yacc +yacc_prog YFLAGS YACC lex @@ -3163,8 +3164,8 @@ ac_cxx_conftest_cxx11_main=' } { // Unicode literals - auto const *utf8 = u8"UTF-8 string \u2500"; - char16_t const *utf16 = u"UTF-16 string \u2500"; + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } ' @@ -6342,16 +6343,86 @@ fi done test -n "$YACC" || YACC="yacc" -yacc=`$echo $YACC | awk '{print $1}'` -yacc=`$which "$yacc"` -if test ! -x "$yacc"; then +yacc_prog=`$echo $YACC | awk '{print $1}'` +if test "$yacc_prog" = bison +then + case "$host_os" + in + darwin*) + bison_extra_path= + brew_bison=`brew --prefix bison 2>/dev/null`/bin + test -d "$brew_bison" && bison_extra_path="$brew_bison$PATH_SEPARATOR" + for ac_prog in bison +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_yacc_prog+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $yacc_prog in + [\\/]* | ?:[\\/]*) + ac_cv_path_yacc_prog="$yacc_prog" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $bison_extra_path$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_yacc_prog="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +yacc_prog=$ac_cv_path_yacc_prog +if test -n "$yacc_prog"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $yacc_prog" >&5 +printf "%s\n" "$yacc_prog" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$yacc_prog" && break +done +test -n "$yacc_prog" || yacc_prog="no" + + ;; + *) + yacc_prog=`$which "$yacc_prog"` + esac +else + yacc_prog=`$which "$yacc_prog"` +fi + +if test ! -x "$yacc_prog"; then as_fn_error $? "cannot find a valid 'yacc'/'bison' command." "$LINENO" 5 fi -yacc=`echo $YACC | sed -e '/^bison /{ -s/$/ / -s/ -y / / -s/ $// -}'` +yacc=`echo $YACC | $AWK ' + { printf "'"$yacc_prog"'" + for (i = 2; i <= NF; i++) { + if ($1 == "bison" && $i == "-y") continue + printf " %s", $i + } + printf "\n" + }'` for ac_prog in ragel diff --git a/configure.ac b/configure.ac index 365b24daa0..9c301161c4 100644 --- a/configure.ac +++ b/configure.ac @@ -746,17 +746,40 @@ lex=$LEX AC_SUBST(lex) AC_PROG_YACC -yacc=`$echo $YACC | awk '{print $1}'` -yacc=`$which "$yacc"` -if test ! -x "$yacc"; then +yacc_prog=`$echo $YACC | awk '{print $1}'` +if test "$yacc_prog" = bison +then + case "$host_os" + in + darwin*) + dnl want homebrew bison, but it is keg-only (so bin dir is + dnl "hidden" and bison-specific) ... because libpcp will not + dnl compile with the bison v2.3 from macOS default install + bison_extra_path= + brew_bison=`brew --prefix bison 2>/dev/null`/bin + test -d "$brew_bison" && bison_extra_path="$brew_bison$PATH_SEPARATOR" + AC_PATH_PROGS([yacc_prog], [bison], [no], [$bison_extra_path$PATH]) + ;; + *) + yacc_prog=`$which "$yacc_prog"` + esac +else + yacc_prog=`$which "$yacc_prog"` +fi + +if test ! -x "$yacc_prog"; then AC_MSG_ERROR([cannot find a valid 'yacc'/'bison' command.]) fi -dnl if this is bison, don't use the -y option -yacc=`echo $YACC | sed -e '/^bison /{ -s/$/ / -s/ -y / / -s/ $// -}'` +dnl append any command line options from $YACC, but if this is bison +dnl do not use the -y (yacc) option +yacc=`echo $YACC | $AWK ' + { printf "'"$yacc_prog"'" + for (i = 2; i <= NF; i++) { + if ($1 == "bison" && $i == "-y") continue + printf " %s", $i + } + printf "\n" + }'` AC_SUBST(yacc) AC_CHECK_PROGS(RAGEL, ragel, []) diff --git a/qa/admin/package-lists/Darwin+25+arm64 b/qa/admin/package-lists/Darwin+25+arm64 index 8f8186b5f9..98a87df9ca 100644 --- a/qa/admin/package-lists/Darwin+25+arm64 +++ b/qa/admin/package-lists/Darwin+25+arm64 @@ -13,6 +13,8 @@ YAML::XS cpan # brew formula or casks for building and git activity and QA # autoconf brew +bison brew +cmocka brew coreutils brew docker brew gawk brew @@ -20,7 +22,6 @@ gdb brew # github is kinda strange ... it is brew-installed but not reported # by brew formulae nor brew casks # github brew -cmocka brew hub brew libvirt brew libuv brew diff --git a/qa/admin/pcp-daily b/qa/admin/pcp-daily index c5c4ffd737..c65203a396 100755 --- a/qa/admin/pcp-daily +++ b/qa/admin/pcp-daily @@ -1224,18 +1224,21 @@ End-of-File scp $qa_user@$host:daily.harvest $tmp.harvest >$tmp.out 2>&1 if [ -s $tmp.harvest ] then + pfx='' for file in `cat $tmp.harvest` do - echo -n " $file" + printf '%s' "$pfx$file" + pfx=' ' if scp $qa_user@$host:$qa_dir/$file $HOME/Logs/by-vm/$host/qa >$tmp.err 2>&1 then : else - echo + printf '\n' cat $tmp.err + pfx='' fi done - echo + [ "$pfx" = ' ' ] && printf '\n' elif [ -s $tmp.out ] then echo "scp error ..." diff --git a/src/pmcd/rc_pmcd b/src/pmcd/rc_pmcd index d3300442e5..1675c18ecb 100644 --- a/src/pmcd/rc_pmcd +++ b/src/pmcd/rc_pmcd @@ -173,15 +173,58 @@ _pmda_setup() { # Auto-Install and/or Auto-Remove PMDAs? # + __try=10 + while [ -f $PCP_PMDAS_DIR/pmda.auto.update ] + do + # lock file exists, if it is stale, remove it ... a concurrent + # rc_pmcd could remove it while we're checking, so silently ignore + # failure to remove the lock file + # + __pid=`$PCP_AWK_PROG <$PCP_PMDAS_DIR/pmda.auto.update 2>/dev/null '{ print $1 }'` + __pname=`$PCP_AWK_PROG <$PCP_PMDAS_DIR/pmda.auto.update 2>/dev/null '{ print $2 }'` + if [ -z "$__pname" -o -z "$__pid" ] + then + # possible race on startup ... the lock file may be empty + # so wait a while, but don't wait forever + # + if [ $__try -gt 0 ] + then + __try=`expr $__try - 1` + sleep 1 + continue + else + if rm $PCP_PMDAS_DIR/pmda.auto.update >/dev/null 2>&1 + then + $PCP_BINADM_DIR/pmpost "PMDA setup: pid=$$ stale pmda.auto.update lock removed, empty and not changing after 10secs" + fi + fi + fi + if [ "$__pname" != rc_pmcd ] + then + if rm $PCP_PMDAS_DIR/pmda.auto.update >/dev/null 2>&1 + then + $PCP_BINADM_DIR/pmpost "PMDA setup: pid=$$ stale pmda.auto.update lock removed, bogus owner ($__pname) not rc_pmcd" + fi + elif [ -n "$__pid" ] + then + if ! $PCP_PS_PROG -p "$__pid" >/dev/null 2>&1 + then + if rm $PCP_PMDAS_DIR/pmda.auto.update >/dev/null 2>&1 + then + $PCP_BINADM_DIR/pmpost "PMDA setup: pid=$$ stale pmda.auto.update lock removed, owner process (pid=$__pid) has vanished" + fi + fi + fi + done if $PCP_BINADM_DIR/pmlock -i "$$ rc_pmcd" $PCP_PMDAS_DIR/pmda.auto.update then # we got the lock, proceed - $PCP_BINADM_DIR/pmpost "PMDA setup: pid=$$ acquire lock" + $PCP_BINADM_DIR/pmpost "PMDA setup: pid=$$ acquire pmda.auto.update lock" : else # one of us is already running # - $PCP_BINADM_DIR/pmpost "PMDA setup: pid=$$ lock failed" + $PCP_BINADM_DIR/pmpost "PMDA setup: pid=$$ pmda.auto.update lock failed: `ls -l $PCP_PMDAS_DIR/pmda.auto.update`" return fi @@ -199,7 +242,7 @@ _pmda_setup() fi rm -f $PCP_PMDAS_DIR/pmda.auto.update - $PCP_BINADM_DIR/pmpost "PMDA setup: pid=$$ release lock" + $PCP_BINADM_DIR/pmpost "PMDA setup: pid=$$ release pmda.auto.update lock" # re-instate mainline trap #