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

Meta-ticket: SSL issues #30556

Closed
slel opened this issue Sep 11, 2020 · 30 comments
Closed

Meta-ticket: SSL issues #30556

slel opened this issue Sep 11, 2020 · 30 comments

Comments

@slel
Copy link
Member

slel commented Sep 11, 2020

Building Sage with its own Python 3 can easily produce
a Python 3 missing its _ssl module.

Python's _ssl module is only built if OpenSSL (with headers)
is available, either via the system or via the openssl spkg.

The result is reduced functionality:

  • it hinders installing pip packages
  • it hinders working with Jupyter

See also:

Tickets:

References:

Depends on #30557
Depends on #30560
Depends on #30383

CC: @mwageringel @mkoeppe @slel @williamstein @dimpase

Component: packages: standard

Keywords: openssl, python

Issue created by migration from https://trac.sagemath.org/ticket/30556

@slel slel added this to the sage-9.2 milestone Sep 11, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

Dependencies: #30557

@mkoeppe

This comment has been minimized.

@slel

This comment has been minimized.

@slel
Copy link
Member Author

slel commented Sep 11, 2020

comment:3

Many builds of the python3 spkg without its _ssl module
likely result from an oversight.

Could there be a configure flag to explicitly require
building python3 without its _ssl module?

Without that flag, consider openssl a dependency of python3,
and let the build fail if it's not there.

@slel slel changed the title Build Python's ssl module Build Python's ssl module or protest loudly Sep 11, 2020
@slel
Copy link
Member Author

slel commented Sep 11, 2020

comment:4

Even when configuring with --enable-openssl,
I think openssl may be built after python3.

So currently one really has to separate into two steps:

$ make openssl
$ make

or later have to repair with

$ sage -i openssl
$ sage -f python3

@slel

This comment has been minimized.

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

comment:5

Replying to @slel:

Even when configuring with --enable-openssl,
I think openssl may be built after python3.

Yes, this is a problem. We do not have a mechanism to order "optional dependencies".

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

comment:6

See #21700 - Packages with "optional" dependencies (a package manager's suggested/recommended packages)

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

comment:7

We could add openssl to TOOLCHAIN_DEPS as a workaround. Then it would be built at the very beginning.

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

comment:8

Replying to @mkoeppe:

We could add openssl to TOOLCHAIN_DEPS as a workaround. Then it would be built at the very beginning.

This is now #30560

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 13, 2020

Changed dependencies from #30557 to #30557, #30560

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 13, 2020

Changed dependencies from #30557, #30560 to #30557, #30560, #30383

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 13, 2020

comment:10

If we are building python3 and openssl is not available as a system package and not enabled, then we should disable the packages that depend on openssl -- Jupyter notebook (and dependencies) and all source=pip packages. The latter are already optional packages by definition. But we would need give the Jupyter notebook packages a new package type: optional-enabled-by-default (#30383).

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 13, 2020

comment:11

Replying to @slel:

Could there be a configure flag to explicitly require
building python3 without its _ssl module?

This would effectively make openssl a standard package. I don't think we should do that because of license reasons. Warnings about the disabled features are better.

@mwageringel
Copy link
Contributor

comment:12

I would like to mention that the SSL requirement for Jupyter seems to be a recent change – presumably the upgrade of tornado or other Jupyter packages in 9.2.beta9. This was not clear to me and part of why I was confused on the mailing list. I was actually using the Python 3 SPKG without SSL all along and until now I have not experienced any problem with this. In particular, this is not related to the Python 3.8 upgrade as I had assumed at first.

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 19, 2020

comment:13

This might be worth investigating more.

@mwageringel
Copy link
Contributor

comment:14

Replying to @mkoeppe:

This might be worth investigating more.

As suspected, this is a consequence of the Jupyter upgrades in #26919, merged in 9.2.beta9. The dependency on ssl in tornado/httpserver.py was added in this commit.

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 27, 2020

comment:15

Replying to @mwageringel:

Replying to @mkoeppe:

This might be worth investigating more.

As suspected, this is a consequence of the Jupyter upgrades in #26919, merged in 9.2.beta9. The dependency on ssl in tornado/httpserver.py was added in this commit.

Looks like this would be easy to patch out.

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 27, 2020

comment:16

This is now #30674

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 8, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 15, 2020

comment:18

Building a Python without ssl module is happening on ubuntu-trusty (https://github.com/sagemath/sage/runs/1553902103) in 9.3.beta4

Our configure finds system openssl; system python3 is too old, so python 3.8 is built from source; but apparently it fails to build the ssl module. (This should be investigated!)

The symptom is that pytest (a pip package that is a check-only dependency of some standard package) fails to install:

[pytest] installing. Log file: /sage/logs/pkgs/pytest.log
  [pytest] error installing, exit status 1. End of log file:
  [pytest]   WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
  [pytest]   WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pytest/

It is likely that this problem has actually been around for a while and was only masked by the faulty SAGE_CHECK logic fixed in #31020.

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 15, 2020

comment:19

Same in ubuntu-xenial-standard.

Also in various -minimal builds, of course, where the SSL headers are not available. For example ubuntu-hirsute-minimal (https://github.com/sagemath/sage/runs/1553902375)

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 16, 2020

comment:20

#31062 "tox / GH Actions: Disable testsuites of packages depending on pip packages (pytest, ...) if there is no ssl" proposes a workaround

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title Build Python's ssl module or protest loudly Meta-ticket: SSL issues Dec 18, 2020
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 26, 2021

comment:24

Moving it to 9.4; we seem to have an OK solution for now

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 26, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Jan 10, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
@mkoeppe
Copy link
Contributor

mkoeppe commented Feb 10, 2023

I think we can close this. Haven't seen any issues with SSL in a long time.

@mkoeppe mkoeppe closed this as completed Feb 10, 2023
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