Porting issues R1B4 vs nightly

Boost 1.83.0, tested and checked with older recipes still using boost 1.69.0, fixed some issues allong the line.
This has been a pain for a while since some newer sources required a boost version > 1.71.0.
Now available for install and testing on 64bit and 32bit. :slight_smile:

11 Likes

I tried build i2pd with this and have some issues with asio library, and on previous versions too.
recipe and pathes
And issue:

[  1%] Building CXX object CMakeFiles/libi2pd.dir/sources/i2pd-2.45.1/libi2pd/Blinding.cpp.o
In file included from /boot/system/develop/headers/boost/asio/detail/impl/posix_event.ipp:24,
                 from /boot/system/develop/headers/boost/asio/detail/posix_event.hpp:172,
                 from /boot/system/develop/headers/boost/asio/detail/event.hpp:25,
                 from /boot/system/develop/headers/boost/asio/execution/blocking_adaptation.hpp:19,
                 from /boot/system/develop/headers/boost/asio/execution.hpp:22,
                 from /boot/system/develop/headers/boost/asio/any_completion_executor.hpp:22,
                 from /boot/system/develop/headers/boost/asio.hpp:20,
                 from /sources/i2pd-2.45.1/libi2pd/Timestamp.h:16,
                 from /sources/i2pd-2.45.1/libi2pd/Blinding.cpp:17:
/boot/system/develop/headers/boost/asio/error.hpp:188:20: error: 'HOST_NOT_FOUND' was not declared in this scope; did you mean 'B_STREAM_NOT_FOUND'?
  188 |   host_not_found = BOOST_ASIO_NETDB_ERROR(HOST_NOT_FOUND),
      |                    ^~~~~~~~~~~~~~~~~~~~~~
/boot/system/develop/headers/boost/asio/error.hpp:191:30: error: 'TRY_AGAIN' was not declared in this scope; did you mean 'EAI_AGAIN'?
  191 |   host_not_found_try_again = BOOST_ASIO_NETDB_ERROR(TRY_AGAIN),
      |                              ^~~~~~~~~~~~~~~~~~~~~~
/boot/system/develop/headers/boost/asio/error.hpp:194:13: error: 'NO_DATA' was not declared in this scope; did you mean ENODATA'?
  194 |   no_data = BOOST_ASIO_NETDB_ERROR(NO_DATA),
      |             ^~~~~~~~~~~~~~~~~~~~~~
/boot/system/develop/headers/boost/asio/error.hpp:197:17: error: 'NO_RECOVERY' was not declared in this scope
  197 |   no_recovery = BOOST_ASIO_NETDB_ERROR(NO_RECOVERY)
      |                 ^~~~~~~~~~~~~~~~~~~~~~
In file included from /boot/system/develop/headers/boost/asio/detail/resolver_service.hpp:26,
                 from /boot/system/develop/headers/boost/asio/ip/basic_resolver.hpp:36,
                 from /boot/system/develop/headers/boost/asio.hpp:136:
/boot/system/develop/headers/boost/asio/detail/resolve_endpoint_op.hpp: In static member function 'static void boost::asio::detail::resolve_endpoint_op<Protocol, Handler, IoExecutor>::do_complete(void*, boost::asio::detail::operation*, const boost::system::error_code&, std::size_t)':
/boot/system/develop/headers/boost/asio/detail/resolve_endpoint_op.hpp:84:22: error: 'NI_MAXHOST' was not declared in this scope
   84 |       char host_name[NI_MAXHOST] = "";
      |                      ^~~~~~~~~~
/boot/system/develop/headers/boost/asio/detail/resolve_endpoint_op.hpp:85:25: error: 'NI_MAXSERV' was not declared in this scope
   85 |       char service_name[NI_MAXSERV] = "";
      |                         ^~~~~~~~~~
/boot/system/develop/headers/boost/asio/detail/resolve_endpoint_op.hpp:87:32: error: 'host_name' was not declared in this scope; did you mean 'SN_name'?
   87 |           o->endpoint_.size(), host_name, NI_MAXHOST, service_name, NI_MAXSERV,
      |                                ^~~~~~~~~
      |                                SN_name
/boot/system/develop/headers/boost/asio/detail/resolve_endpoint_op.hpp:87:55: error: 'service_name' was not declared in this scope; did you mean 'service_base'?
   87 |           o->endpoint_.size(), host_name, NI_MAXHOST, service_name, NI_MAXSERV,
      |                                                       ^~~~~~~~~~~~
      |                                                       service_base
/boot/system/develop/headers/boost/asio/detail/resolver_service.hpp: In member function 'boost::asio::detail::resolver_service<Protocol>::results_type boost::asio::detail::resolver_service<Protocol>::resolve(implementation_type&, const endpoint_type&, boost::system::error_code&)':
/boot/system/develop/headers/boost/asio/detail/resolver_service.hpp:111:20: error: 'NI_MAXHOST' was not declared in this scope
  111 |     char host_name[NI_MAXHOST];
      |                    ^~~~~~~~~~
