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

Process to patch Python 3.8.14 or 3.8.5 for wolfSSL on Windows #141

Open
ar-visions opened this issue Apr 28, 2023 · 3 comments
Open

Process to patch Python 3.8.14 or 3.8.5 for wolfSSL on Windows #141

ar-visions opened this issue Apr 28, 2023 · 3 comments
Assignees

Comments

@ar-visions
Copy link

ar-visions commented Apr 28, 2023

Since the Windows build doesn't run the autoconf and configure I am wondering what the process is to get Python patched for wolfssl on Windows. Is this possible with configuration passed into CMake?

I would like to help get this working if there is an avenue.

Working on a CMake/Python build system which bootstraps Python from source. Seems that using Wolf is preferable to downloading Strawberry Perl bins & OpenSSL src on Windows, in order to get Python built. CMake can build anything first so why not build Python in the most succinct way.. Would like to commit PR in this area if I get something going.

@ar-visions ar-visions changed the title Process to patch Python 3.8.14 or 3.8.5 on Windows Process to patch Python 3.8.14 or 3.8.5 for wolfssl on Windows Apr 28, 2023
@ar-visions ar-visions changed the title Process to patch Python 3.8.14 or 3.8.5 for wolfssl on Windows Process to patch Python 3.8.14 or 3.8.5 for wolfSSL on Windows Apr 28, 2023
@ar-visions
Copy link
Author

ar-visions commented Apr 28, 2023

I have this CMakeSettings.json so far. I did a rough search to get the names, but I'm not so sure about CFlags
I believe I found the equivalent compared to the args used in the configuration line in Python/build-wolfssl.sh

I'm a bit confused as to what Python needs to find afterwards. I assume I just add a prefix to its search but not aware of the files I need to have interfaced w Python

{
    "configurations": [
      {
        "name": "PythonCompatible",
        "generator": "Ninja",
        "cmakeCommandArgs": "",
        "buildCommandArgs": "",
        "ctestCommandArgs": "",
        "variables": [
          {
            "name": "WOLFSSL_OPENSSLALL",
            "value": "ON"
          },
          {
            "name": "WOLFSSL_TLS13",
            "value": "ON"
          },
          {
            "name": "WOLFSSL_TLSX",
            "value": "ON"
          },
          {
            "name": "WOLFSSL_TLSV10",
            "value": "ON"
          },
          {
            "name": "WOLFSSL_POSTAUTH",
            "value": "ON"
          },
          {
            "name": "WOLFSSL_CERTEXT",
            "value": "ON"
          },
          {
            "name": "WOLFSSL_CERTGEN",
            "value": "ON"
          },
          {
            "name": "WOLFSSL_SCRYPT",
            "value": "ON"
          },
          {
            "name": "CFLAGS",
            "value": "-DHAVE_EX_DATA;-DWOLFSSL_ERROR_CODE_OPENSSL;-DHAVE_SECRET_CALLBACK;-DWOLFSSL_PYTHON;-DWOLFSSL_ALT_NAMES;-DWOLFSSL_SIGNER_DER_CERT"
          }
        ]
      }
    ]
  }

@ar-visions
Copy link
Author

WOLFSSL_TLSV10 not found effectively. just a note to add.

@kareem-wolfssl
Copy link
Contributor

kareem-wolfssl commented Apr 28, 2023

Hi @ar-visions,

For a Windows build, you're going to have a much easier time using something like MinGW where you can use our ./configure script, is this possible for your setup?
Otherwise, your build flags look correct to me based on our Python build. Are you running into build issues with these flags? Note that our CMake support is incomplete, for example WOLFSSL_SCRYPT and WOLFSSL_TLSV10 are not supported via CMake, you will need to manually specify their CFLAGS. For help translating configure flags to CFLAGS, see configure.ac.

Python will need to find wolfSSL's library (.dll) and include files (.h). On Linux, this would be in /usr/local/ after running make install. I'm not sure if there's an equivalent on Windows, you may need to manually add to Python's search path, or move wolfSSL's library/header files.

Thanks,
Kareem

@kareem-wolfssl kareem-wolfssl self-assigned this May 1, 2023
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

No branches or pull requests

2 participants