Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing boost_locale on a build for Haiku #191

Closed
Begasus opened this issue Aug 26, 2023 · 5 comments
Closed

Missing boost_locale on a build for Haiku #191

Begasus opened this issue Aug 26, 2023 · 5 comments

Comments

@Begasus
Copy link

Begasus commented Aug 26, 2023

Hello, I'm looking into bumping our version to the latest 1.83.0 version, so far all looks fine but it seems I'm missing the library for boost_locale, am I missing something or is this something intentional?

EDIT Some additional information
OS: Haiku R1B4 64bit
Compiler: gcc13.2.0

@mclow mclow transferred this issue from boostorg/boost Aug 26, 2023
@Flamefire
Copy link
Collaborator

From the given information I can't tell. I'd need the full build output. I'd assume it found neither ICU nor Iconv which would skip the build with a message:

locale/build/Jamfile.v2

Lines 257 to 258 in 0552ffc

ECHO "- Boost.Locale needs either iconv or ICU library to be built." ;
result += <build>no ;

Or some of the other requirement isn't met

@Begasus
Copy link
Author

Begasus commented Aug 26, 2023

Including the full build output, one thing I noticed in the start now is: Unicode/ICU support for Boost.Regex?... not found.
I can't find the mentioned ECHO line in the build though.

build_log.txt

EDIT This is with ICU 70.1.2 and Iconv 1.17.3

@Flamefire
Copy link
Collaborator

Flamefire commented Aug 27, 2023

Yes it looks like it found iconv and ICU:

    - iconv (separate)         : yes [3]
    - icu                      : yes [3]

However it seems it didn't detect that the std library supports <type_traits> and even support for static_assert:

    - cxx11_static_assert      : no [2]
    - cxx11_hdr_type_traits    : no [2]

Checking the Boost.Config sources this is influenced by #if (BOOST_LIBSTDCXX_VERSION < 50100) || !defined(BOOST_LIBSTDCXX11) which has __cplusplus >= 201103 for the latter

Both should be correctly set so I can't tell what in your setup causes the issue.

You can try invoking something like ./b2 -d+2 -a libs/config/checks//cxx11_hdr_type_traits in that boost tree to to show the command executed for that check. Maybe with additional b2-args if you pass any in your setup.
Edit: Actually the commands invoked and potential error messages should be in bin.v2/config.log Search for cxx11_hdr_type_traits and cxx11_static_assert

Note that the issue isn't specifically with Boost.Locale as indicated by many "C++03 support is deprecated..." messages

@Begasus
Copy link
Author

Begasus commented Aug 27, 2023

The open PR to update our boost is linked above (it contains the recipe for the build and the patches I've added).
Some of the patches have been around for a while and have been updated to the newer release.

A major part I reworked (as that part changed in the source) to get the build started was here:

--- a/tools/build/src/engine/build.sh
+++ b/tools/build/src/engine/build.sh
@@ -325,6 +325,23 @@ case "${B2_TOOLSET}" in
         CXX_VERSION_OPT=${CXX_VERSION_OPT:---version}
         B2_CXXFLAGS_RELEASE="-O2 -s"
         B2_CXXFLAGS_DEBUG="-O0 -g"
+
+        CXX=${CXX:=g++}
+        # Check whether it's MinGW GCC, which has Windows headers and none of POSIX ones.
+        machine=$(${CXX} -dumpmachine 2>/dev/null)
+        if [ $? -ne 0 ]; then
+            echo "B2_TOOLSET is gcc, but the 'gcc' command cannot be executed."
+            echo "Make sure 'gcc' is in PATH, or use a different toolset."
+            exit 1
+        fi
+        case $machine in
+        *haiku*)
+        B2_CXX="${CXX} -x c++ -std=c++17"
+        B2_CXXFLAGS_RELEASE="-O2 -s -D_DEFAULT_SOURCE -lbsd"
+        B2_CXXFLAGS_DEBUG="-O0 -g"
+        ;;
+        esac
     ;;
 
     intel-*)
-- 

Seeing you mention gcc being a part of it (already did a new port for ICU73.2 to check also), it could very well be that I made a mistake here.
boost1.70 still builds OK with gcc13, so somehow some detection is off here on our side.

Edit: Actually the commands invoked and potential error messages should be in bin.v2/config.log Search for cxx11_hdr_type_traits and cxx11_static_assert

Looing in there I don't see anything special:

...found 1 target...
...found 1 target...
...updating 1 target...
config-cache.write bin.v2/project-cache.jam
...updated 1 target...

In that directory there is project-cache.jam wich contains:

  set "cxx11_static_assert-<deduced-address-model>64-<deduced-architecture>x86-<inlining>on-<threading>multi-<toolset-gcc:version>13-<toolset>gcc-<variant>release-<visibility>hidden" : "false" ;
...
  set "cxx11_hdr_type_traits-<deduced-address-model>64-<deduced-architecture>x86-<inlining>on-<threading>multi-<toolset-gcc:version>13-<toolset>gcc-<variant>release-<visibility>hidden" : "false" ;

EDIT: after running that command you supplied earlier I'm getting a better log, attatching it here

config.log.txt

EDIT2: after hunting down found these functions are disabled in boost/config/platform/haiku.hpp? These havent changed over the version (looking into the files date it originates from 2014?)
https://github.com/boostorg/config/blob/33b12777cff1c818e31ec33333cc821e9f506fd6/include/boost/config/platform/haiku.hpp#L19

EDIT3: uncommenting both lines for these functions in haiku.hpp solves the problem and even gets me a new library boost_nowide.

@Flamefire
Copy link
Collaborator

EDIT2: after hunting down found these functions are disabled in boost/config/platform/haiku.hpp? These havent changed over the version (looking into the files date it originates from 2014?) https://github.com/boostorg/config/blob/33b12777cff1c818e31ec33333cc821e9f506fd6/include/boost/config/platform/haiku.hpp#L19

EDIT3: uncommenting both lines for these functions in haiku.hpp solves the problem and even gets me a new library boost_nowide.

Yes it seems those defect macros are wrong/outdated. Boost.Locale requires C++11 since Boost 1.81 (see the changelog) as well as some other libraries which is likely why you see this (only) now.

I opened an issue for this in Boost.Config: boostorg/config#482
If you happen to know why those macros were defined (i.e. until when they were correct) please comment in that issue.

Anyway, glad you were able to find and resolved that, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants