svn commit: r366466 - head/usr.sbin/crunch/crunchgen

Kyle Evans kevans at FreeBSD.org
Mon Oct 5 20:57:45 UTC 2020


Author: kevans
Date: Mon Oct  5 20:57:44 2020
New Revision: 366466
URL: https://svnweb.freebsd.org/changeset/base/366466

Log:
  crunchgen: fix MK_AUTO_OBJ logic after r364166
  
  r364166 converted echo -n `/bin/pwd` to a raw pwd invocation, leaving a
  trailing newline at the end of path.  This caused a later stat() of it to
  erroneously fail and the fallback to MK_AUTO_OBJ=no logic proceeded as
  unexpected.
  
  Harry Schmalzbauer bissected the resulting build failure he experienced
  (stable/12 host, -HEAD build) down to r365887. This change is mostly
  unrelated, except it switches the build to bootstrapped crunchgen - clue!
  
  I then bissected recent crunchgen changes going back a bit since we wouldn't
  observe the failure immediately with -CURRENT in most configurations, which
  landed me on r364166. After many intense head-scratching minutes and printf
  debugging, I realized that the newline was the difference. This is where our
  tale ends.
  
  Reported by:	Harry Schmalzbauer, O. Hartmann, Mike Tancsa, kevans
  MFC after:	3 days

Modified:
  head/usr.sbin/crunch/crunchgen/crunchgen.c

Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c
==============================================================================
--- head/usr.sbin/crunch/crunchgen/crunchgen.c	Mon Oct  5 20:13:22 2020	(r366465)
+++ head/usr.sbin/crunch/crunchgen/crunchgen.c	Mon Oct  5 20:57:44 2020	(r366466)
@@ -666,6 +666,8 @@ fillin_program(prog_t *p)
 		if (!*path)
 			errx(1, "Can't perform pwd on: %s\n", p->srcdir);
 
+		/* Chop off trailing newline. */
+		path[strlen(path) - 1] = '\0';
 		p->realsrcdir = strdup(path);
 	}
 


More information about the svn-src-head mailing list