/boot/system/develop/headers/boost/asio/detail/resolver_service.hpp:112:23: error: 'NI_MAXSERV' was not declared in this scope
  112 |     char service_name[NI_MAXSERV];
      |                       ^~~~~~~~~~
/boot/system/develop/headers/boost/asio/detail/resolver_service.hpp:114:9: error: 'host_name' was not declared in this scope; did you mean 'SN_name'?
  114 |         host_name, NI_MAXHOST, service_name, NI_MAXSERV,
      |         ^~~~~~~~~
      |         SN_name
/boot/system/develop/headers/boost/asio/detail/resolver_service.hpp:114:32: error: 'service_name' was not declared in this scope; did you mean 'service_base'?
  114 |         host_name, NI_MAXHOST, service_name, NI_MAXSERV,
      |                                ^~~~~~~~~~~~
      |                                service_base
CMakeFiles/libi2pd.dir/build.make:89: recipe for target 'CMakeFiles/libi2pd.dir/sources/i2pd-2.45.1/libi2pd/Blinding.cpp.o' failed
make[2]: *** [CMakeFiles/libi2pd.dir/sources/i2pd-2.45.1/libi2pd/Blinding.cpp.o] Error 1
CMakeFiles/Makefile2:88: recipe for target 'CMakeFiles/libi2pd.dir/all' failed
make[1]: *** [CMakeFiles/libi2pd.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

Builds OK here with boost1.83

grabbing i2pd-2.45.1-1-x86_64.hpkg and moving it to /Opslag/haikuports/packages/i2pd-2.45.1-1-x86_64.hpkg

EDIT: missing cmd:i2pd (latest version upstream is 2.48.0 also) :slight_smile:

After removing previous builds i have the same fails, your build on beta or nightly build? Because before boost 1.6x updated build completed succesfully

Build on R1B4, there’s only boost169 in the 1.6.* versions (that has been updated 8 months ago, so not a recent change there).

OK, checked a build with boost170 here (as was in the recipe), no errors …

But on nightly builds it doesn’t work, for example that’s tested on hrev57267

OK, got the same error on nightly, strange that it works on the Beta but not on the nightly, the package is the same …

EDIT: checked with a few other recipes on nightly (64bit), those are still fine … so I’m in the dark why “this” one is failing atm …

2 Likes

Thanks @humdinger :slight_smile: Still not sure if this is somehow to do with something that changed in Haiku itself?

Those are behind _DEFAULT_SOURCE now.

I think (?) this should be handled in: https://github.com/haikuports/haikuports/blob/be16ca26833ac0180691621f054fe6fa68c96923/dev-libs/boost/patches/boost1.83-1.83.0.patchset#L257C8-L257C62

But seeing this hasn’t hit the beta I guess it didn’t, from the looks of it the binary “b2” is using those flags, not sure now for the rest of the source :confused:

Maybe for building boost itself, but the problem is in building something else that uses boost’s headers. So unless that script changes the headers for the devel package, i2pd has to define _DEFAULT_SOURCE.

3 Likes

Confirmed, that fixes the boost asio problem, other errors (endian related I presume) further on then, thanks @madmax !

2 Likes

@humdinger Maybe this topic should be renamed? As it looks it isn’t really a boost issue rather then a R1B4 vs nightly issue?

“Building Boost shows beta4/nightly incompatibility” ?
Or can it be more specific?

This could work, but it’s not just boost, recent changes for arc4random_buf() (amongst others) are infected also? So maybe something like “Porting issues R1B4 vs nightly”?

1 Like

Probably that header should include <features.h> which will automatically define _DEFAULT_SOURCE in most cases.

2 Likes

Speaking of <features.h>… I was going back and forth with @korli regarding the use of _GNU_SOURCE vs __USE_GNU over this TraX PR.

Should that file contain a guarded define for __USE_GNU? [1], or we should have a headers/compatibility/gnu/features.h one or something like that?

[1] For reference, the one from src/system/libroot/posix/glibc/include/features.h does so.

I have replied on github, I think we should instead remove use of __USE_GNU in our public headers (that is, in fact, only regex.h, which was copied from glibc) and make them use our version of features.h, that is not compatible with the glibc one.

In Haiku, the “internal” define is directly _GNU_SOURCE and I don’t think we should replicate the complexity of glibc features.h.

2 Likes

It used to be in more, but I removed some usages recently.

Isn’t it _DEFAULT_SOURCE? features.h defines that based on whether _GNU_SOURCE or others are defined.

But we still have a bunch of headers that check for _GNU_SOURCE not _DEFAULT_SOURCE. Should we fix these?