Clemapfel / Mousetrap.jl

Finally, a GUI Engine made for Julia

Home Page:https://clemens-cords.com/mousetrap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect dependency on `libjulia_jll`

fingolfin opened this issue · comments

Your custom JLLs have a runtime dependency on libjulia_jll, which basically always is wrong ; libjulia_jll solely exists to facilitate building of other JLLs.

(If your JLLs were handled via Yggdrasil, this would have been pointed out in code review 😄)

I need to link against the julia shared library during compilation of the C++ to Julia interface mousetrap_julia_binding, unlike the mousetrap C++ component mousetrap, mousetrap_julia_binding depends on libjulia.so which is not part of the basic BinaryBuilder sandbox. mousetrap_julia_binding uses the Julia C-API whose library and headers are provided by libjulia_jll.

Furthermore libcxxwrap_julia_jll also links against libjulia_jll, so I don't see how it could be "always" wrong. I have that jll as a dependency so libjulia_jll would be pulled in either way.

Are you saying having libjulia_jll as a separate dependency is unnecessary because libcxxwrap_julia_jll already pulls it in?

I just tried removing libjulia_jll from the dependencies, then running the binary builder script again. As I expected, it errors during configuration of mousetrap_julia_binding, because it cannot find the Julia package:

cmake .. -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN}
Re-run cmake no build system arguments
-- The CXX compiler identification is GNU 12.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/bin/x86_64-linux-musl-libgfortran5-cxx11/x86_64-linux-musl-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Julia executable: Julia_EXECUTABLE-NOTFOUND
CMake Error at /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/FindJulia.cmake:32 (file):
  file failed to open for reading (No such file or directory):

    /workspace/srcdir/mousetrap_julia_binding/Julia_VERSION_INCLUDE-NOTFOUND
Call Stack (most recent call first):
  /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/JlCxxConfig.cmake:3 (find_package)
  CMakeLists.txt:18 (find_package)


CMake Error at /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/FindJulia.cmake:33 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/JlCxxConfig.cmake:3 (find_package)
  CMakeLists.txt:18 (find_package)


-- Julia_VERSION_STRING: 
CMake Error at /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/FindJulia.cmake:48 (if):
  if given arguments:

    "VERSION_LESS" "0.7.0"

  Unknown arguments specified
Call Stack (most recent call first):
  /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/JlCxxConfig.cmake:3 (find_package)
  CMakeLists.txt:18 (find_package)


-- Configuring incomplete, errors occurred!

I realize that it's very rare for a jll to need libjulia, since most of them just provide external libraries that don't have to do anything to do with Julia, but in my specific case of having a shared library that depends on the Julia C-API specifically, this dependency is necessary.

Furthermore, it's incorrect to say that libjulia is only there to build jlls itself. libjulia provides the shared library, the Julia executable which in this case is needed for FindJulia.cmake, as well as the headers for the Julia C-API julia/julia.h, all of which are needed for my case and are not provided by any other jll or the BinaryBuilder sandbox SDK.

Thank you for the critique, I realize that my jlls are very messy and suspicious since I was forced to split them for each OS, which is bad style. That is also why I didn't upload them to yggrdasil, I really want it to just be one mousetrap_jll, but I have been unable to achieve that.

See here for my reasoning and information on how to contribute.

You need libjulia_jll during build time, but not runtime, so it should be a BuildDependency, not a Dependency.

Note that I maintain multiple JLLs using Julia APIs, and am one of the people maintaining libjulia_jll for just that purpose.

I suggest you open a PR for Yggdrasil with your primary JLL, and we can help you merge the three ones into a single one, and give other feedback on it.

Okay, I understand then, thank you. I will change it to BuildDependency with the next version.

What do you mean with "primary" JLL? My issue is that all three jlls have different dependencies, including non-JLL dependencies. I'm unsure of which of them I should open the PR for.

Apologies. I should have said something like: "submit a moustrap_jll based on one of three JLL recipes, plus pointers to the build files for the other two"

Okay thank you, I will do that.

I'll leave this issue open until the BuildDependency was changed and deployed.