jupyter-xeus / xeus-python-wheel

Building a PyPI wheel for xeus-python
BSD 3-Clause "New" or "Revised" License
12 stars 13 forks source link

Bump to 0.15.0 #104

Closed blink1073 closed 1 year ago

blink1073 commented 1 year ago

@JohanMabille I'm out of my depth on this one. 😅

JohanMabille commented 1 year ago

@blink1073 thanks for opening this, I totally forgot to update the wheel. I think you need to keep all the previous dependencies (including cppzmq and libzmq), and simply add the xeus-zmq package (between xeus and xeus-python); and of course bump the release versions of the xeus packages like you did.

blink1073 commented 1 year ago

It seems like there's some more cmake magic to do. I tried mucking around locally with include_directories and link_directories but couldn't figure it out.

   CMake Error at _skbuild/macosx-10.16-x86_64-3.7/cmake-build/_deps/xeus_zmq-src/CMakeLists.txt:88 (find_package):
    By not providing "Findxeus.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "xeus", but
    CMake did not find one.

    Could not find a package configuration file provided by "xeus" (requested
    version 3.0.0) with any of the following names:

      xeusConfig.cmake
      xeus-config.cmake

    Add the installation prefix of "xeus" to CMAKE_PREFIX_PATH or set
    "xeus_DIR" to a directory containing one of the above files.  If "xeus"
    provides a separate development package or SDK, be sure it has been
    installed.
  Building wheel for xeus-python (pyproject.toml): finished with status 'error'
JohanMabille commented 1 year ago

That's weird, the cmake install files of xeus should be available, I will investigate over the week end

JohanMabille commented 1 year ago

OK got it, a check is missing in xeus-zmq CMakeLists.txt. Sorry for that, fixing it now.

blink1073 commented 1 year ago

I added libuuid on Linux but it is still complaining about a missing -fPIC somewhere:

 FAILED: _deps/xeus-python-build/xpython_extension.cpython-37m-x86_64-linux-gnu.so
  : && /usr/bin/c++ -fPIC -Wunused-parameter -Wextra -Wreorder -std=c++14 -O3 -DNDEBUG  -flto -shared  -o _deps/xeus-python-build/xpython_extension.cpython-37m-x86_64-linux-gnu.so _deps/xeus-python-build/CMakeFiles/xpython_extension.dir/src/xpython_extension.cpp.o  _deps/xeus-python-build/libxeus-python.a  -lpthread  _deps/xeus_zmq-build/libxeus-zmq.a  _deps/libzmq-build/lib/libzmq.a  -lrt  /__w/xeus-python-wheel/xeus-python-wheel/_skbuild/linux-x86_64-3.7/cmake-install/lib/libcrypto.a  -lpthread  _deps/xeus-build/libxeus.a  /usr/lib/x86_64-linux-gnu/libuuid.a  /__w/xeus-python-wheel/xeus-python-wheel/_skbuild/linux-x86_64-3.7/cmake-install/lib/libsodium.a  -ldl  -lutil  -lrt && cd /__w/xeus-python-wheel/xeus-python-wheel/_skbuild/linux-x86_64-3.7/cmake-build/_deps/xeus-python-build && /usr/bin/strip /__w/xeus-python-wheel/xeus-python-wheel/_skbuild/linux-x86_64-3.7/cmake-build/_deps/xeus-python-build/xpython_extension.cpython-37m-x86_64-linux-gnu.so
  /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libuuid.a(libuuid_la-gen_uuid.o): relocation R_X86_64_TPOFF32 against `state_fd.6311' can not be used when making a shared object; recompile with -fPIC
  /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libuuid.a(libuuid_la-randutils.o): relocation R_X86_64_TPOFF32 against `ul_jrand_seed' can not be used when making a shared object; recompile with -fPIC
  /usr/bin/ld: final link failed: Nonrepresentable section on output
  collect2: error: ld returned 1 exit status
JohanMabille commented 1 year ago

Theoretically we're supposed to dowload the source, build it and link xeus with the static lib of libuuid; that is what this part of the cmake is supposed to do. And I can see it installed in the logs, what I don't understand is why it does not find it when building xeus, this part has not changed since last release (or at least not in a visible way).

JohanMabille commented 1 year ago

I cannot reproduce locally, I need to setup a branch and instrument the cmake.

SylvainCorlay commented 1 year ago

It seems that the build is linking against a system-install libuuid instead of the one we build statically.

blink1073 commented 1 year ago

It seems that the build is linking against a system-install libuuid instead of the one we build statically.

I added an apt-get install in e3f4e86 (#104) because prior to that the error was:

  /__w/xeus-python-wheel/xeus-python-wheel/_skbuild/linux-x86_64-3.7/cmake-build/_deps/xeus-src/src/xguid.cpp:20:23: fatal error: uuid/uuid.h: No such file or directory
   #include <uuid/uuid.h>
                         ^
  compilation terminated.
JohanMabille commented 1 year ago

To summarize:

The correct fix is to have <something>/cmake-install/include in the search path for headers.

EDIT: in the previous versions of xeus, this path was added by cppzmq, which is not a dependency of xeus anymore. The way to add it again is to search for uuid/uuid.h and not uuid.h when calling find_path in the CMakeLists.txt of xeus.

JohanMabille commented 1 year ago

Sooooo we need a release of xeus ;)

blink1073 commented 1 year ago

Nice work @JohanMabille!

JohanMabille commented 1 year ago

@blink1073 thanks! And thank you for upgrading the wheel and initiating the investigations!

blink1073 commented 1 year ago

https://pypi.org/project/xeus-python/0.15.0/