#71968 closed defect (fixed)

wabt fails to configure: needs C++17 and Python 3.x

Reported by: barracuda156 Owned by: easieste@…
Priority: Normal Milestone:
Component: ports Version: 2.10.5
Keywords: Cc:
Port: wabt

Description

CMake Error at CMakeLists.txt:404 (target_compile_features):
  target_compile_features The compiler feature "cxx_std_17" is not known to
  CXX compiler

  "GNU"

  version 4.2.1.


-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
2025-01-29 13:40:24.041 sw_vers[63963:903] CFPreferences: user home directory at file://localhost/opt/local/var/macports/home/ is unavailable. User domains will be volatile.
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
CMake Error at /opt/local/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find Python3 (missing: Python3_EXECUTABLE Interpreter) (Required
  is at least version "3.5")

      Reason given by package: 
          Interpreter: Wrong version for the interpreter "/usr/bin/python"

Call Stack (most recent call first):
  /opt/local/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /opt/local/share/cmake-3.31/Modules/FindPython/Support.cmake:4001 (find_package_handle_standard_args)
  /opt/local/share/cmake-3.31/Modules/FindPython3.cmake:602 (include)
  CMakeLists.txt:671 (find_package)


-- Configuring incomplete, errors occurred!

Change History (10)

comment:1 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to easieste@…
Status: newassigned

comment:2 Changed 18 months ago by barracuda156

Also the bug here:

[ 88%] Building C object CMakeFiles/wasm-c-api-hello.dir/third_party/wasm-c-api/example/hello.c.o
/opt/local/bin/gcc-mp-14 -D__STDC_FORMAT_MACROS=1 -D__STDC_LIMIT_MACROS=1 -I/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/gtest/googletest -I/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/gtest/googletest/include -I/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include -I/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/include -I/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/build/include -isystem /opt/local/libexec/openssl3/include -pipe -Os -DNDEBUG -I/opt/local/include -arch ppc -mmacosx-version-min=10.6   -Wall -Wextra -Wno-unused-parameter -Wpointer-arith -Wuninitialized -Wimplicit-fallthrough -Wno-clobbered -std=gnu11 -Wno-pointer-to-int-cast -MD -MT CMakeFiles/wasm-c-api-hello.dir/third_party/wasm-c-api/example/hello.c.o -MF CMakeFiles/wasm-c-api-hello.dir/third_party/wasm-c-api/example/hello.c.o.d -o CMakeFiles/wasm-c-api-hello.dir/third_party/wasm-c-api/example/hello.c.o -c /opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/example/hello.c
In file included from /opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/example/global.c:6:
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h: In function 'assertions':
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h:30:3: error: implicit declaration of function 'static_assert' [-Wimplicit-function-declaration]
   30 |   static_assert(sizeof(float) == sizeof(uint32_t), "incompatible float type");
      |   ^~~~~~~~~~~~~
