meshlab{,-unstable}: add darwin support#396295
Conversation
|
I am working on adding Darwin support for meshlab, which is a Qt-based application that includes many plugins. I successfully built it and was able to run the application, but unfortunately, none of the plugins are loading. DetailsThe error messages I am encountering are as follows:I don't see any dynamic dependency errors: Is there any guidance for debugging or documentation regarding Qt on Nix? Any help would be appreciated! |
0bca27d to
996da13
Compare
|
Maybe not something that helps you immediately, but those .so files should probably be .dylib files, as that is the darwin library format. I would start looking where they are built to see why you get .so files (as that usually indicates a linux build). |
|
@dwt Thanks for your help — it's never too late and always appreciated! |
|
Strange, they might do something mighty strange upstream to make .so files work? Maybe check with |
996da13 to
415adf5
Compare
|
Hmm. They're not actually in Linux ELF $ # A normal library looks like this:
$ file /nix/store/ickjwia7gqgkcxgk8w2xqfnagys2si6c-lua-5.1.5/lib/liblua.dylib
/nix/store/ickjwia7gqgkcxgk8w2xqfnagys2si6c-lua-5.1.5/lib/liblua.dylib: Mach-O 64-bit dynamically linked shared library x86_64
$ # This is a plugin from the official MeshLab release:
$ file /Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so
/Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so: Mach-O 64-bit bundle x86_64
$ # And this is one from this derivation:
$ nix build 'github:yzx9/nixpkgs/feature/meshlab-darwin#meshlab'
$ file result/Applications/meshlab.app/Contents/PlugIns/libdecorate_background.so
result/Applications/meshlab.app/Contents/PlugIns/libdecorate_background.so: Mach-O 64-bit executable x86_64
$ # Wait, really? An executable?
$ nm -U result/Applications/meshlab.app/Contents/PlugIns/libdecorate_background.so
0000000100003048 D _DOCSTRING
0000000100003040 d __dyld_private
0000000100000000 T __mh_execute_header
000000010000163a T _main
0000000100001569 T _set_env_prefix
$ # Yep, there's a `main()`… and not much else. What does it do?
$ result/Applications/meshlab.app/Contents/PlugIns/libdecorate_background.so; echo $?
255
$ # Not much. And the official plugin?
$ nm -U /Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so
[…way more symbols than that, none of which are `_main`…]
$ /Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so
zsh: exec format error: /Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so
$ # The list of dependencies is also much longer for the working plugins:
$ otool -L /Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so
/Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so:
@rpath/libmeshlab-common.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL (compatibility version 5.15.0, current version 5.15.2)
@loader_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.15.0, current version 5.15.2)
@loader_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.15.0, current version 5.15.2)
@loader_path/../Frameworks/QtXml.framework/Versions/5/QtXml (compatibility version 5.15.0, current version 5.15.2)
@loader_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.15.0, current version 5.15.2)
@loader_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.15.0, current version 5.15.2)
@loader_path/../Frameworks/libomp.dylib (compatibility version 5.0.0, current version 5.0.0)
@rpath/libexternal-glew.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
$ otool -L result/Applications/meshlab.app/Contents/PlugIns/libio_base.so
result/Applications/meshlab.app/Contents/PlugIns/libio_base.so:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)Footnotes
|
|
Ah, I see what's happening! All the plugins are incorrectly getting wrapped by $ ls -alh result/Applications/meshlab.app/Contents/PlugIns/
total 20M
dr-xr-xr-x 124 root wheel 3.9K Dec 31 1969 .
dr-xr-xr-x 8 root wheel 256 Dec 31 1969 ..
-r-xr-xr-x 1 root wheel 83K Dec 31 1969 .libdecorate_background.so-wrapped
-r-xr-xr-x 1 root wheel 263K Dec 31 1969 .libdecorate_base.so-wrapped
-r-xr-xr-x 1 root wheel 260K Dec 31 1969 .libdecorate_raster_proj.so-wrapped
-r-xr-xr-x 1 root wheel 193K Dec 31 1969 .libdecorate_shadow.so-wrapped
-r-xr-xr-x 1 root wheel 662K Dec 31 1969 .libedit_align.so-wrapped
-r-xr-xr-x 1 root wheel 114K Dec 31 1969 .libedit_manipulators.so-wrapped
-r-xr-xr-x 1 root wheel 76K Dec 31 1969 .libedit_measure.so-wrapped
-r-xr-xr-x 1 root wheel 284K Dec 31 1969 .libedit_paint.so-wrapped
-r-xr-xr-x 1 root wheel 204K Dec 31 1969 .libedit_pickpoints.so-wrapped
-r-xr-xr-x 1 root wheel 137K Dec 31 1969 .libedit_point.so-wrapped
-r-xr-xr-x 1 root wheel 233K Dec 31 1969 .libedit_quality.so-wrapped
-r-xr-xr-x 1 root wheel 261K Dec 31 1969 .libedit_referencing.so-wrapped
-r-xr-xr-x 1 root wheel 99K Dec 31 1969 .libedit_sample.so-wrapped
-r-xr-xr-x 1 root wheel 127K Dec 31 1969 .libedit_select.so-wrapped
-r-xr-xr-x 1 root wheel 145K Dec 31 1969 .libfilter_ao.so-wrapped
-r-xr-xr-x 1 root wheel 114K Dec 31 1969 .libfilter_camera.so-wrapped
-r-xr-xr-x 1 root wheel 321K Dec 31 1969 .libfilter_clean.so-wrapped
-r-xr-xr-x 1 root wheel 152K Dec 31 1969 .libfilter_color_projection.so-wrapped
-r-xr-xr-x 1 root wheel 246K Dec 31 1969 .libfilter_colorproc.so-wrapped
-r-xr-xr-x 1 root wheel 269K Dec 31 1969 .libfilter_create.so-wrapped
-r-xr-xr-x 1 root wheel 116K Dec 31 1969 .libfilter_createiso.so-wrapped
-r-xr-xr-x 1 root wheel 145K Dec 31 1969 .libfilter_developability.so-wrapped
-r-xr-xr-x 1 root wheel 232K Dec 31 1969 .libfilter_dirt.so-wrapped
-r-xr-xr-x 1 root wheel 100K Dec 31 1969 .libfilter_embree.so-wrapped
-r-xr-xr-x 1 root wheel 178K Dec 31 1969 .libfilter_fractal.so-wrapped
-r-xr-xr-x 1 root wheel 297K Dec 31 1969 .libfilter_func.so-wrapped
-r-xr-xr-x 1 root wheel 193K Dec 31 1969 .libfilter_geodesic.so-wrapped
-r-xr-xr-x 1 root wheel 440K Dec 31 1969 .libfilter_icp.so-wrapped
-r-xr-xr-x 1 root wheel 328K Dec 31 1969 .libfilter_img_patch_param.so-wrapped
-r-xr-xr-x 1 root wheel 214K Dec 31 1969 .libfilter_layer.so-wrapped
-r-xr-xr-x 1 root wheel 204K Dec 31 1969 .libfilter_measure.so-wrapped
-r-xr-xr-x 1 root wheel 1.3M Dec 31 1969 .libfilter_meshing.so-wrapped
-r-xr-xr-x 1 root wheel 290K Dec 31 1969 .libfilter_mls.so-wrapped
-r-xr-xr-x 1 root wheel 966K Dec 31 1969 .libfilter_plymc.so-wrapped
-r-xr-xr-x 1 root wheel 168K Dec 31 1969 .libfilter_qhull.so-wrapped
-r-xr-xr-x 1 root wheel 91K Dec 31 1969 .libfilter_quality.so-wrapped
-r-xr-xr-x 1 root wheel 159K Dec 31 1969 .libfilter_sample_gpu.so-wrapped
-r-xr-xr-x 1 root wheel 55K Dec 31 1969 .libfilter_sample.so-wrapped
-r-xr-xr-x 1 root wheel 607K Dec 31 1969 .libfilter_sampling.so-wrapped
-r-xr-xr-x 1 root wheel 559K Dec 31 1969 .libfilter_screened_poisson.so-wrapped
-r-xr-xr-x 1 root wheel 196K Dec 31 1969 .libfilter_sdfgpu.so-wrapped
-r-xr-xr-x 1 root wheel 229K Dec 31 1969 .libfilter_select.so-wrapped
-r-xr-xr-x 1 root wheel 253K Dec 31 1969 .libfilter_sketchfab.so-wrapped
-r-xr-xr-x 1 root wheel 1.7M Dec 31 1969 .libfilter_texture_defragmentation.so-wrapped
-r-xr-xr-x 1 root wheel 757K Dec 31 1969 .libfilter_texture.so-wrapped
-r-xr-xr-x 1 root wheel 265K Dec 31 1969 .libfilter_trioptimize.so-wrapped
-r-xr-xr-x 1 root wheel 331K Dec 31 1969 .libfilter_unsharp.so-wrapped
-r-xr-xr-x 1 root wheel 705K Dec 31 1969 .libfilter_voronoi.so-wrapped
-r-xr-xr-x 1 root wheel 96K Dec 31 1969 .libio_3ds.so-wrapped
-r-xr-xr-x 1 root wheel 1.1M Dec 31 1969 .libio_base.so-wrapped
-r-xr-xr-x 1 root wheel 121K Dec 31 1969 .libio_bre.so-wrapped
-r-xr-xr-x 1 root wheel 366K Dec 31 1969 .libio_collada.so-wrapped
-r-xr-xr-x 1 root wheel 89K Dec 31 1969 .libio_ctm.so-wrapped
-r-xr-xr-x 1 root wheel 95K Dec 31 1969 .libio_expe.so-wrapped
-r-xr-xr-x 1 root wheel 96K Dec 31 1969 .libio_json.so-wrapped
-r-xr-xr-x 1 root wheel 207K Dec 31 1969 .libio_pdb.so-wrapped
-r-xr-xr-x 1 root wheel 84K Dec 31 1969 .libio_tri.so-wrapped
-r-xr-xr-x 1 root wheel 80K Dec 31 1969 .libio_txt.so-wrapped
-r-xr-xr-x 1 root wheel 441K Dec 31 1969 .libio_x3d.so-wrapped
-r-xr-xr-x 1 root wheel 144K Dec 31 1969 .librender_gdp.so-wrapped
-r-xr-xr-x 1 root wheel 161K Dec 31 1969 .librender_radiance_scaling.so-wrapped
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libdecorate_background.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libdecorate_base.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libdecorate_raster_proj.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libdecorate_shadow.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libedit_align.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libedit_manipulators.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libedit_measure.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libedit_paint.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libedit_pickpoints.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libedit_point.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libedit_quality.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libedit_referencing.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libedit_sample.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libedit_select.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_ao.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_camera.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_clean.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_color_projection.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_colorproc.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_create.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_createiso.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_developability.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_dirt.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_embree.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_fractal.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_func.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_geodesic.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_icp.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_img_patch_param.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_layer.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_measure.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_meshing.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_mls.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_plymc.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_qhull.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_quality.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_sample_gpu.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_sample.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_sampling.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_screened_poisson.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_sdfgpu.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_select.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_sketchfab.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_texture_defragmentation.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_texture.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_trioptimize.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_unsharp.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libfilter_voronoi.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libio_3ds.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libio_base.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libio_bre.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libio_collada.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libio_ctm.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libio_expe.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libio_json.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libio_pdb.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libio_tri.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libio_txt.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 libio_x3d.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 librender_gdp.so
-r-xr-xr-x 1 root wheel 17K Dec 31 1969 librender_radiance_scaling.soThe hook is looking for anything that has execute permission and is either an ELF or Mach-O file. Libraries have execute permission too, but normally that isn't an issue since the hook looks in Ideally the hook should probably be updated to make sure it's looking at actual executables, or at least limit itself to the |
|
@Rhys-T Wow, great job! I gave your solution a quick try, and I can confirm it works perfectly! |
415adf5 to
92751fb
Compare
13cb8a9 to
f0a0880
Compare
a933665 to
3bc6ada
Compare
3bc6ada to
831e9ed
Compare
|
@SuperSandro2000 Thanks for your review! I have change all the |
|
Hi @SuperSandro2000, may I ask for your review once more? |
|
|
@SuperSandro2000 The build failed due to the sandbox on Darwin. QT applications on Darwin require a sandbox profile, which blocks the sandboxed build. I was able to build the application before, |
|
This PR adds Darwin support for MeshLab.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.