Skip to content
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

Introduce hardware/bladeRF module #47297

Merged
merged 2 commits into from Dec 18, 2018
Merged

Introduce hardware/bladeRF module #47297

merged 2 commits into from Dec 18, 2018

Conversation

greydot
Copy link
Contributor

@greydot greydot commented Sep 24, 2018

Motivation for this change

Update libbladeRF to the latest version. Add module for easier system configuration.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@matthewbauer
Copy link
Member

@GrahamcOfBorg build libbladeRF

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libbladeRF

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/6n45kvydrlmv4ffind31sn1anqp5nd32-libbladeRF-2.0.2
shrinking /nix/store/6n45kvydrlmv4ffind31sn1anqp5nd32-libbladeRF-2.0.2/bin/bladeRF-fsk
shrinking /nix/store/6n45kvydrlmv4ffind31sn1anqp5nd32-libbladeRF-2.0.2/bin/bladeRF-cli
shrinking /nix/store/6n45kvydrlmv4ffind31sn1anqp5nd32-libbladeRF-2.0.2/lib/libbladeRF.so.2
gzipping man pages under /nix/store/6n45kvydrlmv4ffind31sn1anqp5nd32-libbladeRF-2.0.2/share/man/
strip is /nix/store/428gs2z4b8f9byvghzlpbjwjb3a7jwxx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/6n45kvydrlmv4ffind31sn1anqp5nd32-libbladeRF-2.0.2/lib  /nix/store/6n45kvydrlmv4ffind31sn1anqp5nd32-libbladeRF-2.0.2/bin
patching script interpreter paths in /nix/store/6n45kvydrlmv4ffind31sn1anqp5nd32-libbladeRF-2.0.2
checking for references to /build in /nix/store/6n45kvydrlmv4ffind31sn1anqp5nd32-libbladeRF-2.0.2...
/nix/store/6n45kvydrlmv4ffind31sn1anqp5nd32-libbladeRF-2.0.2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libbladeRF

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/0f7qn62iizqqag239ygwfv9xid325g8l-libbladeRF-2.0.2
shrinking /nix/store/0f7qn62iizqqag239ygwfv9xid325g8l-libbladeRF-2.0.2/lib/libbladeRF.so.2
shrinking /nix/store/0f7qn62iizqqag239ygwfv9xid325g8l-libbladeRF-2.0.2/bin/bladeRF-cli
shrinking /nix/store/0f7qn62iizqqag239ygwfv9xid325g8l-libbladeRF-2.0.2/bin/bladeRF-fsk
gzipping man pages under /nix/store/0f7qn62iizqqag239ygwfv9xid325g8l-libbladeRF-2.0.2/share/man/
strip is /nix/store/dxf1m7dhc4qb655bdljc1fsd74v1nag3-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/0f7qn62iizqqag239ygwfv9xid325g8l-libbladeRF-2.0.2/lib  /nix/store/0f7qn62iizqqag239ygwfv9xid325g8l-libbladeRF-2.0.2/bin
patching script interpreter paths in /nix/store/0f7qn62iizqqag239ygwfv9xid325g8l-libbladeRF-2.0.2
checking for references to /build in /nix/store/0f7qn62iizqqag239ygwfv9xid325g8l-libbladeRF-2.0.2...
/nix/store/0f7qn62iizqqag239ygwfv9xid325g8l-libbladeRF-2.0.2

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: libbladeRF

Partial log (click to expand)

