Current-Users archive

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

Re: 'build.sh release' failure with MAKEVERBOSE=4



OK, with lots of invaluable help from Robert Elz, I think we've narrowed down the problem. It seems that, when MAKEVERBOSE has been set to a value of 3 or higher, the shell function arch_to_cpu() in file src/distrib/sets/sets.subr is being invoked with MAKEFLAGS set to -dl (or -dx). arch_to_cpu() invokes ${MAKE}, resulting in echoing of the command

	@echo \${MACHINE_CPU}

before executing the command. Thus, the work "echo" sneaks into the output, which then gets used in the list_set_files()'s awk script.

The attached patch seems to confirm that this is where the problem arises, by modifying arch_to_cpu() to explicitly unset MAKEFLAGS and MAKEVERBOSE settings before invoking ${MAKE}.

The patch is probably not the right way to fix this problem, but a "real" fix is far beyond my knowledge. Hopefully someone who really understands the intricacies of the build system can come up with a proper solution.



On Thu, 21 Apr 2016, Paul Goyette wrote:

Based on examination of the code in src/distrib/sets/sets.subr it looks like there should be no difference with MAKEVERBOSE=3 or =4.

And indeed, I have confirmed that the same failure occurs, at the same point, with MAKEVERBOSE=3

In sets.subr around line 286 (shell function list_set_files()) we query $MAKEVERBOSE and set shell variable verbose to either true or false.

verbose is not used anywhere else directly within list_set_files() but it is available to other functions which can get called, such as print_set_lists() function where it is used to control execution of the
code

			if $verbose; then
				echo >&2 "DEBUG: list_set_files: $l"
			fi

It's not obvious to me why this is causing a problem, but it is ...


On Wed, 20 Apr 2016, Paul Goyette wrote:

As reported earlier, this command does indeed fail, in the 'create sets lists" step. The actual error is listed below; a complete log for th 'create sets list' step is contained in the attachment.

<snip>
+ echo 'x86_64'
DEBUG: list_set_files: ./lists/base/mi
DEBUG: list_set_files: ./lists/base/md.amd64
DEBUG: list_set_files: ./lists/base/shl.mi
DEBUG: list_set_files: ./lists/base/module.mi
DEBUG: list_set_files: ./lists/base/rescue.mi
/build/netbsd-local/tools/x86_64/amd64/bin/nbawk: non-terminated string echo x86
_6... at source line 70
context is
wanted["machine_cpu=" "echo x86_64

<<<
xargs: /build/netbsd-local/tools/x86_64/amd64/bin/nbsed terminated by SIGPIPE
makeflist output is empty for base
+ exit 1


Perhaps a missing quote somewhere?


+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+

+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+


+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+
Index: sets.subr
===================================================================
RCS file: /cvsroot/src/distrib/sets/sets.subr,v
retrieving revision 1.174
diff -u -p -r1.174 sets.subr
--- sets.subr	21 Feb 2016 04:16:36 -0000	1.174
+++ sets.subr	21 Apr 2016 08:21:30 -0000
@@ -648,6 +648,11 @@ print_set_lists()
 #
 arch_to_cpu()
 {
+	# set +x	# unfortunately, if this is needed, it won't help!
+	unset MAKEVERBOSE
+	unset MAKEFLAGS
+	exec 2> /dev/null	# just in case
+
 	MACHINE_ARCH=${1} ${MAKE} -B -f- all <<EOMAKE
 .include <bsd.own.mk>
 all:


Home | Main Index | Thread Index | Old Index