I’ve noticed a log of sanity test failures related to devel/binutils lately. Every single commit.
Issue 133 deals with that. Here, I plan to document what happened.
FreshPorts has, since inception, worked off the commit emails. The incoming email is parsed and XML created. The XML is then used to update the database.
I started looking in the message archives. I confirmed that the original email indicated deletes were occurring.
Yet, the XML had no deletes:
[dan@dev-ingress01:/var/db/freshports/message-queues/archive/2019_11/2019_11_15] $ cat 2019.11.15.10.09.16.85661.txt.xml <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE UPDATES PUBLIC "-//FreshPorts//DTD FreshPorts 2.0//EN" "https://www.freshports.org/docs/fp-updates.dtd"> <UPDATES Version="1.3.2.1"> <UPDATE> <DATE Month="11" Day="15" Year="2019"></DATE> <TIME Timezone="UTC" Minute="9" Second="3" Hour="10"></TIME> <OS Repo="ports" Branch="head" Id="FreeBSD"></OS> <LOG>Update binutils to 2.33.1 While here, convert binutils into flavors, that ease a lot maintenance and helps cleaning out the code. This is inspired by the same work on going on the xtoolchained gcc by jhb@ PR: 241756 Exp-run: antoine (portmgr) Discussed with: jhb Differential Revision: https://reviews.freebsd.org/D22258</LOG> <PEOPLE> <UPDATER Handle="bapt"></UPDATER> </PEOPLE> <MESSAGE Id="201911151009.xAFA9393081239@repo.freebsd.org" EncodingLosses="false" Subject="svn commit: r517642 - in head: . devel devel/aarch64-binutils devel/aarch64-none-elf-binutils devel/aarch64-none-elf-gcc devel/amd64-binutils devel/arduino-tools devel/arm-gnueabi-binutils devel/ar..."> <DATE Year="2019" Day="15" Month="11"></DATE> <TIME Second="3" Minute="9" Timezone="UTC" Hour="10"></TIME> <REPOSITORY>ports</REPOSITORY> <REVISION>517642</REVISION> <TO Email="ports-committers@freebsd.org"></TO> <TO Email="svn-ports-all@freebsd.org,"></TO> </MESSAGE> <FILES> <FILE Action="Add" Path="head/devel/binutils/pkg-plist-aarch64" Revision="517642"></FILE> <FILE Path="head/devel/binutils/pkg-plist-amd64" Revision="517642" Action="Add"></FILE> <FILE Action="Add" Revision="517642" Path="head/devel/binutils/pkg-plist-arm-gnueabi"></FILE> <FILE Action="Add" Revision="517642" Path="head/devel/binutils/pkg-plist-arm-none-eabi"></FILE> <FILE Path="head/devel/binutils/pkg-plist-avr" Revision="517642" Action="Add"></FILE> <FILE Action="Add" Path="head/devel/binutils/pkg-plist-i386" Revision="517642"></FILE> <FILE Action="Add" Revision="517642" Path="head/devel/binutils/pkg-plist-mingw32"></FILE> <FILE Revision="517642" Path="head/devel/binutils/pkg-plist-mips" Action="Add"></FILE> <FILE Action="Add" Revision="517642" Path="head/devel/binutils/pkg-plist-mips64"></FILE> <FILE Path="head/devel/binutils/pkg-plist-powerpc64" Revision="517642" Action="Add"></FILE> <FILE Action="Add" Path="head/devel/binutils/pkg-plist-riscv64" Revision="517642"></FILE> <FILE Revision="517642" Path="head/devel/binutils/pkg-plist-s390x" Action="Add"></FILE> <FILE Revision="517642" Path="head/devel/binutils/pkg-plist-sparc64" Action="Add"></FILE> </FILES> <PR Id="241756"></PR> </UPDATE> </UPDATES> [dan@dev-ingress01:/var/db/freshports/message-queues/archive/2019_11/2019_11_15] $
Test the code
Testing the code, I didn’t get anything different out:
[freshports@dev-ingress01 /usr/local/libexec/freshports]$ cat /var/db/freshports/message-queues/archive/2019_11/2019_11_15/2019.11.15.10.09.16.85661.txt.raw | ./process_mail.pl <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE UPDATES PUBLIC "-//FreshPorts//DTD FreshPorts 2.0//EN" "https://www.freshports.org/docs/fp-updates.dtd"> <UPDATES Version="1.3.2.1"> <UPDATE> <DATE Year="2019" Month="11" Day="15"></DATE> <TIME Second="3" Minute="9" Hour="10" Timezone="UTC"></TIME> <OS Id="FreeBSD" Branch="head" Repo="ports"></OS> <LOG>Update binutils to 2.33.1 While here, convert binutils into flavors, that ease a lot maintenance and helps cleaning out the code. This is inspired by the same work on going on the xtoolchained gcc by jhb@ PR: 241756 Exp-run: antoine (portmgr) Discussed with: jhb Differential Revision: https://reviews.freebsd.org/D22258</LOG> <PEOPLE> <UPDATER Handle="bapt"></UPDATER> </PEOPLE> <MESSAGE EncodingLosses="false" Id="201911151009.xAFA9393081239@repo.freebsd.org" Subject="svn commit: r517642 - in head: . devel devel/aarch64-binutils devel/aarch64-none-elf-binutils devel/aarch64-none-elf-gcc devel/amd64-binutils devel/arduino-tools devel/arm-gnueabi-binutils devel/ar..."> <DATE Month="11" Year="2019" Day="15"></DATE> <TIME Hour="10" Second="3" Minute="9" Timezone="UTC"></TIME> <REPOSITORY>ports</REPOSITORY> <REVISION>517642</REVISION> <TO Email="ports-committers@freebsd.org"></TO> <TO Email="svn-ports-all@freebsd.org,"></TO> </MESSAGE> <FILES> <FILE Action="Add" Revision="517642" Path="head/devel/binutils/pkg-plist-aarch64"></FILE> <FILE Path="head/devel/binutils/pkg-plist-amd64" Revision="517642" Action="Add"></FILE> <FILE Path="head/devel/binutils/pkg-plist-arm-gnueabi" Revision="517642" Action="Add"></FILE> <FILE Revision="517642" Action="Add" Path="head/devel/binutils/pkg-plist-arm-none-eabi"></FILE> <FILE Revision="517642" Action="Add" Path="head/devel/binutils/pkg-plist-avr"></FILE> <FILE Revision="517642" Action="Add" Path="head/devel/binutils/pkg-plist-i386"></FILE> <FILE Revision="517642" Action="Add" Path="head/devel/binutils/pkg-plist-mingw32"></FILE> <FILE Revision="517642" Action="Add" Path="head/devel/binutils/pkg-plist-mips"></FILE> <FILE Action="Add" Revision="517642" Path="head/devel/binutils/pkg-plist-mips64"></FILE> <FILE Revision="517642" Action="Add" Path="head/devel/binutils/pkg-plist-powerpc64"></FILE> <FILE Path="head/devel/binutils/pkg-plist-riscv64" Action="Add" Revision="517642"></FILE> <FILE Revision="517642" Action="Add" Path="head/devel/binutils/pkg-plist-s390x"></FILE> <FILE Path="head/devel/binutils/pkg-plist-sparc64" Revision="517642" Action="Add"></FILE> </FILES> <PR Id="241756"></PR> </UPDATE> </UPDATES> [freshports@dev-ingress01 /usr/local/libexec/freshports]$
It must be the code, or a change in email layout.
The above includes only Add actions, which directly relate to the Added: entries in the email.
Finding the issue
I found the issue. This was the fix:
- last if($line =~ /^Directory Properties:/); + next if($line =~ /^Directory Properties:/);
In the existing code, when a line containing only Directory Properties: was encountered, that signaled the end of processing for this commit.
I conclude that the email layout changed.
This meant that the deletes were never being processed, given the location of this text within the original email.
With the above code, I ran the script again and dumped the XML into a file. I originally wanted to show you a diff, but by its nature XML is not always the same each time it is generated. For example, the fields within a group do not necessarily appear in the same order. As I was typing this, I thought there MUST be an online XML diff tool. I found https://www.corefiling.com/opensource/xmldiff/ and created this for your viewing pleasure:
+ <FILE Action='Add' Path='head/devel/binutils/pkg-plist-aarch64-none-elf' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/aarch64-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/aarch64-none-elf-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/amd64-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/arm-gnueabi-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/arm-none-eabi-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/avr-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/i386-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/mingw32-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/mips-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/mips64-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/powerpc64-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/riscv64-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/s390x-binutils/' Revision='517642'></FILE> + <FILE Action='Remove' Path='head/devel/sparc64-binutils/' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/MOVED' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/Makefile' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/aarch64-none-elf-gcc/Makefile' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/arduino-tools/Makefile' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/arm-none-eabi-gcc492/Makefile' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/arm-none-eabi-newlib/Makefile' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/avr-gcc/Makefile' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/avr-libc/Makefile' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/binutils/Makefile' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/binutils/distinfo' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/mingw32-gcc/Makefile' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/powerpc64-gcc/Makefile' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/riscv64-gcc/Makefile' Revision='517642'></FILE> + <FILE Action='Modify' Path='head/devel/sope4/Makefile' Revision='517642'></FILE>
That is a lot of missing data.
Running the new XML
After running this:
[freshports@dev-ingress01 /usr/local/libexec/freshports]$ ./load_xml_into_db.pl /tmp/2019.11.15.10.09.16.85661-new.txt.xml -O > /tmp/2019.11.15.10.09.16.85661-new.txt.loading Use of uninitialized value $depends in concatenation (.) or string at /usr/local/lib/perl5/site_perl/FreshPorts/port.pm line 1363. Use of uninitialized value $depends in string eq at /usr/local/lib/perl5/site_perl/FreshPorts/port.pm line 1364. Use of uninitialized value $depends in concatenation (.) or string at /usr/local/lib/perl5/site_perl/FreshPorts/port.pm line 1363. Use of uninitialized value $depends in string eq at /usr/local/lib/perl5/site_perl/FreshPorts/port.pm line 1364. Use of uninitialized value $depends in concatenation (.) or string at /usr/local/lib/perl5/site_perl/FreshPorts/port.pm line 1363. Use of uninitialized value $depends in string eq at /usr/local/lib/perl5/site_perl/FreshPorts/port.pm line 1364. Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/FreshPorts/ports_generate_plist.pm line 40. Use of uninitialized value in string eq at /usr/local/lib/perl5/site_perl/FreshPorts/ports_generate_plist.pm line 50. Use of uninitialized value in split at /usr/local/lib/perl5/site_perl/FreshPorts/port.pm line 1296. [freshports@dev-ingress01 /usr/local/libexec/freshports]$
devel/s390x-binutils was marked as deleted. Score!
I’ll fix up those other errors next, but they are beyond the scope of this post.
Not shown here: I went back and re-processed each subsequent commit on devel/binutils
Thanks for coming to my TED talk.