#2221 closed defect (fixed)

allow automatic use of pyOpenSSL 0.14

Reported by: daira Owned by:
Priority: major Milestone: 1.11.0
Component: packaging Version: 1.10.0
Keywords: packaging setuptools pyopenssl cryptography six cffi pycparser Cc: vladimir@…
Launchpad Bug:

Description (last modified by daira)

For Tahoe-LAFS 1.11 we decided to fix the pyOpenSSL version requirement to == 0.13 [not quite; see comment:4 below], in order to mitigate problems with building the cryptography library that is a dependency of pyOpenSSL >= 0.14 (see #2193 for details).

This ticket is for a longer-term solution to allow use of pyOpenSSL >= 0.14 without causing build/install regressions (such as #2217, or the requirement to manually install libffi on some platforms).

Change History (26)

comment:1 Changed at 2014-04-15T01:12:50Z by daira

  • Description modified (diff)

comment:2 Changed at 2014-04-15T01:13:47Z by daira

  • Description modified (diff)

comment:3 Changed at 2014-05-12T21:42:37Z by glyph

For what it's worth, you don't need to manually install libffi on the mac, at least; it's bundled with the platform.

comment:4 Changed at 2014-10-17T11:15:17Z by daira

  • Description modified (diff)

The solution we eventually arrived at for 1.11 (for all platforms) was to attempt to import the OpenSSL module at build time and check its version; if 0.14 or above is already installed then we allow it, otherwise we use 0.13 or 0.13.1.

This is not entirely satisfactory; it's complicated and means that we don't get pyOpenSSL security fixes unless 0.14+ is installed manually.

comment:5 Changed at 2014-10-28T19:10:08Z by daira

  • Summary changed from allow use of pyOpenSSL 0.14 to allow automatic use of pyOpenSSL 0.14

comment:6 Changed at 2015-05-01T19:31:31Z by daira

https://caremad.io/2014/11/distributing-a-cffi-project/ explains what is wrong with cffi from a packaging point of view. Until those design issues are fixed, we can't make much progress on this ticket.

comment:7 Changed at 2015-05-02T01:39:25Z by glyph

That post includes workarounds for all of the issues described; it also says that the cryptography project has now already worked around all the issues described therein. Given that Tahoe doesn't make use of cffi directly, it's not clear to me why those particular issues would prevent it from being used indirectly in the project that all the workarounds come from.

That said, certainly the requirement to install libffi is still there.

comment:8 Changed at 2015-05-02T18:28:34Z by daira

Sorry, I missed the fact that they were already in cryptography (probably because I'd seen some of these problems when building previous versions of it). Which is the first version that has all of these fixes?

comment:9 Changed at 2015-05-02T18:34:19Z by daira

Also, is it possible to build a cryptography egg that allows building without a compiler or any manually installed dependencies on Windows?

(Note: we can't use wheels because we're stuck with zetuptoolz for the time being.)

comment:10 follow-up: Changed at 2015-05-03T06:54:45Z by glyph

I don't know what version the fixes appeared in; they have all trickled in over time. I'm not sure if there's even a complete release with all of them.

I assume it would be possible to build an egg, since the metadata provided is the same as for wheels, but eggs are pretty strongly deprecated at this point, and I'm not sure if you could convince the cryptography team to spend much time investigating it if it doesn't work :-\. It seems like eliminating zetuptoolz would be a fruitful avenue to pursue; why are you still stuck with it?

comment:11 in reply to: ↑ 10 ; follow-up: Changed at 2015-05-04T22:49:57Z by zooko

Replying to glyph:

It seems like eliminating zetuptoolz would be a fruitful avenue to pursue; why are you still stuck with it?

Last time I considered it, which was one and a half years ago, we had made seven patches to our fork, zetuptoolz, and I wasn't sure if those issues had also been fixed in setuptools or not. Nowadays I guess I would be unsure if those issues would regress if we switched from zetuptoolz to wheel

comment:12 Changed at 2015-05-04T22:57:44Z by dstufft

For what it's worth, cffi is being worked on which fixes most (or all) of the issues in my post natively within cffi instead of relying on the hacks that we have in place in cryptography.

comment:13 in reply to: ↑ 11 ; follow-up: Changed at 2015-05-04T23:13:05Z by glyph

Replying to zooko:

Replying to glyph:

It seems like eliminating zetuptoolz would be a fruitful avenue to pursue; why are you still stuck with it?

Last time I considered it, which was one and a half years ago, we had made seven patches to our fork, zetuptoolz, and I wasn't sure if those issues had also been fixed in setuptools or not. Nowadays I guess I would be unsure if those issues would regress if we switched from zetuptoolz to wheel

My understanding is that the context of those patches was a fairly unresponsive setuptools development team who wasn't fixing things. The Python Packaging Authority is substantially more responsive to bug reports, and users frequently get updates. Ironically zetuptoolz is now creating the exact situation it was created to avoid :-).

The only setuptools bug referenced by the linked comment is http://bugs.python.org/setuptools/issue54, which, if it hasn't been fixed (I think maybe it has? maybe dstufft can opine directly) has been mostly obviated by the ecosystem's consensus converging on virtualenv and related toolchains to produce isolated environments.

I want to say more things about this but I can't even find zetuptoolz's source code; all the old links are broken. Where does it live now?

comment:14 in reply to: ↑ 13 Changed at 2015-05-04T23:24:27Z by zooko

The links in the comment mentioned above are not broken! They still work. The tahoe-lafs trac appears to be responding slowly though… give them a minute to load?

comment:15 Changed at 2015-05-04T23:26:40Z by daira

glyph: it's in the Tahoe source tree: https://github.com/tahoe-lafs/tahoe-lafs/tree/master/setuptools-0.6c16dev6.egg

Last time I looked, the main change that upstream didn't have was the Windows script support that doesn't require an executable blob.

comment:16 Changed at 2015-05-04T23:29:29Z by glyph

What do you mean by "require an executable blob"?

comment:17 follow-up: Changed at 2015-05-04T23:31:11Z by glyph

Also, I apologize for cluttering up this ticket's comments, we're getting pretty far off track. Should we make a new "eliminate zetuptoolz" ticket?

comment:18 Changed at 2015-05-04T23:38:26Z by daira

There used to be (don't know whether there still is) a 32-bit Windows executable in the setuptools *source*, with no instructions on how to rebuild it. There was no corresponding 64-bit executable, and the 32-bit one was buggy; it failed to pass on Unicode arguments to the Python process correctly, for example.

comment:19 in reply to: ↑ 17 Changed at 2015-05-04T23:40:32Z by zooko

Replying to glyph:

Also, I apologize for cluttering up this ticket's comments, we're getting pretty far off track. Should we make a new "eliminate zetuptoolz" ticket?

Here are all of the related tickets.

There are no fewer than six open tickets for wholesale replacement of zetuptoolz with something else. I must confess I no longer understand — if I ever did — which of the following tools are alternatives vs. complementary, which ones are currently maintained, etc.:

comment:20 Changed at 2015-05-04T23:41:08Z by zooko

P.S. Since I no longer understand these issues, I would welcome someone who does, such as dstufft, glyph, daira, warner, etc., taking the lead on proposing a path forward.

comment:21 Changed at 2015-05-04T23:44:48Z by glyph

I think #1582 is probably the right place to continue discussion, so I will move there. Thanks for the overview.

comment:22 Changed at 2016-03-07T22:53:41Z by rvs

  • Cc vladimir@… added

comment:23 Changed at 2016-03-07T23:03:14Z by rvs

FWIW, I'm having some problems with installing tahoe with --single-version-externally-managed while using pyOpenSSL 0.15.1: it still complains "pkg_resources.DistributionNotFound?: The 'pyOpenSSL<=0.13.1,>=0.13' distribution was not found and is required by the application"

logs are here:

Here's the spec file I try to build: https://github.com/vrusinov/copr-sundry/blob/tahoe-lafs/third_party/subtrees/tahoe-lafs/tahoe-lafs.spec

Note that I'm doing something weird before install:

rm -rf setuptools-*.egg
mkdir -p setuptools-0.0.0.egg

But it the only way I was able to build it avoiding weird setuptools version conflicts.

I can live without it now, but it may quickly become very annoying.

comment:24 Changed at 2016-03-26T22:52:04Z by warner

  • Milestone changed from soon to 1.11.0
  • Resolution set to fixed
  • Status changed from new to closed

We no longer pin the pyOpenSSL version as we used to do, nor do we use zetuptoolz. Tahoe now uses the current version of everything.

We currently have multiple pathways that depend on pyopenssl:

  • a direct dependency that requires >=0.14
  • one through Twisted[tls] that wants >=0.13
  • one through Foolscap that doesn't declare a version
  • one through Foolscap that wants Twisted[tls]
  • one through service-identity that wants pyopenssl >=0.12

After this release, we'll probably get rid of one on service-identity (which is no longer used by twisted; tahoe was depending on it just out of paranoia). We might also get rid of the direct dependency, unless there's something special about 0.14 that we care about more than Twisted or Foolscap.

But in any event, 0.14 is fine, and in fact modern builds will use the current release (which is "16.0.0"). So I'm closing this one out.

comment:25 Changed at 2016-03-28T01:48:04Z by glyph

For what it's worth, service_identity is still totally imported directly by Twisted. It's part of twisted[tls] though, so the direct dependency shouldn't be necessary.

comment:26 Changed at 2016-03-28T04:04:33Z by warner

Oops, it's characteristic that's no longer used by Twisted. But yeah, we'll also remove our dependency on service-identity and allow twisted[tls] to be responsible for it.

Note: See TracTickets for help on using tickets.