Bug 193187 - www/chromium: fails to build when ffmpeg-2.3.3 installed or -I/usr/local/include poisoning
Summary: www/chromium: fails to build when ffmpeg-2.3.3 installed or -I/usr/local/incl...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-chromium (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-31 01:36 UTC by Jan Beich
Modified: 2014-09-01 21:59 UTC (History)
1 user (show)

See Also:


Attachments
mark default ports include path as -isystem (497 bytes, patch)
2014-08-31 01:36 UTC, Jan Beich
no flags Details | Diff
|poudriere testport -P| log (10.0R amd64) (180.65 KB, application/x-gzip)
2014-09-01 15:20 UTC, Jan Beich
no flags Details
mark default ports include path as -isystem, v2 (4.44 KB, patch)
2014-09-01 19:40 UTC, Jan Beich
no flags Details | Diff
|poudriere testport -P| log (10.0R amd64) (181.52 KB, application/x-gzip)
2014-09-01 19:43 UTC, Jan Beich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2014-08-31 01:36:44 UTC
Created attachment 146582 [details]
mark default ports include path as -isystem

Locally updating multimedia/ffmpeg to 2.3.3 causes one more build failure.

  ../../media/ffmpeg/ffmpeg_common.cc:21:1: error: static_assert failed "decoder_buffer_padding_size_does_not_fit_ffmpeg_requirement"
  COMPILE_ASSERT(DecoderBuffer::kPaddingSize >= FF_INPUT_BUFFER_PADDING_SIZE,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../../base/macros.h:160:35: note: expanded from macro 'COMPILE_ASSERT'
  #define COMPILE_ASSERT(expr, msg) static_assert(expr, #msg)
                                    ^             ~~~~
  1 error generated.

  $ fgrep define\ FF_INPUT_BUFFER_PADDING_SIZE ../../third_party/ffmpeg/libavcodec/avcodec.h
  #define FF_INPUT_BUFFER_PADDING_SIZE 16

  $ fgrep define\ FF_INPUT_BUFFER_PADDING_SIZE /usr/local/include/libavcodec/avcodec.h
  #define FF_INPUT_BUFFER_PADDING_SIZE 32

with minimized test case like this

  $ mkdir -p bundled/libavcodec system/libavcodec
  $ touch bundled/libavcodec/avcodec.h system/libavcodec/avcodec.h
  $ echo '#include <libavcodec/avcodec.h>' | cc -E - -I system -I bundled | fgrep avcodec.h
  # 1 "system/libavcodec/avcodec.h" 1

which can be fixed by pushing include path down the stack using either -isystem or -idirafter

  $ echo '#include <libavcodec/avcodec.h>' | cc -E - -I system -I bundled -isystem system | fgrep avcodec.h
  # 1 "bundled/libavcodec/avcodec.h" 1

"-I" order issue stems from inconsistent defaults. Almost any dependency poisons the build with -I/usr/local/include. And upstream often hardcodes the path.

- having /usr/local/bin in PATH is OK
- having /usr/local/man in MANPATH is OK
- having /usr/local/info in INFOPATH is OK
- having /usr/local/etc/mail.rc in MAILRC is OK
- having /usr/local/bin/xauth in ssh(1) is OK
- having /usr/local/etc/rc.d in rc.conf is OK
- having /usr/local/etc/devd in devd.conf is OK
- having /usr/local/etc/libmap.d in libmap.conf is OK
...
- but /usr/local/include in CPATH is NOT
- but /usr/local/lib in LIBRARY_PATH is NOT
Comment 1 Jan Beich freebsd_committer freebsd_triage 2014-09-01 15:20:12 UTC
Created attachment 146631 [details]
|poudriere testport -P| log (10.0R amd64)

Builds fine with the following Makefile.local:

  # try to break build
  BUILD_DEPENDS+= ffmpeg>0:${PORTSDIR}/multimedia/ffmpeg \
                  googletest>0:${PORTSDIR}/devel/googletest \
                  v8>0:${PORTSDIR}/lang/v8 \
                  webkit-gtk2>0:${PORTSDIR}/www/webkit-gtk2
Comment 2 Jan Beich freebsd_committer freebsd_triage 2014-09-01 15:46:37 UTC
9.3R i386 fails with an error likely due to files/patch-manual-build

In file included from ../../gpu/command_buffer/service/gles2_cmd_validation.h:13:0,
                 from ../../gpu/command_buffer/service/feature_info.h:14,
                 from ../../gpu/command_buffer/service/query_manager.h:16,
                 from ../../gpu/command_buffer/service/context_state.h:14,
                 from ../../gpu/command_buffer/service/context_state.cc:5:
../../gpu/command_buffer/common/gles2_cmd_format.h:42:19: error: conflicting declaration 'typedef ptrdiff_t GLintptr'
In file included from ../../third_party/mesa/src/include/GL/gl.h:2086:0,
                 from ../../ui/gl/gl_bindings.h:13,
                 from ../../gpu/command_buffer/service/gl_utils.h:12,
                 from ../../gpu/command_buffer/service/context_state.h:13,
                 from ../../gpu/command_buffer/service/context_state.cc:5:
../../third_party/mesa/src/include/GL/glext.h:6156:32: error: 'GLintptr' has a previous declaration as 'typedef long int GLintptr'
In file included from ../../gpu/command_buffer/service/gles2_cmd_validation.h:13:0,
                 from ../../gpu/command_buffer/service/feature_info.h:14,
                 from ../../gpu/command_buffer/service/query_manager.h:16,
                 from ../../gpu/command_buffer/service/context_state.h:14,
                 from ../../gpu/command_buffer/service/context_state.cc:5:
../../gpu/command_buffer/common/gles2_cmd_format.h:43:19: error: conflicting declaration 'typedef ptrdiff_t GLsizeiptr'
In file included from ../../third_party/mesa/src/include/GL/gl.h:2086:0,
                 from ../../ui/gl/gl_bindings.h:13,
                 from ../../gpu/command_buffer/service/gl_utils.h:12,
                 from ../../gpu/command_buffer/service/context_state.h:13,
                 from ../../gpu/command_buffer/service/context_state.cc:5:
../../third_party/mesa/src/include/GL/glext.h:6157:32: error: 'GLsizeiptr' has a previous declaration as 'typedef long int GLsizeiptr'
Comment 3 Rene Ladan freebsd_committer freebsd_triage 2014-09-01 15:54:52 UTC
The official package builders for i386 noticed this too, so I made files/patch-manual-build to only apply to amd64.
Comment 4 Jan Beich freebsd_committer freebsd_triage 2014-09-01 19:40:48 UTC
Created attachment 146637 [details]
mark default ports include path as -isystem, v2

I'd argue the patch is not needed with the approach here.
Comment 5 Jan Beich freebsd_committer freebsd_triage 2014-09-01 19:43:21 UTC
Created attachment 146638 [details]
|poudriere testport -P| log (10.0R amd64)

Added WITH_NEW_XORG and libEGL dep to try break build but still fine.
Comment 6 commit-hook freebsd_committer freebsd_triage 2014-09-01 21:59:30 UTC
A commit references this bug:

Author: rene
Date: Mon Sep  1 21:58:53 UTC 2014
New revision: 366965
URL: http://svnweb.freebsd.org/changeset/ports/366965

Log:
  Fix build on local systems when ffmpeg-2.3.3 is installed. This removes the
  need for files/extra-patch-manual-amd64

  PR:		193187
  Submitted by:	Jan Beich

Changes:
  head/www/chromium/Makefile
  head/www/chromium/files/extra-patch-manual-amd64