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

Building _hashlib and _ssl modules #892

Merged
merged 6 commits into from
Jun 19, 2022
Merged

Conversation

izumiberat
Copy link
Contributor

@izumiberat izumiberat commented Jun 10, 2022

I am using Mac OS Catalina 10.15.7.

To avoid getting the following messages :

The necessary bits to build these optional modules were not found:
_hashlib _ssl

as well as:

Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer

Based on the comments below, the solution is to indicate the OpenSSL version in the brew command: brew install openssl@1.1 and make a note to update this line with brew install openssl@3 when OpenSSL 3 is supported.

Initial (and outdated descritption below):

Running `brew install openssl@3` allowed the _hashlib _ssl modules to build, but as suggested in a comment by @ezio-melotti it seemed strange that the version needed to be specified.

I am therefore updating the documentation by leaving the suggested command line as brew install openssl rather than brew install openssl@3 but I am adding a note saying that if user gets the message

Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer

they can try specifying the version of OpenSSL by using brew install openssl@3.

Issue number: python/cpython#93695

I am using Mac OS Catalina 10.15.7.

To avoid getting the following messages : 
> The necessary bits to build these optional modules were not found:
> _hashlib              _ssl   
as well as:
> Could not build the ssl module!
> Python requires a OpenSSL 1.1.1 or newer

Running `brew install openssl@3` allowed the  _hashlib _ssl modules to build, but as suggested in a comment by @ezio-melotti it seemed strange that the version needed to be specified. 

I am therefore updating the documentation by leaving 
`brew install openssl` rather than `brew install openssl@3 ` but I am adding a note saying that if user gets the message 
> Could not build the ssl module!
> Python requires a OpenSSL 1.1.1 or newer
that they can try specifying the version of OpenSSL by using `brew install openssl@3`.

Issue number: python/cpython#93695
@tiran
Copy link
Member

tiran commented Jun 10, 2022

Please be aware that OpenSSL 3.0 is still not supported by Python. It's possible to compile Python with OpenSSL 3.0 but it's not tested well. I advise against examples that refer to OpenSSL 3.0.

@izumiberat
Copy link
Contributor Author

@tiran thanks for the clarification. I updated the example with OpenSSL1.1 instead of 3.0. But maybe, in that case, the documentation should be updated so that OpenSSL1.1 is installed. I agree that as mentioned by @ezio-melotti it makes it version-specific, and it will require updating the documentation again in the future which is not ideal. But as it is currently specified in the documentation: brew install openssl xz gdbm seems to install the latest openssl version (which is 3.0).

In that case, removing my current note, and simply updating the command line brew install openssl xz gdbm by brew install openssl@1.1 xz gdbm in the documentation could work better.

@izumiberat izumiberat changed the title Note to user when modules do not build Building _hashlib _ssl modules Jun 10, 2022
@izumiberat izumiberat changed the title Building _hashlib _ssl modules Building _hashlib and _ssl modules Jun 10, 2022
@ezio-melotti
Copy link
Member

Please be aware that OpenSSL 3.0 is still not supported by Python.

If it's not supported, documenting a command that installs it sounds wrong, so I think it's fine to document openssl@1 (or openssl@1.1).

@tiran: are there plans to add support for OpenSSL 3? If there is an issue already, a note about updating the devguide could be added there so that we don't forget.

Copy link
Member

@ezio-melotti ezio-melotti left a comment

Choose a reason for hiding this comment

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

I left a couple of comments, but you can wait until decide how to fix this issue before updating the PR.

@izumiberat
Copy link
Contributor Author

izumiberat commented Jun 11, 2022

If it's not supported, documenting a command that installs it sounds wrong, so I think it's fine to document openssl@1 (or openssl@1.1).

@ezio-melotti the homebrew documentation provides two options when looking up openssl: openssl@1.1 or openssl@3. We could therefore go with 1.1 for now.

@erlend-aasland
Copy link
Contributor

@tiran: are there plans to add support for OpenSSL 3? If there is an issue already, a note about updating the devguide could be added there so that we don't forget.

Yes, there are multiple open issues related to OpenSSL 3 in the tracker, so adding a note would be fine.

izumiberat and others added 3 commits June 11, 2022 12:07
I also removed the original note as it would be irrelevant after updating the brew command line
This is to resolve conflict with main branch
@ezio-melotti
Copy link
Member

Yes, there are multiple open issues related to OpenSSL 3 in the tracker, so adding a note would be fine.

Is there a meta-issue or anyway an issue that once closed will allow the switch to openssl@3? If so, the note should be added there. Another option is to create a project to group the OpenSSL issues, including a draft issue to update the devguide.

@erlend-aasland
Copy link
Contributor

Is there a meta-issue or anyway an issue that once closed will allow the switch to openssl@3? If so, the note should be added there. Another option is to create a project to group the OpenSSL issues, including a draft issue to update the devguide.

I don't think there's a meta issue, so creating a project SGTM.

@izumiberat
Copy link
Contributor Author

@ezio-melotti I am unclear as to where needs to be noted the switch to openssl@3, but this is what could be added:

Note for when OpenSSL3 becomes supported
Please update the documentation Getting Started: brew install openssl@1.1 needs to be updated with brew install openssl@3. It is related to #892.

Once we made a note of this somewhere (happy to do it if you can tell me where), this PR could be merged as it is.

@ezio-melotti
Copy link
Member

I created a project about OpenSSL 3 with a draft issue about updating the devguide:
OpenSSL 3 (view)

@izumiberat
Copy link
Contributor Author

project about OpenSSL 3 with a draft issue about updating the devguide:
OpenSSL 3 (view)

@ezio-melotti I get a 404 error message. If it is a permission issue, don't worry about it.

@erlend-aasland
Copy link
Contributor

I get a 404 error message. If it is a permission issue, don't worry about it.

The project is currently marked "private". I guess Ezio will make it public sooner or later :)

@izumiberat
Copy link
Contributor Author

@erlend-aasland or @ezio-melotti does one of you want to merge this PR to main?

@erlend-aasland erlend-aasland merged commit a27e62a into python:main Jun 19, 2022
@erlend-aasland
Copy link
Contributor

Thanks for the heads-up and thanks for the PR!

@izumiberat izumiberat deleted the patch-2 branch June 19, 2022 19:49
ezio-melotti pushed a commit that referenced this pull request Aug 1, 2022
The brew install command was updated in #892, but the corresponding commands were not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants