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

Haskell package servant doesn't compile on darwin due to python2.7-future #22590

Closed
Dridus opened this issue Feb 9, 2017 · 5 comments
Closed

Comments

@Dridus
Copy link
Contributor

Dridus commented Feb 9, 2017

Issue description

The servant package has an override in configuration-common.nix which tacks on documentation building with sphinx. Sphinx depends via some path on python2.7-future which has only linux mentioned as a viable platform, so the whole build bombs during validation on darwin.

I had trouble overriding this by using packageOverrides and haskell.lib.overrideCabal but couldn't get the postInstall to be overridden. I tried this specifically:

  import <nixpkgs> {
    packageOverrides = pkgs: rec {
      haskellPackages = pkgs.haskellPackages.override {
        overrides = self: super: {
          servant = pkgs.haskell.lib.overrideCabal super.servant (old: {
            postInstall = "";
          });
        };
      };
    };
  }

I did have success cabal2nixing servant and overriding servant with that copy, like this:

  import <nixpkgs> {
    packageOverrides = pkgs: rec {
      haskellPackages = pkgs.haskellPackages.override {
        overrides = self: super: {
          # Do this because the servant package is patched in nixpkgs to build the documentation, which uses sphinx. Sphinx doesn't work on Darwin
          # because python2.7-future is not available on that platform.  We don't care about the docs so instead just use a clean expression 
          # generated by cabal2nix.
          servant = self.callPackage ./servant.nix {};
        };
      };
    };
  }

It would be really swell if it was possible to disable the doc build like you can with other haskell packages using dontHaddock or similar, though just having it not blow up and not generate the docs would be fine in my view - the docs are available at http://haskell-servant.readthedocs.io/en/stable/

Steps to reproduce

nix-build '<nixpkgs>' -A haskellPackages.servant fails with:

error: Package ‘python2.7-future-0.15.2’ in ‘/nix/store/wq90d75hc8k4rz3syd9x7sk7x295a9cf-nixpkgs-17.03pre99928.61c48d9/nixpkgs/pkgs/top-level/python-packages.nix:11828’ is not supported on ‘x86_64-darwin’, refusing to evaluate.
a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.nixpkgs/config.nix.

(use ‘--show-trace’ to show detailed location information)

Technical details

  • System: macOS Sierra 10.12.3
  • Nix version: nix-env (Nix) 1.11.4
  • Nixpkgs version: 17.03pre99928.61c48d9
@domenkozar
Copy link
Member

cc @Profpatsch

@Profpatsch
Copy link
Member

Have you tried just removing that linux restriction for python2.7-future?
Maybe it builds just fine.

@Dridus
Copy link
Contributor Author

Dridus commented Feb 15, 2017

@Profpatsch I had not. I just tried it and it seems to build without error. should I make a PR to that effect?

@Profpatsch
Copy link
Member

Yes!

@Dridus
Copy link
Contributor Author

Dridus commented Feb 15, 2017

@Profpatsch #22837

Profpatsch pushed a commit that referenced this issue Feb 15, 2017
Per #22590, `haskellPackages.servant` and by extension any package which transitively depends on `pythonX.Y-future` will fail to build on darwin even though there's apparently no reason why it can't be built there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants