Bug 194679

Summary: [patch] irc/irc:builds forever if uname -a doesn't match CONFIGURE_TARGET
Product: Ports & Packages Reporter: John Marino <marino>
Component: Individual Port(s)Assignee: Johan van Selst <johans>
Status: Closed FIXED    
Severity: Affects Only Me Flags: marino: maintainer-feedback? (johans)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
IRC makefile patch
none
*very* small excerpt of build log that goes forever none

Description John Marino freebsd_committer freebsd_triage 2014-10-29 09:29:04 UTC
Created attachment 148757 [details]
IRC makefile patch

The IRC configure script has curious logic.  All it really wants to do is create a build directory and run a different configure script there.  Rather than just use a fixed name for the build directory, it uses a name based on the triplet of the host machine.  This is reflected in the port makefile with the line "BUILD_WRKSRC=	${WRKSRC}/${MACHINE_ARCH}-unknown-${OPSYS:tl}${OSREL}"

Besides being overly complex, it actually breaks badly if the port is being built in a chroot where the host triplet won't match the jail triplet.  Attached in a log showing make running forever after hitting a "cd" error, which in itself is a bug.

The solution I've provided here is clean.  Using the pre-configure target, the build directory (with a fixed name) is created and the needed configure script and header are copied over, just like the top configure script does.  Then the port makefile just configures with that.  It's much better, more robust, and fixes the triplet mismatch.

Please review and hopefully approve the patch for commit.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-10-29 09:29:04 UTC
Auto-assigned to maintainer johans@FreeBSD.org
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-10-29 09:42:08 UTC
A commit references this bug:

Author: johans
Date: Wed Oct 29 09:41:48 UTC 2014
New revision: 371671
URL: https://svnweb.freebsd.org/changeset/ports/371671

Log:
  The IRC configure script has curious logic, is being overly complex,
  and actually breaks badly if the port is being built in a chroot
  where the host triplet won't match the jail triplet.

  The solution I've provided here is clean.  Using the pre-configure
  target, the build directory (with a fixed name) is created and the
  needed configure script and header are copied over, just like the top
  configure script does.  Then the port makefile just configures with
  that.  It's much better, more robust, and fixes the triplet mismatch.

  PR:		194679
  Submitted by:	marino

Changes:
  head/irc/irc/Makefile
Comment 3 Johan van Selst freebsd_committer freebsd_triage 2014-10-29 09:43:04 UTC
Yes, I really like it. Tested and committed. Thanks.
Comment 4 John Marino freebsd_committer freebsd_triage 2014-10-29 09:45:04 UTC
Created attachment 148759 [details]
*very* small excerpt of build log that goes forever

note that make spawns forever with the build directory mismatch bug caused by trying to guess the triplet and not providing a configure switch override.
Comment 5 John Marino freebsd_committer freebsd_triage 2014-10-29 09:45:58 UTC
sorry, bugzilla was blocked for me for several minutes.  I just realized you committed the fix in the meantime, thanks!