-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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: Enable Darwin Support #27344
Conversation
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.
some notes.
@@ -26,11 +26,15 @@ stdenv.mkDerivation rec { | |||
done | |||
''; | |||
|
|||
patches = [ ./fix-volk.patch ]; |
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.
Can you also send this patch upstream?
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.
Upstream hasn't had any activity in 2+yr. Macports seems to have taken the same route and included the patch with the build definition
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.
They might accept straight forward build-fixes though. In the worst case, you still raise awareness and somebody can profit from the patch.
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.
Should I update the file to point to my PR commit?
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.
A link would be nice.
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.
Unless you have an objection, I'm going to change the rev
to point to my PR commit, since it removes the need to include the patch here
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.
It's up
buildInputs = [ | ||
autoreconfHook pcsclite pkgconfig | ||
autoreconfHook pkgconfig git |
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.
at least autoreconfHook
, pkgconfig
can be moved to nativeBuildInputs
. Is git really required here?
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.
Nope, git isn't required. I added it while resolving a few compilation errors and never removed it
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.
This commit should be split. It does way more than "enabling darwin support". For instance, I don't like that it removes wrapping of the examples, because that breaks them.
Oh, I thought I reviewed only one commit, but it appears github meant it was for the whole PR. For the remaining changes, please rebase/squash so that there is one logical change per commit. |
061daa9
to
8d778b9
Compare
I split the gnuradio commit for more clarity and reverted that specific change.
I also reordered and split changes to dependencies of gnuradio to make the history more clear, in addition to rebasing on top of master. Hopefully it helps! I apologize for dumping one large commit; I got too aggressive with squashing on my end |
8d778b9
to
3a88160
Compare
@lukeadams: Thank you! That was easy to review. You even split the commits more than I imagined :-) Does each commit represent a strict improvement and no regressions? I ask because it seems that e.g. the "qwt6_qt4: fixupPhase: Repair relative reference in darwin framework ..." comes a bit late in the sequence. Perhaps squash into "qwt6_qt4: Fix darwin build [by adding AGL input]" or something? (What constitutes a logical change is always up for discussion. A "Fix Darwin build" that does a bunch of stuff is also valid.) Sorry if I misread the PR, but my point is simply that each commit moves the code base forward linearly. In general, if one commit says "this fixes the build" but then a later one is also needed to really fix the build, then that's not good. Commits should not be split so much that it breaks "git bisect" either. |
Glad you liked it! For the rest of it, I made sure any changes required for darwin were committed before enabling darwin building. For example d3d567e has prerequisites for gr-ais darwin compilation, but darwin is not enabled till a later commit. None of the commits break the build, but some may prevent the build from breaking in preparation for darwin building. For some reason Github is showing the commits in the wrong order, which makes it a little confusing to look at. They show up correctly in git log though. Should I try to get the timestamps in order or is it fine? Is there any way to "test" if git-bisect is broken by any of my commits? Running git bisect start on a clean copy of my branch shows no errors (although I haven't had the chance to use it so I'm not familiar). thanks for taking the time to review this, this is my first real attempt to contribute to nixpkgs and I really appreciate it |
@lukeadams: Great. Just wanted to check (commit order). As for "git bisect" checking. I mostly just think about the commit sequence. To actually verify it you have to do some building. Or a lot, depending on PR rebuild footprint and number of commits. I run
And that you'd have to run on each commit. You can do I tried to build this PR on top of master and got this failure in the end (NixOS, x86_64-linux):
Some small nitpick I found after a 2nd look. You don't have to fix them, but it'd be nice.
|
Extremely insightful! I'll play around with git bisect today when I get the chance. I just fixed the qa_qtgui failure. The error was And I might as well fix the style issues! I'll do it while I'm fixing the above. nixpkgs.urh seems to be enabled on darwin now, but won't compile due to some QT59 build error. This is because urh sets platforms to platforms.unix and this PR enables darwin support for all of its inputs, so I might make urh explicitly linux-only for now. |
457ec1c
to
d44497b
Compare
@bjornfor I resolved the stylistic issues (whitespace and commit message related). I've also disabled that specific failing test on Linux. I'm rebuilding on Darwin and NixOS to be sure nothing broke after rebasing against master. Sorry about the extensive reviewing work - I've learned so much from this! |
@@ -68,7 +68,7 @@ stdenv.mkDerivation rec { | |||
for file in "$out"/bin/* "$out"/share/gnuradio/examples/*/*.py; do | |||
wrapProgram "$file" \ | |||
--prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath "$out") \ | |||
--set MATPLOTLIBRC "$out/share/gnuradio" | |||
--set MATPLOTLIBRC "$out/share/gnuradio" ${stdenv.lib.optionalString stdenv.isDarwin " --set DYLD_FRAMEWORK_PATH /System/Library/Frameworks"} |
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.
Wrap this line?
--set MATPLOTLIBRC "$out/share/gnuradio" \
${stdenv.lib.optionalString stdenv.isDarwin ... }
rev = "1863d1bf8a7709a8dfedb3ddb8e2b99112e7c872"; | ||
sha256 = "1vl3kk8xr2mh5lf31zdld7yzmwywqffffah8iblxdzblgsdwxfl6"; | ||
# Upstream PR: https://github.com/bistromath/gr-ais/commit/8502d0252a2a1a9b8d1a71795eaeb5d820684054 | ||
"rev" = "8502d0252a2a1a9b8d1a71795eaeb5d820684054"; |
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.
Don't forget to update "version" above.
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.
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.
Yes, version should be the commit date (for unversioned repositories).
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.
It seems weird that version goes back one year. Can you clarify a bit in the commit message what's going on here? Also, perhaps make a point of switching from building upstream branch to a PR.
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.
Not sure where the 2016-08-26 date even originated from as the commit referenced (bistromath/gr-ais@1863d1b) is on the date I changed it to.
But yeah I'll add both for clarification
I started a build on NixOS (too), and ended up with this result:
|
Hmm, that one (possibly along with a few others) is intermittent based on the amount of CPU usage since it basically generates large amounts of data and operates on the data stream. Although it didn't fail on my NixOS build, I'm going to go through and disable any tests that may cause non-deterministic behavior. |
4c8de22
to
82688be
Compare
@bjornfor I've added a "grSkipTests" list to allow simpler test skipping in the future, in addition to skipping tests which seem to fail regularly. (4494343) Darwin succeeded without any issues after multiple runs. NixOS succeeded as well |
add new required talloc, python2 inputs; enableParallelBuilding
3973172
to
55b888f
Compare
This prevents CoreFoundation-related crashes
enables gnuradio-companion compilation in headless/nix-multiuser environment
-std=c++11 causes errors with OBJ-C files on Darwin. Inject dynamic compiler flag into every cmake file to work around this.
this version includes GCC6 improvements
- Issue fixed in my PR (bistromath/gr-ais@8502d02) - The commit date of the original src is "2015-12-20" not "2016-08-26" (version hasn't changed)
55b888f
to
367e5f7
Compare
@bjornfor I fixed the stylistic issues you mentioned. Let me know if there's anything else! |
@lukeadams: Thanks! |
@bjornfor Thanks for the guidance and help with this PR. I just got one of my workstations reconfigured and was happy to see that it's all in the binary cache for darwin, and it even works on High Sierra! ;) |
Motivation for this change
This PR enables Darwin build support for Gnuradio.
To accomplish this, it also:
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)Continuation of #26144