[ 16%] Building C object host/libraries/libbladeRF/CMakeFiles/libbladerf_shared.dir/src/driver/thirdparty/adi/ad9361.c.o
/tmp/nix-build-libbladeRF-2.0.2.drv-0/source/host/libraries/libbladeRF/src/driver/thirdparty/adi/ad9361.c:44:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^~~~~~~~~~
1 error generated.
make[2]: *** [host/libraries/libbladeRF/CMakeFiles/libbladerf_shared.dir/build.make:583: host/libraries/libbladeRF/CMakeFiles/libbladerf_shared.dir/src/driver/thirdparty/adi/ad9361.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:216: host/libraries/libbladeRF/CMakeFiles/libbladerf_shared.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
builder for '/nix/store/lv38lzb3cflz5862iha509shq3ram89a-libbladeRF-2.0.2.drv' failed with exit code 2
error: build of '/nix/store/lv38lzb3cflz5862iha509shq3ram89a-libbladeRF-2.0.2.drv' failed

@markuskowa
Copy link
Member

CC @lukeadams any ideas how to fix the darwin build?

@greydot
Copy link
Contributor Author

greydot commented Oct 26, 2018

@markuskowa it seems that malloc.h is a non-standard Linux header. It could be removed probably, but I don't have a Mac to test the result.

@matthewbauer
Copy link
Member

It looks like they fixed it in Nuand/bladeRF@0cb4ea8#diff-d5dd492f2296bbf8a94924c15c9efc09
You can probably add it as a patch.

@greydot
Copy link
Contributor Author

greydot commented Oct 28, 2018

@GrahamcOfBorg build libbladeRF

@markuskowa
Copy link
Member

@GrahamcOfBorg build libbladeRF

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: libbladeRF

Partial log (click to expand)

[ 16%] Building C object host/libraries/libbladeRF/CMakeFiles/libbladerf_shared.dir/src/driver/thirdparty/adi/ad9361.c.o
/tmp/nix-build-libbladeRF-2.0.2.drv-0/source/host/libraries/libbladeRF/src/driver/thirdparty/adi/ad9361.c:44:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^~~~~~~~~~
1 error generated.
make[2]: *** [host/libraries/libbladeRF/CMakeFiles/libbladerf_shared.dir/build.make:583: host/libraries/libbladeRF/CMakeFiles/libbladerf_shared.dir/src/driver/thirdparty/adi/ad9361.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:216: host/libraries/libbladeRF/CMakeFiles/libbladerf_shared.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
builder for '/nix/store/h00wyqg17420f4lk5cyh0m4d1s5jxyy0-libbladeRF-2.0.2.drv' failed with exit code 2
error: build of '/nix/store/h00wyqg17420f4lk5cyh0m4d1s5jxyy0-libbladeRF-2.0.2.drv' failed

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libbladeRF

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/j6wv11a0fg5vp4bzxly2l5c6lk8d51a0-libbladeRF-2.0.2
shrinking /nix/store/j6wv11a0fg5vp4bzxly2l5c6lk8d51a0-libbladeRF-2.0.2/bin/bladeRF-fsk
shrinking /nix/store/j6wv11a0fg5vp4bzxly2l5c6lk8d51a0-libbladeRF-2.0.2/bin/bladeRF-cli
shrinking /nix/store/j6wv11a0fg5vp4bzxly2l5c6lk8d51a0-libbladeRF-2.0.2/lib/libbladeRF.so.2
gzipping man pages under /nix/store/j6wv11a0fg5vp4bzxly2l5c6lk8d51a0-libbladeRF-2.0.2/share/man/
strip is /nix/store/6dpnd5aniypn8124mmy8f88s4mq2zl07-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/j6wv11a0fg5vp4bzxly2l5c6lk8d51a0-libbladeRF-2.0.2/lib  /nix/store/j6wv11a0fg5vp4bzxly2l5c6lk8d51a0-libbladeRF-2.0.2/bin
patching script interpreter paths in /nix/store/j6wv11a0fg5vp4bzxly2l5c6lk8d51a0-libbladeRF-2.0.2
checking for references to /build in /nix/store/j6wv11a0fg5vp4bzxly2l5c6lk8d51a0-libbladeRF-2.0.2...
/nix/store/j6wv11a0fg5vp4bzxly2l5c6lk8d51a0-libbladeRF-2.0.2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libbladeRF

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/8czzkz8l6r5q01nifx63img8rc5i6h02-libbladeRF-2.0.2
shrinking /nix/store/8czzkz8l6r5q01nifx63img8rc5i6h02-libbladeRF-2.0.2/bin/bladeRF-cli
shrinking /nix/store/8czzkz8l6r5q01nifx63img8rc5i6h02-libbladeRF-2.0.2/bin/bladeRF-fsk
shrinking /nix/store/8czzkz8l6r5q01nifx63img8rc5i6h02-libbladeRF-2.0.2/lib/libbladeRF.so.2
gzipping man pages under /nix/store/8czzkz8l6r5q01nifx63img8rc5i6h02-libbladeRF-2.0.2/share/man/
strip is /nix/store/rpbg8gmqxhz8g61p1plz5d2srs84pvmv-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/8czzkz8l6r5q01nifx63img8rc5i6h02-libbladeRF-2.0.2/lib  /nix/store/8czzkz8l6r5q01nifx63img8rc5i6h02-libbladeRF-2.0.2/bin
patching script interpreter paths in /nix/store/8czzkz8l6r5q01nifx63img8rc5i6h02-libbladeRF-2.0.2
checking for references to /build in /nix/store/8czzkz8l6r5q01nifx63img8rc5i6h02-libbladeRF-2.0.2...
/nix/store/8czzkz8l6r5q01nifx63img8rc5i6h02-libbladeRF-2.0.2

sha256 = "1ccpa69vz2nlpdnxprh4rd1pgphk82z5lfmbrfdkn7srw6nxl469";
})
];

# Let us avoid nettools as a dependency.
patchPhase = ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one overrides the patch phase. Thus the patch is never applied. postPatch is the better choice here:

Suggested change
patchPhase = ''
postPatch= ''

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greydot Could you handle this comment? It should (hopefully) fix the darwin build :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ekleog done. Sorry for the delay.

@markuskowa markuskowa self-assigned this Nov 22, 2018
This allows to easily enable bladerf-related udev rules with nixos
configuration.
@markuskowa
Copy link
Member

@GrahamcOfBorg build libbladeRF

@markuskowa markuskowa merged commit 5289fcc into NixOS:master Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants