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

pythonPackages.m2crypto: fix build with libressl #53537

Merged
merged 1 commit into from Feb 7, 2019

Conversation

andrew-d
Copy link
Contributor

@andrew-d andrew-d commented Jan 7, 2019

Motivation for this change

Fix build with libressl, since it does not include some of the OpenSSL APIs.
Fixes #53529

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.

cc @qolii

@andrew-d andrew-d requested a review from FRidh as a code owner January 7, 2019 03:22
@andrew-d
Copy link
Contributor Author

andrew-d commented Jan 7, 2019

You can test with crda and a local nixpkgs repo (at $NIXPKGS) by doing something like:

nix-build -E "with import <nixpkgs> { };                                                      
let
  callPythonPackage = pkgs.newScope python2Packages;
  m2crypto = callPythonPackage $NIXPKGS/pkgs/development/python-modules/m2crypto/default.nix {
    openssl = pkgs.libressl;
  };
in callPackage $NIXPKGS/pkgs/os-specific/linux/crda/default.nix {
  python2Packages = {
    inherit m2crypto;
    python = python2Packages.python;
  };
}"

With this patch, it builds successfully locally.

@andrew-d andrew-d changed the title m2crypto: fix build with libressl pythonPackages.m2crypto: fix build with libressl Jan 7, 2019
@qolii
Copy link
Contributor

qolii commented Jan 8, 2019

This is working perfectly for me. Thanks for the quick fix!!

@andrew-d
Copy link
Contributor Author

cc @FRidh and @costrouc, who appear to have previously committed to this file.

@@ -16,6 +17,14 @@ buildPythonPackage rec {
sha256 = "a1b2751cdadc6afac3df8a5799676b7b7c67a6ad144bb62d38563062e7cd3fc6";
};

patches = [
(fetchpatch {
url = "https://github.com/void-linux/void-packages/raw/7946d12eb3d815e5ecd4578f1a6133d948694370/srcpkgs/python-M2Crypto/patches/libressl.patch";
Copy link
Member

Choose a reason for hiding this comment

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

Is there a patch in the m2crypto repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@FRidh - No; the latest version on master does not contain anything referencing libressl.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@FRidh / @danbst - Given the upstream response (" I don’t care about LibreSSL a bit"), what are your thoughts here? My thoughts are that we merge this patch for now, since it does apply, and if we run into problems in the future we can always drop it.

Copy link
Contributor

Choose a reason for hiding this comment

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

@andrew-d please add yourself as maintainer then. Patch itself looks OK to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@danbst - Done!

@danbst danbst merged commit 96b6617 into NixOS:master Feb 7, 2019
@andrew-d andrew-d deleted the andrew/m2crypto-libressl branch March 7, 2019 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants