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

radare2: cross-build #51831

Merged
merged 1 commit into from Dec 10, 2018
Merged

radare2: cross-build #51831

merged 1 commit into from Dec 10, 2018

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Dec 10, 2018

Motivation for this change
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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Only the make-based build support cross-compilation.
Also use less vendored libraries
@Mic92 Mic92 added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Dec 10, 2018
@Mic92
Copy link
Member Author

Mic92 commented Dec 10, 2018

staging because I have some other fixes in this branch.

@grahamc
Copy link
Member

grahamc commented Dec 10, 2018

@GrahamcOfBorg build radare2

@Mic92 Mic92 merged commit fee79f5 into NixOS:staging Dec 10, 2018
@Mic92 Mic92 deleted the cross-radare2 branch December 10, 2018 19:35
@timokau
Copy link
Member

timokau commented Jan 7, 2019

This broke the radare2-cutter build:

In file included from /nix/store/5wbr8krll8l03kcb6ibhfyshz5mbr2hy-radare2-2018-10-07/include/libr/r_core.h:8:0,
                 from Cutter.h:4,
                 from MainWindow.h:6,
                 from CutterApplication.h:8,
                 from Main.cpp:2:
/nix/store/5wbr8krll8l03kcb6ibhfyshz5mbr2hy-radare2-2018-10-07/include/libr/r_magic.h:20:10: fatal error: magic.h: No such file or directory
 #include <magic.h>
          ^~~~~~~~~
compilation terminated.
make: *** [Makefile:2041: Main.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from /nix/store/5wbr8krll8l03kcb6ibhfyshz5mbr2hy-radare2-2018-10-07/include/libr/r_core.h:8:0,
                 from ./Cutter.h:4,
                 from utils/Configuration.h:6,
                 from Cutter.cpp:8:
/nix/store/5wbr8krll8l03kcb6ibhfyshz5mbr2hy-radare2-2018-10-07/include/libr/r_magic.h:20:10: fatal error: magic.h: No such file or directory
 #include <magic.h>
          ^~~~~~~~~
compilation terminated.
make: *** [Makefile:2050: Cutter.o] Error 1
In file included from /nix/store/5wbr8krll8l03kcb6ibhfyshz5mbr2hy-radare2-2018-10-07/include/libr/r_core.h:8:0,
                 from ./Cutter.h:4,
                 from ./utils/Configuration.h:6,
                 from utils/RichTextPainter.cpp:4:
/nix/store/5wbr8krll8l03kcb6ibhfyshz5mbr2hy-radare2-2018-10-07/include/libr/r_magic.h:20:10: fatal error: magic.h: No such file or directory
 #include <magic.h>
          ^~~~~~~~~
compilation terminated.
make: *** [Makefile:2072: RichTextPainter.o] Error 1
In file included from /nix/store/5wbr8krll8l03kcb6ibhfyshz5mbr2hy-radare2-2018-10-07/include/libr/r_core.h:8:0,
                 from ./Cutter.h:4,
                 from ./widgets/GraphView.h:16,
                 from widgets/DisassemblerGraphView.h:11,
                 from widgets/DisassemblerGraphView.cpp:1:
/nix/store/5wbr8krll8l03kcb6ibhfyshz5mbr2hy-radare2-2018-10-07/include/libr/r_magic.h:20:10: fatal error: magic.h: No such file or directory
 #include <magic.h>
          ^~~~~~~~~
compilation terminated.
make: *** [Makefile:2064: DisassemblerGraphView.o] Error 1
builder for '/nix/store/vhj3yv30qzyn7kag6sw62zpw1sfkamcs-radare2-cutter-1.7.2.drv' failed with exit code 2
error: build of '/nix/store/vhj3yv30qzyn7kag6sw62zpw1sfkamcs-radare2-cutter-1.7.2.drv' failed

@timokau
Copy link
Member

timokau commented Jan 7, 2019

Adding file, libzip and xxHash to cutters buildInputs fixes the build. Not sure if it should be propagatedBuildInputs of r2 instead.

@timokau timokau mentioned this pull request Jan 8, 2019
10 tasks
@timokau
Copy link
Member

timokau commented Jan 8, 2019

Fixed in #53667. I have no idea why it is necessary to explicitly propagate these libraries though. Doesn't that usually work automatically?

@Mic92
Copy link
Member Author

Mic92 commented Jan 8, 2019

That would happen automatically if radare2's pkgconfig file would define a dependency on the libraries, i.e. add include paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different sort platform than than they will be run on 10.rebuild-darwin: 0 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants