Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Oct 2020 12:56:23 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r366538 - stable/12/usr.sbin/crunch/crunchgen
Message-ID:  <202010081256.098CuN9Y062137@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Thu Oct  8 12:56:23 2020
New Revision: 366538
URL: https://svnweb.freebsd.org/changeset/base/366538

Log:
  MFC r366466: 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.

Modified:
  stable/12/usr.sbin/crunch/crunchgen/crunchgen.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/crunch/crunchgen/crunchgen.c
==============================================================================
--- stable/12/usr.sbin/crunch/crunchgen/crunchgen.c	Thu Oct  8 11:45:10 2020	(r366537)
+++ stable/12/usr.sbin/crunch/crunchgen/crunchgen.c	Thu Oct  8 12:56:23 2020	(r366538)
@@ -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);
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010081256.098CuN9Y062137>