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

lighttpd: fix crosscompilation #61128

Merged
merged 1 commit into from May 9, 2019

Conversation

deadloko
Copy link
Contributor

@deadloko deadloko commented May 8, 2019

Motivation for this change

Lighttpd fails to cross compile.

Things done
  • Added pcre.dev as dependency, lighttpd requeres pcre-config to return lib location and compilation flags (actually just include directory).
  • Added preConfigure export with path to pcre-config.
  • Added stdenv.cc build dependency.
  • Tested (on arm board with services.lightppd.enable = true; services.lightppd.mod_status = true;) that server starts and pages /server-status, /server-config are available.
  • Tested that native compilation still work.
  • 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 nix-review --run "nix-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.

@bjornfor bjornfor added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label May 8, 2019
@@ -45,6 +47,7 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optional enableExtendedAttrs "--with-attr";

preConfigure = ''
export PATH=$PATH:${pcre.dev}/bin
Copy link
Member

Choose a reason for hiding this comment

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

I think we can avoid this by putting pcre.dev in nativeBuildInputs

Copy link
Member

Choose a reason for hiding this comment

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

it should also be dev by default? Just put pcre in both buildInputs and nativeBuildInputs. No PATH by hand, and no .dev by hand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thing is pcre.dev provides pcre-config, which is bash script that's needed to configure script, and we need target version. If i put it to nativeBuildInputs it will gladly cofigure, but at compile time it will try and fail to link it against host pcre library.

Copy link
Member

Choose a reason for hiding this comment

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

Oh it's *-config hell. See #51176 .

OK what you did is fine, but add a comment explaining that. Also, it's build and host platform, not host and target platform for this. At least it's a bash script not real executable so we can run it at all.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah nevermind. What's being used now is reasonable.

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: 1-10 10.rebuild-linux: 1-10 12. first-time contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants