Bug 253447 - devel/libphonenumber: build error for can not find 'google/protobuf/inlined_string_field.h'
Summary: devel/libphonenumber: build error for can not find 'google/protobuf/inlined_s...
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (Team)
Depends on:
Reported: 2021-02-12 06:14 UTC by marshall
Modified: 2021-04-21 09:45 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description marshall 2021-02-12 06:14:37 UTC

    I tried to update software from source by ports, then find that kdepim-addons, kitinerary and libphonenumber can not build correctly.
    After read the Makefile inside their ports tree, I realized that kdepim-adeons depend on kitineray which depend on libphonenumber.
    When upgrade the libphonenumber, the first ERROR message is 

    "fatal error: 'google/protobuf/inlined_string_field.h' file not found"

    So I check the devel/protobuf plist file, and find that their is no such header file would install to the system.

    I also tried to find / -name 'inlined_string_field.h' in my whole computer, and nothing found.

    Now the devel/protobuf version is 3.14.0, which can not support to build /devel/libphonenumber.

    Please fixed that problem. Thanks.
Comment 1 marshall 2021-02-16 01:43:52 UTC
Hey Guys,
    Since there is no one response, I tried to fix it by my self, and finally done.
    It seems the older version of libphonenumber header files in /usr/local/include/phonenumber would need this 'google/protobuf/inlined_string_field.h'.
    When compiler it, the 'make' process automatically find the system include path instead of ports path of include file.
    So I delete the older version by 'make deinstall' to delete all /usr/local/include/phonenumber directory. Then re-make it.
    Now everything is fine!

    So, this bug is due to API change and the stupid c 'include <somepath/somefile.h>' mechanism.
    One should change the CMakeList.txt file to blacklist the /usr/local/include path. otherwise, this kind of ERROR would happen again and again!
Comment 2 Po-Chuan Hsieh freebsd_committer 2021-02-16 15:58:36 UTC
Fix summary and assign it to the maintainer.
Comment 3 Tobias C. Berner freebsd_committer 2021-02-16 21:44:34 UTC
(In reply to marshall from comment #1)
Moin moin 

It is advisable to build ports in poudriere or an other clean-room builder, so that exactly this issue won't happen.

Unfortunately it is generally not easy to make ports not pick up their own headers of the old version.

mfg Tobias
Comment 4 Adriaan de Groot freebsd_committer 2021-04-21 09:45:49 UTC
To add to what Tobias said: on Linux "everything" lives in `/usr/include`, which isn't explicitly added as an include path. It's implicitly a system-include path, just like on FreeBSD. But because we install all the non-system headers in `/usr/local/include`, that path needs to be added to the header search-path. That can be done with `-I` or `-isystem`, and as soon as that happens, it is both explicit, and somewhere specific in the search-order. So any package on FreeBSD that installs headers to `/usr/local/include` *and also* has any dependency with headers in `/usr/local/include` has a problem: the `-I` for `/usr/local/include` must come **after** any `-I` for the package's internal headers.

Setting that up is something that very few package-build-system do (e.g. you need to be very very careful in handling include paths, whether you use autoconf, cmake or something else). Each individual package needs patching / massaging to get that right.

And that's why "build in a clean environment" is the recommended and inexpensive workaround, and why patches for specific ports are welcome. libphonenumber is special, the build is also full of race-conditions, but that's because Google is awful.