make[2]: *** [CMakeFiles/wasm-c-api-global.dir/third_party/wasm-c-api/example/global.c.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/build'
make[1]: *** [CMakeFiles/wasm-c-api-global.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/example/callback.c:6:
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h: In function 'assertions':
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h:30:3: error: implicit declaration of function 'static_assert' [-Wimplicit-function-declaration]
   30 |   static_assert(sizeof(float) == sizeof(uint32_t), "incompatible float type");
      |   ^~~~~~~~~~~~~
In file included from /opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/example/multi.c:6:
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h: In function 'assertions':
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h:30:3: error: implicit declaration of function 'static_assert' [-Wimplicit-function-declaration]
   30 |   static_assert(sizeof(float) == sizeof(uint32_t), "incompatible float type");
      |   ^~~~~~~~~~~~~
In file included from /opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/example/finalize.c:6:
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h: In function 'assertions':
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h:30:3: error: implicit declaration of function 'static_assert' [-Wimplicit-function-declaration]
   30 |   static_assert(sizeof(float) == sizeof(uint32_t), "incompatible float type");
      |   ^~~~~~~~~~~~~
In file included from /opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/example/hostref.c:6:
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h: In function 'assertions':
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h:30:3: error: implicit declaration of function 'static_assert' [-Wimplicit-function-declaration]
   30 |   static_assert(sizeof(float) == sizeof(uint32_t), "incompatible float type");
      |   ^~~~~~~~~~~~~
make[2]: *** [CMakeFiles/wasm-c-api-callback.dir/third_party/wasm-c-api/example/callback.c.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/build'
make[1]: *** [CMakeFiles/wasm-c-api-callback.dir/all] Error 2
make[2]: *** [CMakeFiles/wasm-c-api-multi.dir/third_party/wasm-c-api/example/multi.c.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/build'
make[1]: *** [CMakeFiles/wasm-c-api-multi.dir/all] Error 2
In file included from /opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/example/hello.c:6:
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h: In function 'assertions':
/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/wabt-1.0.36/third_party/wasm-c-api/include/wasm.h:30:3: error: implicit declaration of function 'static_assert' [-Wimplicit-function-declaration]
   30 |   static_assert(sizeof(float) == sizeof(uint32_t), "incompatible float type");
      |   ^~~~~~~~~~~~~
make[2]: *** [CMakeFiles/wasm-c-api-finalize.dir/third_party/wasm-c-api/example/finalize.c.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/build'
make[1]: *** [CMakeFiles/wasm-c-api-finalize.dir/all] Error 2
make[2]: *** [CMakeFiles/wasm-c-api-hostref.dir/third_party/wasm-c-api/example/hostref.c.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_ppcports_lang_wabt/wabt/work/build'
make[1]: *** [CMakeFiles/wasm-c-api-hostref.dir/all] Error 2
make[2]: *** [CMakeFiles/wasm-c-api-hello.dir/third_party/wasm-c-api/example/hello.c.o] Error 1

Perhaps legacysupport would be an easier fix, otherwise patch the source.

comment:3 Changed 18 months ago by easye

RE: python3

It doesn't seem that python3 is needed to actually build wabt but is used in various tests.

After deactivating all my installed Python ports, my configuration run picked up the system Python:

-- Found Python3: /usr/bin/python3 (found suitable version "3.9.6", minimum required is "3.5") found components: Interpreter
  1. Can I just let this default to the system Python?
  1. Otherwise, is there a way to specify a minimum Python version rather than depending on an exact version?

comment:4 in reply to:  2 ; Changed 18 months ago by easye

Replying to barracuda156:

Also the bug here:

[…]
   30 |   static_assert(sizeof(float) == sizeof(uint32_t), "incompatible float type");
      |   ^~~~~~~~~~~~~
make[2]: *** [CMakeFiles/wasm-c-api-callback.dir/third_party/wasm-c-api/example/callback.c.o] Error 1
[…]

Perhaps legacysupport would be an easier fix, otherwise patch the source.

How do I reproduce this error?

The port compiles for me locally, as well as the three runners on the GitHub hook.

Last edited 18 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:5 in reply to:  3 Changed 18 months ago by barracuda156

Replying to easye:

  1. Can I just let this default to the system Python?

I do not know the exact threshold, but obviously it failed for me with system python. Maybe this works?

if {${os.platform} eq "darwin" && ${os.major} < 11} {
    depends_build-append    port:python311
    license_noconflict      python311
    configure.python        ${prefix}/bin/python3.11
} elseif {${os.platform} eq "darwin" && ${os.major} >= 19} {
    configure.python        /usr/bin/python3
} else {
    configure.python        /usr/bin/python
}

https://github.com/macports/macports-ports/blob/master/math/blis/Portfile

  1. Otherwise, is there a way to specify a minimum Python version rather than depending on an exact version?

That would be convenient, but I am unaware of such possibility.

comment:6 in reply to:  4 Changed 18 months ago by barracuda156

Replying to easye:

Replying to barracuda156: How do I reproduce this error?

The port compiles for me locally, as well as the three runners on the GitHub hook.

GCC is more picky with this (and/or possibly libstdc++), but the problem is pretty common. Which is why legacysupport has incorporated the fix.

To answer the question: I am pretty sure that a build with some recent gcc version on 10.6 (any arch) will do. Perhaps later systems too, but I have no way to check that.

Buildbots or CI are irrelevant for gcc-related compiler or runtime issues, since they all use only libc++ with some clang.

  1. S. Simply adding legacysupport 1.1 fixed this for me. It won't be used for the latest systems (there is a maximum threshold), and it can be manually adjusted to a specific maximum OS version.
Last edited 18 months ago by barracuda156 (previous) (diff)

comment:7 Changed 18 months ago by easye

@barracuda156 Please review <https://github.com/macports/macports-ports/pull/27539> when you have a chance to address this ticket.

comment:8 Changed 18 months ago by easye

In 5cb1759cb85488881f758b2a75d336a1e2be6539/macports-ports (master):

lang/wabt: tighten requirements in response to https://github.com/macports/macports-ports/pull/71968

Disable cmake python requirement via patch (only used for tests).

Require C++ 2017 support.

Bring in legacysupport 1.1 for broader compatibility.

Addresses <#71968>.

comment:9 in reply to:  8 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to easye:

After deactivating all my installed Python ports, my configuration run picked up the system Python:

-- Found Python3: /usr/bin/python3 (found suitable version "3.9.6", minimum required is "3.5") found components: Interpreter
  1. Can I just let this default to the system Python?

As you can see from the original report, the system python on the user's system was not python 3.5 or later and was therefore insufficient. Python 3 is only included with macOS 10.15 and later.

  1. Otherwise, is there a way to specify a minimum Python version rather than depending on an exact version?

You must depend on an exact version. To minimize dependencies for current systems, you can choose to use MacPorts python 3 for macOS 10.14 and earlier and macOS python 3 for macOS 10.15 and later, but in both cases you should specify the complete absolute path to the python that should be used, otherwise the build is less reproducible.

Replying to barracuda156:

I do not know the exact threshold, but obviously it failed for me with system python. Maybe this works?

if {${os.platform} eq "darwin" && ${os.major} < 11} {
    depends_build-append    port:python311
    license_noconflict      python311
    configure.python        ${prefix}/bin/python3.11
} elseif {${os.platform} eq "darwin" && ${os.major} >= 19} {
    configure.python        /usr/bin/python3
} else {
    configure.python        /usr/bin/python
}

As you showed in your error message, python 3.5 or later is required. /usr/bin/python is python 2 and will not work for this port.

As of January 1, 2025, the preferred python version in MacPorts is 3.13 so if the port needs to use a MacPorts python it should use python313.

Replying to easye:

Disable cmake python requirement via patch (only used for tests).

Great, if python isn't actually used, then disabling the requirement is fine. However you shouldn't ever need to use a patch to disable a cmake find_package call. Instead, add a configure argument. See https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html.

comment:10 in reply to:  8 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Replying to easye:

Addresses <https://trac.macports.org/ticket/71968>.

Please see CommitMessages for the proper wording to use in commit messages to let Trac know it should close the ticket.

Note: See TracTickets for help on using tickets.