-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gnuradio: rewrite #99685
gnuradio: rewrite #99685
Conversation
2338f84
to
8b984f5
Compare
Hey, first of all, thanks for all your work on this, gnuradio is a real beast with all its reverse dependencies and wrappers. I tried to test your branch, checking out your branch and doing $ git log --oneline -n 1
8b984f5c78d (HEAD -> pkg/gnuradio, doronbehar/pkg/gnuradio) treewide/(gnuradio plugins): Add log4cpp as it's needed now.
$ nix-build -A gnuradio
[...]
$ ls -l result
lrwxrwxrwx 1 akrimm users 68 6. Okt 10:13 result -> /nix/store/pysmpxcsbrb49shlqdm0qlhgknwzyh4c-gnuradio-wrapped-3.8.2.0
$ result/bin/gnuradio-companion
Traceback (most recent call last):
File "/nix/store/pysmpxcsbrb49shlqdm0qlhgknwzyh4c-gnuradio-wrapped-3.8.2.0/bin/.gnuradio-companion-wrapped", line 59, in check_gtk
gi.require_version('Gtk', '3.0')
File "/nix/store/4c1scdiqkyjlplqmd0f2w62yxm5l0fp5-python3-3.8.5-env/lib/python3.8/site-packages/gi/__init__.py", line 129, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available
During handling of the above exception, another exception occurred:
``` bash
Traceback (most recent call last):
File "/nix/store/pysmpxcsbrb49shlqdm0qlhgknwzyh4c-gnuradio-wrapped-3.8.2.0/bin/.gnuradio-companion-wrapped", line 100, in <module>
check_gtk()
File "/nix/store/pysmpxcsbrb49shlqdm0qlhgknwzyh4c-gnuradio-wrapped-3.8.2.0/bin/.gnuradio-companion-wrapped", line 67, in check_gtk
die(err, "Failed to initialize GTK. If you are running over ssh, "
File "/nix/store/pysmpxcsbrb49shlqdm0qlhgknwzyh4c-gnuradio-wrapped-3.8.2.0/bin/.gnuradio-companion-wrapped", line 41, in die
gi.require_version('Gtk', '3.0')
File "/nix/store/4c1scdiqkyjlplqmd0f2w62yxm5l0fp5-python3-3.8.5-env/lib/python3.8/site-packages/gi/__init__.py", line 129, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available From your comment in the meta issue i gathered that the wrapper is working for you. Any idea what I'm doing different? |
8b984f5
to
7678dd6
Compare
Hey and thanks for testing. It's all in the environment.
It's not your fault, it's due to a known impurity of Nixpkgs' & the OS' design. I use Gnome and by default my environment is more polluted. What I pushed now should (I hope) fix the issue for you - I tested |
Oh and don't worry these changes won't trigger a rebuild of it all :) - just the wrapper :). [That's the beauty of an external wrapper]. |
Ok, thanks for the fast reply and the fix. There was one more 'impurity' preventing grc from launching, since 3.8.2 gnuradio expects I'm also missing all the icons, but I have that with other programs, too, I think thats a problem of my session configuration. But I have a running gnuradio-companion. With with qtgui enabled, I get the following stacktrace
This is probably a similar problem as the first problem but this time for QT instead of gtk, right? |
7678dd6
to
735a809
Compare
Once again thanks for the tests. Your help is valuable. We could add glib to the
What Window manager are you using?
Interesting stacktrace. It seems as if Gnuradio's qt-gui feature is not compatible with qt5.14, but expects 5.15. The build of this feature is used with But, the final derivation doesn't even retain references to qtbase for instance. Hence I conclude that it's an environment issue.
I've updated once more the wrapper to set |
i3wm, but I've just confirmed that I have Icons on a different machine, so I guess it's related to my configuration.
I launch ./result/bin/gnuradio-companion from the command line, then there was a flowchart with a cosine signal source connected to an audio sink (not sure if that was from previous experimentation or if it is the default demo flowgraph) and then I press F6 to generate and launch the flowgraph.
$ env | grep QT_PLUGIN_PATH
QT_PLUGIN_PATH=/home/akrimm/.nix-profile/lib/qt4/plugins:/home/akrimm/.nix-profile/lib/kde4/plugins:/etc/profiles/per-user/akrimm/lib/qt4/plugins:/etc/profiles/per-user/akrimm/lib/kde4/plugins:/nix/var/nix/profiles/default/lib/qt4/plugins:/nix/var/nix/profiles/default/lib/kde4/plugins:/run/current-system/sw/lib/qt4/plugins:/run/current-system/sw/lib/kde4/plugins your wrapper then adds:
Still the same stacktrace unfortunately :/ Through the use of LD_DEBUG and ldd I found this: $ ldd /nix/store/4c1scdiqkyjlplqmd0f2w62yxm5l0fp5-python3-3.8.5-env/lib/python3.8/site-packages/gnuradio/qtgui/_qtgui_swig.so | grep Qt5Core
libQt5Core.so.5 => /nix/store/3hgcmz192jqdkc98r6pixamv3v09ibfn-qtbase-5.15.0/lib/libQt5Core.so.5 (0x00007f4921478000)
$ ldd /nix/store/4c1scdiqkyjlplqmd0f2w62yxm5l0fp5-python3-3.8.5-env/lib/python3.8/site-packages/PyQt5/QtCore.so | grep Qt5Core
libQt5Core.so.5 => /nix/store/0n3h96is5klddhnin5kxf7bfxqx6ard3-qtbase-5.14.2/lib/libQt5Core.so.5 (0x00007fdfd6c59000) I also tried generating C++ instead of python, as the dependency problems seem to come through the python modules, but it does not compile (didn't really expect it to, as the feature is pretty new and I'm not sure where it should get its compile environment from in nix, I guess first priority is getting existing functionality to work and then the new features). |
Ok thanks again for the investigation! The issue is: #99937 also experienced here: #99465 (comment) . |
This PR should wait for #99937 . |
735a809
to
985c203
Compare
@doronbehar thanks for tackling this mega task. I will do some testing on weekend. |
985c203
to
894b86f
Compare
I think I'll leave these env vars never the less, just in case. In the meantime, I think the mismatched qt versions issue should be fixed, but it will trigger another rebuild of the
Likely. I think you should install an icon pack, such as
If the qt gui test will pass now, this is worth checking once more, in your own time @wirew0rm . Thanks again for your help. |
894b86f
to
24f9480
Compare
Rebased to master without the qt override, thanks to #99956 now merged. |
576aabd
to
435da11
Compare
I've had a slight misunderstanding regarding swig python deps which upstream explained to me in gnuradio/gnuradio#3874 . Now all patches are fetched with
A unnecessary patch was removed and gr-osmosdr and gqrx still build. |
I've tried to use gnuradio-with-packages but the modules are failing to import.
|
Thanks for the report @evrim. Could you please recheck now? Indeed I had a python path missing for the wrapper. it should not trigger for you a rebuild of the unwrapped derivation. |
I checked again. The source plugins are back now but the wx GUI widgets are gone now. It would be good to have them in the standard build since a lot of flow graphs are still make heavy use of them. |
OK. I disabled them by default initially because even versions pre 3.7.14 considered them deprecated, but I guess there's no harm in enabling them. I do get some warnings though:
And I suspect this is due to the fact that the wx packages are a bit of a mess: nixpkgs/pkgs/top-level/python-packages.nix Lines 7671 to 7684 in 00ecee0
nixpkgs/pkgs/top-level/all-packages.nix Lines 16146 to 16180 in 00ecee0
But this is out of scope for this PR. |
Let's give it a try if it works. Unfortunately a lot of legacy flow graphs and flow graph examples still make use of the wx widgets.To make things worse: the QT GUI blocks are not 100% identical replacements of the wx GUI blocks. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/python-2-7-and-3-9-and-hydra-builds/10130/3 |
Write (similar) expressions for GNURadio 3.7 and 3.8 and make 3.8 available as `gnuradio`, and `gnuradio3_7` point to the 3.7 build. Teach both 3.7 & 3.8 expressions accept a `features` attribute set, that tells them what features to compile. There are dependencies within the different features, and we rely on upstream's cmake scripts to make sure the `configurePhase` will fail if a feature is not enabled and needed by another feature. All features are enabled by default. Put shared Nix functions and attributes for both 3.7 and 3.8 in: pkgs/applications/radio/gnuradio/shared.nix Add 2 patches accepted upstream, that don't install some python related examples if python-support is not enabled. Remove cmake python reference in 3.8 with removeReferencesTo, if python-support is turned off. Update gqrx (reverse dependency) to use a build of gnuradio3_7 without gui components and for it's gr-osmosdr as well. Write an external, `wrapper.nix` (shared for both 3.7 and 3.8). Teach it to handle extra `gr-` packages via `GRC_BLOCKS_PATH`. Likely enable it to accept extra python packages. Wrap the executables with env vars wrapGAppsHook and wrapQtAppsHook would have likely given them (hence, fix NixOS#87510). Point `gnuradio` to the wrapped 3.8 derivation. Add @doronbehar to maintainers of both 3.8 and 3.7. dirty: use upstreamed patches
Since gnuradio-runtime is compiled with log4cpp, all plugins that need gnuradio-runtime (which is all of them probably) need log4cpp as well. Add python.pkgs.cheetah to inputs of gr-osmosdr as it somehow started to be needed.
Mention 3.8 and that it's now possible to override it and 3.7 to compile only certain features.
ac7f9d2
to
0f615e8
Compare
Fixed some merge conflicts along with a rebase. Sill waiting for a final approval @markuskowa :). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It looks pretty good now.
Hallelujah 🍻 . |
I have plans for a gnuradio packages set and more improvements, but I don't have time yet to submit them. They are available if anyone is interested in some branches of mine: https://github.com/doronbehar/nixpkgs/compare/pkg/gnuradio.dirty/packages The only commit there is: And it needs to be split and perhaps more comments are needed in the files. |
Motivation for this change
Address some issues in #82263 .
Close #102116 .
Things done
It's in the commit messages and the comments. All affected packages should build.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)