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

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.

@@ -45,6 +47,7 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optional enableExtendedAttrs "--with-attr";

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

This comment has been minimized.

Copy link
@matthewbauer

matthewbauer May 9, 2019

Member

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

This comment has been minimized.

Copy link
@Ericson2314

Ericson2314 May 9, 2019

Member

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

This comment has been minimized.

Copy link
@deadloko

deadloko May 9, 2019

Author Contributor

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.

This comment has been minimized.

Copy link
@Ericson2314

Ericson2314 May 9, 2019

Member

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.

This comment has been minimized.

Copy link
@matthewbauer

matthewbauer May 9, 2019

Member

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

@matthewbauer matthewbauer merged commit 4dce6bc into NixOS:master May 9, 2019

13 checks passed

Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.