Bash 5.2 SHLVL change and autoconf test failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(Sorry for cross posting, but the topic is related to both side)

In Bash-5.2 there is a change:

"ff. Some fixes to how subshells modify $SHLVL."

This causes 134 test failures in autoconf.  They look like:

--- /dev/null   2022-09-29 10:39:11.882612713 +0800
+++ /home/xry111/sources/lfs/autoconf-2.71/tests/testsuite.dir/at-groups/593/stdout 2022-09-29 10:51:36.266029106 +0800
@@ -0,0 +1,11 @@
+--- at_config_vars-state-env.c-native-r1   2022-09-29 10:51:36.262029189 +0800
++++ at_config_vars-state-env.cxx-native-r1 2022-09-29 10:51:36.265029127 +0800
+@@ -62,7 +62,7 @@
+ SESSION_MANAGER=local/xry111-x57s1:@/tmp/.ICE-unix/761,unix/xry111-x57s1:/tmp/.ICE-unix/761 
+ SHELL=/bin/sh
+ SHELLOPTS=braceexpand:hashall:interactive-comments:posix
+-SHLVL=2
++SHLVL=3
+ SSH_AUTH_SOCK=/run/user/1000/keyring/ssh

While I think this is some innocent difference (it's unlikely a
package's building system can depend on $SHLVL), and we can simply "fix"
(or "paper over") it with

--- autoconf-2.71.orig/tests/local.at	2021-01-29 04:46:48.000000000 +0800
+++ autoconf-2.71/tests/local.at	2022-09-29 11:22:18.612388352 +0800
@@ -403,7 +403,7 @@
       [GREP|[EF]GREP|SED],
       [[_@]|.[*@%:@?$].],
       [argv|ARGC|LINENO|BASH_ARGC|BASH_ARGV|OLDPWD|PIPESTATUS|RANDOM],
-      [SECONDS|START_TIME|ToD|_AST_FEATURES]))=' \
+      [SECONDS|SHLVL|START_TIME|ToD|_AST_FEATURES]))=' \
      $act_file ||
        test $? -eq 1 || echo failed >&2
     ) 2>stderr-$act_file |
@@ -488,6 +488,7 @@
 	/^ARGC=/ d
 	/^BASH_ARGC=/ d
 	/^BASH_ARGV=/ d
+	/^SHLVL=/ d
 	/^LINENO=/ d
 	/^_AST_FEATURES=/ d
 m4_map_args_w([$3], [_AT_CONFIG_CMP_PRUNE(], [)])dnl

But I'd like to request some details about the SHLVL change from bash to
understand the test failures better and maybe fix them in a better way.
-- 
Xi Ruoyao <xry111@xxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University





[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux