[ipxe-devel] [PATCH] [build] Make it deterministic when building from git.

Denis 'GNUtoo' Carikli GNUtoo at no-log.org
Wed Oct 5 14:33:50 UTC 2016


Hi,

I'm sorry for the late response, and awkward reply style: I subscribed
after having got response to the patch, so I didn't have the
reference-id of the mail to respond to.

I'll respond to the comment nevertheless.

On Sat, 10 Sep 2016 23:03:40 +0200
Denis 'GNUtoo' Carikli <GNUtoo at no-log.org> wrote:
>  $(BIN)/%.tmp : $(BIN)/version.%.o $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
[...]
> +		--defsym _build_id=0x`cat $? | sha1sum | cut -c-8` \

Using $? is indeed a mistake:
According to GNU make manual[1], "The names of all the prerequisites
that are newer than the target, with spaces between them. For
prerequisites which are archive members, only the named member is used
(see Archives)."

This will create issues when some of the prerequisites have already
been build.

Using $^ fixes it. I will resend a patch with $^ instead.

I've also tested if $^ is affected by concurrency and it doesn't seem
to.

I've attached the test case, and here's the output on my machine with
GNU Make 4.2.1:
% ./test.sh -j 9999
out reference differ: byte 14, line 3
Inversion(s) happened
OK

References:
-----------
[1]https://www.gnu.org/software/make/manual/make.html#Automatic-Variables

Denis.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 2316 bytes
Desc: not available
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20161005/4cfb9850/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reference
Type: application/octet-stream
Size: 1184 bytes
Desc: not available
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20161005/4cfb9850/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.sh
Type: application/x-shellscript
Size: 253 bytes
Desc: not available
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20161005/4cfb9850/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20161005/4cfb9850/attachment.sig>


More information about the ipxe-devel mailing list