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

Build openssl for emscripten #6884

Merged
merged 6 commits into from
Aug 25, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions recipes/openssl/1.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class OpenSSLConan(ConanFile):
"no_asm": [True, False],
"enable_weak_ssl_ciphers": [True, False],
"386": [True, False],
"no_stdio": [True, False],
"no_tests": [True, False],
Comment on lines +79 to +80
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to add default values to default_options as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind. Openssl does this with a loop.

"no_sse2": [True, False],
"no_bf": [True, False],
"no_cast": [True, False],
Expand Down Expand Up @@ -172,6 +174,14 @@ def config_options(self):
else:
del self.options.fPIC

if self.settings.os == "Emscripten":
self.options.no_asm = True
self.options.no_deprecated = True
self.options.no_dso = True
self.options.no_threads = True
self.options.no_stdio = True
self.options.no_tests = True
Copy link
Contributor

@madebr madebr Aug 16, 2021

Choose a reason for hiding this comment

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

This makes it still possible to run:

conan create . openssl/1.1.1k@ -pr emsdk_profile -o openssl:no_stdio=False

Should this also be tested in a validate method?

def validate(self):
    if self.settings.or == "Emscripten":
        if not all((self.options.no_asm, self.options.no_deprecated, self.options.no_dso, self.options.no_threads, self.options.no_stdio, self.options.no_tests)):
            raise ConanInvalidConfiguration("os=Emscripten requires openssl:{no_asm,no_deprecated,no_dso,no_threads,no_stdio,no_tests}=True")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, I will add this check

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering whether the test should be self.settings.os == "Emscripten" or self.settings.arch == "wasm".

Copy link
Contributor

Choose a reason for hiding this comment

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

Does my suggestion actually work? Does it block -o openssl:no_asm=False? I didn't verify locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is good question! But idk any other sdks that are capable of compiling that complicated code to wasm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does my suggestion actually work? Does it block -o openssl:no_asm=False? I didn't verify locally.

yes it does


def build_requirements(self):
if tools.os_info.is_windows:
if not self._win_bash:
Expand Down