Bug 210618

Summary: www/node, www/node4, www/node5: work around build breakages due to include path ordering
Product: Ports & Packages Reporter: Bradley T. Hughes <bhughes>
Component: Individual Port(s)Assignee: Kurt Jaeger <pi>
Status: Closed FIXED    
Severity: Affects Some People CC: pi
Priority: --- Keywords: patch, patch-ready
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 210305, 210426, 210578, 210675    
Attachments:
Description Flags
patch from a git commit, apply with patch -p1 bhughes: maintainer-approval+

Description Bradley T. Hughes freebsd_committer freebsd_triage 2016-06-27 10:33:06 UTC
Created attachment 171860 [details]
patch from a git commit, apply with patch -p1

Add a post-configure step to strip out all occurrences of
-I${LOCALBASE}/include. Rely instead on USES+=localbase to tell the
compiler where to find includes from external dependencies.

After r416894, node.js builds will use external dependencies instead of
bundled ones. Fallout from this changes includes several build
breakages. All come from the fact that the node-gyp build process adds
-I${LOCALBASE}/include to CFLAGS before all others, including its own
bundled dependencies. This causes the build to incorrectly pick up
include files from any packages in ${LOCALBASE}, rather than the bundled
libraries as intended.
Comment 1 Bradley T. Hughes freebsd_committer freebsd_triage 2016-06-27 10:40:38 UTC
- portlint -AC:
WARN: Makefile: new ports should not set PORTREVISION.
WARN: /usr/ports/www/node/files/patch-deps_v8_src_arm_cpu-arm.cc: patch was not generated using ``make makepatch''.  It is recommended to use ``make makepatch'' when you need to [re-]generate a patch to ensure proper patch format.
0 fatal errors and 2 warnings found.

- testport: OK (poudriere 10.3-RELEASE, amd64 tested)
Comment 2 Mathieu Arnold freebsd_committer freebsd_triage 2016-06-29 08:25:58 UTC
For future reference, when providing patches with git, please add --no-prefix to the git diff line, so that the a/ and b/ are stripped and the patch is straightforward to apply with svn patch.
Comment 3 Bradley T. Hughes freebsd_committer freebsd_triage 2016-06-29 09:02:09 UTC
I will do that. Thanks for the tip, Mathieu :)
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-06-29 20:01:19 UTC
A commit references this bug:

Author: pi
Date: Wed Jun 29 20:00:48 UTC 2016
New revision: 417791
URL: https://svnweb.freebsd.org/changeset/ports/417791

Log:
  www/node[45]: work around build breakages due to include path ordering

  Add a post-configure step to strip out all occurrences of
  -I${LOCALBASE}/include. Rely instead on USES+=localbase to tell the
  compiler where to find includes from external dependencies.

  After r416894, node.js builds will use external dependencies instead of
  bundled ones. Fallout from this changes includes several build
  breakages. All come from the fact that the node-gyp build process adds
  -I${LOCALBASE}/include to CFLAGS before all others, including its own
  bundled dependencies. This causes the build to incorrectly pick up
  include files from any packages in ${LOCALBASE}, rather than the bundled
  libraries as intended.

  PR:		210618
  Submitted by:	Bradley T. Hughes <bradleythughes@fastmail.fm> (maintainer)

Changes:
  head/www/node/Makefile
  head/www/node4/Makefile
  head/www/node5/Makefile
Comment 5 Kurt Jaeger freebsd_committer freebsd_triage 2016-06-29 20:02:38 UTC
Committed, thanks!