[workflow][Nix] initial packaging & flake#5059
[workflow][Nix] initial packaging & flake#5059hugtalbot merged 14 commits intosofa-framework:masterfrom
Conversation
|
Thanks a lot @nim65s for your PR, that's awesome 🙌 |
|
Nice. |
|
Updated to Qt6, and fixed on macos. This required some fixes in upstream nixpkgs: NixOS/nixpkgs#348549, so until this is merged we have to use its source. |
| message("${PROJECT_NAME}: will use Qt6") | ||
| sofa_find_package(Qt6 COMPONENTS Gui GuiTools Widgets WidgetsTools OpenGLWidgets REQUIRED) | ||
| set(SOFA_GUI_QT_TARETS ${SOFA_GUI_QT_TARGETS} Qt::Core Qt::Gui Qt::Widgets Qt::OpenGLWidgets ) | ||
| find_package(Qt6 COMPONENTS Gui GuiTools Widgets WidgetsTools OpenGLWidgets REQUIRED) |
There was a problem hiding this comment.
I am not very familiar with Qt components. Can you give more details on the changes here? Thanks
There was a problem hiding this comment.
I am not familiar with those neither, but as a matter of fact, the Qt6GuiToolsConfig.cmake file does not define a Qt6::GuiTools CMake target. Therefore we can not rely on the presence of a Qt6::GuiTools CMake target to know how should we define SOFA_GUI_QT_HAVE_QT6.
But I don't know why we are looking for those CMake targets to define if SOFA_GUI_QT_HAVE_QT6 or not. My guess is that Qt6_FOUND should be enough.
|
@nim65s The command |
|
flakes and the
|
|
After a successful build, I have the following trace when running: |
|
Hum, yes, I only tested that on NixOS, sorry. I'll try on ubuntu, with x11 and wayland. I guess this is only a matter of selecting the correct QT_QPA_PLATFORM or something. |
|
Hi @nim65s Sorry for the delay in our reply, a mixture of things, including a vacation, have kept us away from the code for several days! Here we are again! Cheers |
|
Hi, Btw, I'll be in Lille from 25/11 to 30/11: https://wiki.2rm.cnrs.fr/AnfRust2024, same as sofa week, so we may find another discussions place there :) |
|
I finally got some time to spawn a 24.04 with wayland, and I could reproduce your issue. (that |
we use `#include <QGLViewer/qglviewer.h>`, so `QGLViewer_INCLUDE_DIR` must not include `QGLViewer` component. Also, on darwin, headers are installed in Headers dir, not include, ref: https://github.com/GillesDebunne/libQGLViewer/blob/ba9a875784afbb7ee73088fe0e8701c31bc7277d/QGLViewer/QGLViewer.pro#L138
This require fixes in upstream nixpkgs: NixOS/nixpkgs#348549 So we can use the source of that PR for now
without this, `lib/cmake/Sofa.GUI.Qt/Sofa.GUI.QtConfig.cmake` has: > `set(SOFA_GUI_QT_HAVE_QT6 0)` and therefore, in SofaPython3, `find_package(QGLViewer QUIET REQUIRED)` is not called, and build ends up with: > [ 98%] Linking CXX shared library ../../lib/python3/site-packages/Sofa/Gui.cpython-312-x86_64-linux-gnu.so > […]/ld: cannot find -lQGLViewer: No such file or directory
TODO: This should be fixed in CMake instead, but I have no clue. error was: > dyld[61665]: Library not loaded: /nix/store/aalbn4pznxwy18ydjmb15c3y4izj8isi-sofa-24.06.00/lib/libSceneChecking.24.12.99.dylib > Referenced from: <8B75C775-7FE5-3755-A190-B11A3F4F6666> /nix/store/aalbn4pznxwy18ydjmb15c3y4izj8isi-sofa-24.06.00/bin/.runSofa-24.12.99-wrapped > Reason: tried: '/nix/store/aalbn4pznxwy18ydjmb15c3y4izj8isi-sofa-24.06.00/lib/libSceneChecking.24.12.99.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/nix/store/aalbn4pznxwy18ydjmb15c3y4izj8isi-sofa-24.06.00/lib/libSceneChecking.24.12.99.dylib' (no such file), '/nix/store/aalbn4pznxwy18ydjmb15c3y4izj8isi-sofa-24.06.00/lib/libSceneChecking.24.12.99.dylib' (no such file), '/usr/local/lib/libSceneChecking.24.12.99.dylib' (no such file), '/usr/lib/libSceneChecking.24.12.99.dylib' (no such file, not in dyld cache) > zsh: abort ./result/bin/runSofa
|
Just updated the description of SOFA, else it's 👍 for me! |
Co-authored-by: Hugo <[email protected]>
|
I guess you need that :
Another better solution is to setup https://github.com/soupglasses/nix-system-graphics beforehand, but maybe this is a bit less easy to quickly test / document. |
Hi,
As discussed at Journées HPC INRIA in Lille, here is an initial nix package for sofa.
It also include a flake (and its lock), which is not mandatory, but ease the use of the package, with commands like
nix build, to compile the package in a sandboxnix develop, to provide a shell with an environment containing all required dependencies to build the project in the usual CMake waynix run, to start the software.All these commands take an optional path argument, defaulting to the current working directory, but we could also build / develop / run any commit / tag / branch / fork of the project with eg.
nix build github:sofa-framework/sofa(for master) ornix run github:nim65s/sofa/58ae0644d117aea880ed284f6cc0beb7e9802f96While here, this also setup some CI for this packaging, mostly to detect early:
But also, a nix binary cache can be set up with eg. https://www.cachix.org/, so that once a commit is build in CI, users & developers can directly use that cache instead of compiling themselves.
(it is also true in the other way: developers with write access to the cache can send their build result to it so that the CI will be instantaneous cache hit)
Here is an example of CI build log: https://github.com/nim65s/sofa/actions/runs/11306279152/job/31446709649
PS: I did not test on macos yet, so this is probably a bit early to expect it work. It at least require darwin signatures I guess, I'll try to test that this week, when I can use an apple system.
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if