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

libselinux: fix cross compilation #51201

Merged
merged 2 commits into from Dec 9, 2018
Merged

Conversation

eburimu
Copy link
Contributor

@eburimu eburimu commented Nov 29, 2018

Motivation for this change

Fixes the following:

  9981 make[1]: Leaving directory '/build/libselinux-2.7/man'
  9982 make -C src install-pywrap install-pywrap
  9983 make[1]: Entering directory '/build/libselinux-2.7/src'
  9984 /nix/store/06vmwfva8phjx2s8a53xvq0p062kyqsf-bash-4.4-p23/bin/bash: python: command not found
  9985 /nix/store/06vmwfva8phjx2s8a53xvq0p062kyqsf-bash-4.4-p23/bin/bash: python: command not found
  9986 /nix/store/06vmwfva8phjx2s8a53xvq0p062kyqsf-bash-4.4-p23/bin/bash: python: command not found
  9987 /nix/store/06vmwfva8phjx2s8a53xvq0p062kyqsf-bash-4.4-p23/bin/bash: python: command not found
  9988 /nix/store/06vmwfva8phjx2s8a53xvq0p062kyqsf-bash-4.4-p23/bin/bash: python: command not found
  9989 /nix/store/06vmwfva8phjx2s8a53xvq0p062kyqsf-bash-4.4-p23/bin/bash: python: command not found
  9990 /nix/store/06vmwfva8phjx2s8a53xvq0p062kyqsf-bash-4.4-p23/bin/bash: python: command not found
  9991 bash -e exception.sh > selinuxswig_python_exception.i || (rm -f selinuxswig_python_exception.i ; false)
  9992 swig -Wall -python -o selinuxswig_wrap.c -outdir ./  -DNO_ANDROID_BACKEND selinuxswig_python.i
  9993 /nix/store/06vmwfva8phjx2s8a53xvq0p062kyqsf-bash-4.4-p23/bin/bash: swig: command not found
  9994 make[1]: *** [Makefile:169: selinuxswig_wrap.c] Error 127
  9995 make[1]: Leaving directory '/build/libselinux-2.7/src'
  9996 make: *** [Makefile:57: install-pywrap] Error 2
  9997 builder for '/nix/store/4dl2jxsfcapgkaz99ddi35bvm1b6w7a7-libselinux-2.7-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 2
  9998 error: build of '/nix/store/4dl2jxsfcapgkaz99ddi35bvm1b6w7a7-libselinux-2.7-armv7l-unknown-linux-gnueabihf.drv' failed
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.

@Ericson2314
Copy link
Member

Ericson2314 commented Nov 29, 2018

Do they need to be buildInputs? Perhaps just nativeBuildInputs is enough. Did you test the bindings? I suspect the python wrappers around most C libraries are extra likely to be incompatible with cross compilation anyways, because it is not obvious how to combine cross compilation with interpreters. If they don't work, you should instead change the default on enablePython.

@eburimu
Copy link
Contributor Author

eburimu commented Nov 29, 2018

@Ericson2314 I thought native would be enough but it somehow doesn't (tried). I still do not know how to tackle w/ host=build=x86 target=arm python. Maybe @matthewbauer can enlighten us.

@c0bw3b c0bw3b added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Nov 29, 2018
@matthewbauer
Copy link
Member

@GrahamcOfBorg build libselinux

@matthewbauer
Copy link
Member

@GrahamcOfBorg build pkgsCross.aarch64-multiplatform.libselinux

libselinux needs native python to compute the installation prefix.
Swig generates the c code for the extension and needs python.h at compile,
so we put python into buildInputs
@Mic92
Copy link
Member

Mic92 commented Dec 9, 2018

libselinux needs native python to compute the installation prefix.
Swig generates the c code for the extension and needs python.h at compile,
so we put python into buildInputs.
The generated shared library is correct.

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: 501+
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants