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

Build openssl for emscripten #6884

merged 6 commits into from
Aug 25, 2021

Conversation

3d4m-volodymyr
Copy link
Contributor

@3d4m-volodymyr 3d4m-volodymyr commented Aug 16, 2021

Made few changes which make it possible to build OpenSSL for Emsccripten very easy.

Emscripten installed as per manual on official website emscripten.org.
Emscripten activated in terminal/console and using custom profile below.

[settings]
os=Emscripten
arch=wasm
compiler=emcc
compiler.version=2.0.13
compiler.libcxx=libc++
build_type=Release
[options]

[env]
CONAN_CMAKE_FIND_ROOT_PATH=$EMSDK/upstream/emscripten/system
CONAN_CMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
CC="emcc"
AR="emar"
RANLIB="emranlib"

the command used to build library
conan create . openssl/1.1.1k@ -pr emsdk_profile


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@CLAassistant
Copy link

CLAassistant commented Aug 16, 2021

CLA assistant check
All committers have signed the CLA.

Comment on lines +79 to +80
"no_stdio": [True, False],
"no_tests": [True, False],
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.

Comment on lines 178 to 183
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

@conan-center-bot

This comment has been minimized.

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

Choose a reason for hiding this comment

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

Suggested change
raise ConanInvalidConfiguration("os=Emscripten requires openssl:{no_asm,,no_threads,no_stdio,no_tests}=True")
raise ConanInvalidConfiguration("os=Emscripten requires openssl:{no_asm,no_threads,no_stdio,no_tests}=True")

@conan-center-bot

This comment has been minimized.

@3d4m-volodymyr
Copy link
Contributor Author

@madebr I removed few things that are not necessary for Emscripten. Do you have an idea why the build failed?

@madebr
Copy link
Contributor

madebr commented Aug 18, 2021

It's an internal c3i error. Probably something timed out.
Try closing, waiting 10 secons, and re-opening this pr.

@3d4m-volodymyr
Copy link
Contributor Author

Pending — Contributor License Agreement is not signed yet.

I did sign, strange :)

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@prince-chrismc
Copy link
Contributor

prince-chrismc commented Aug 21, 2021

CLA is not passing FYI

Seems the authorship on your commits is not you github user account that signed the CLA

image

@SSE4
Copy link
Contributor

SSE4 commented Aug 21, 2021

@3d4m-vladimir please sign CLA

@ghost
Copy link

ghost commented Aug 24, 2021

I detected other pull requests that are modifying openssl/1.x.x recipe:

This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there.

@3d4m-volodymyr
Copy link
Contributor Author

@3d4m-vladimir please sign CLA

I did sign, don't know why it showing if I'm not

@3d4m-volodymyr
Copy link
Contributor Author

@SSE4 @prince-chrismc sorry, found what is wrong

@conan-center-bot
Copy link
Collaborator

All green in build 7 (6b3b7f164c84456cab820c3b5c78aa9513763c60):

  • openssl/1.0.2s@:
    All packages built successfully! (All logs)

  • openssl/1.0.2t@:
    All packages built successfully! (All logs)

  • openssl/1.0.2u@:
    All packages built successfully! (All logs)

  • openssl/1.1.1i@:
    All packages built successfully! (All logs)

  • openssl/1.1.0k@:
    All packages built successfully! (All logs)

  • openssl/1.1.0l@:
    All packages built successfully! (All logs)

  • openssl/1.1.1c@:
    All packages built successfully! (All logs)

  • openssl/1.1.1d@:
    All packages built successfully! (All logs)

  • openssl/1.1.1e@:
    All packages built successfully! (All logs)

  • openssl/1.1.1f@:
    All packages built successfully! (All logs)

  • openssl/1.1.1g@:
    All packages built successfully! (All logs)

  • openssl/1.1.1h@:
    All packages built successfully! (All logs)

  • openssl/1.1.1j@:
    All packages built successfully! (All logs)

  • openssl/1.1.1k@:
    All packages built successfully! (All logs)

@conan-center-bot conan-center-bot merged commit 3a6dfb9 into conan-io:master Aug 25, 2021
@3d4m-volodymyr 3d4m-volodymyr deleted the build-openssl-for-emscripten branch August 26, 2021 08:26
Croydon added a commit to bincrafters/conan-center-index that referenced this pull request Sep 9, 2021
Co-Authored-By: Volodymyr B. <3d4m-vladimir@users.noreply.github.com>
conan-center-bot pushed a commit that referenced this pull request Sep 11, 2021
* openssl: create 3.x.x directory

* openssl/3.x.x: Update license to Apache-2.0

* openssl/3.x.x: Update reporting issues URL

* openssl/3.x.x: Add no_deprecated, no_legacy and no_fips options

* openssl/3.x.x: Delete patch for 1.1.1

* openssl/3.x.x: Update option from no_zlib to zlib

* openssl/3.x.x: Remove removed options no_md2 and no_rc5

* openssl/3.x.x.: no_rc4 is still a valid option

https://github.com/openssl/openssl/blob/1b495200436b57309ca958a7a72affaf75171c1a/INSTALL.md#no-algorithm

* openssl/3.x.x: Remove legacy target names

* openssl/3.x.x.: Remove more legacy conditions

* openssl/3.x.x: Fix zlib option name

* Revert "openssl/3.x.x: Update license to Apache-2.0"

This reverts commit 13852ab1da9678d3700440bee862561af7878b37.

* openssl/3.x.x: Actually update license to Apache-2.0

* openssl/3.x.x.: Remove all legacy version switches

* openssl/3.x.x: Use OpenSSL_version instead of legacy SSLeay_version

* openssl/3.x.x.: update test_package to never  use find_package()

Several reasons for this decision:

1) No matter the value of the paramter use_find_package CMake did always use a FindOpenSSL.cmake file

2) On my machine that meant that CMake used a FindOpenSSL.cmake file from my Python installation, which can't yet handle version 3.0.0 due to a regex error

3) Even when I addded the Conan cmake_find_package generator, it did not work (more cpp_info work needed, maybe?)

4) Even when 3) would be fixed, it would still always use the FindOpenSSL.cmake approach for some reason (I guess), so the entire use_find_package switch is pointless

* openssl/3.x.x.: Remove custom OpenSSLVersion object

* openssl/3.x.x.: Remove legacy target_prefix

* openssl/3.x.x.: Remove custom _cross_building method

Since tools.cross_building() has now a skip_x64_x86 flag

* openssl/3.x.x: Some formatting

* openssl/3.x.x: Remove old workaround for MinGW

This got fixed in the meantime via openssl/openssl@9694ebf

See also openssl/openssl#7653

* openssl/3.x.x: add no_engine option

* openssl/3.x.x: Add 3.0.0-alpha5

* openssl/3.x.x: Port #1782 from @syoliver - add components

* openssl/3.x.x: Fix license test

The LICENSE file got renamed to LICENSE.txt

* openssl/3.x.x: add old/ URLs as mirrors

* openssl/3.x.x: threat URLs explicit as strings

* openssl/3.x.x: add 3.0.0-alpha6

* openssl/3.x.x: the downloads have permament locations now

This seems to be the case for a while now, but not for all old versions we support in the recipe for the 1.x.x versions

It also does not seem to apply for pre-release versions, which rather  seem to get de-published

See also here: openssl/openssl#4469

* openssl: Update Conan conventions

Automatically created by bincrafters-conventions 0.26.0

* openssl/3.x.x: reorder methods

* openssl/3.x.x: add 3.0.0-alpha7

* openssl/3.x.x: test upstream PR 13225

openssl/openssl#13225

* openssl/3.x.x: update patch from upstream PR13225

* openssl/3.x.x: port #2944 Require installation of msys2 for MinGW builds

* openssl/3.x.x: port #3214 fix openssl/** build with shared and fPIC option for OS Neutrino

* openssl/3.x.x: add 3.0.0-alpha8

* openssl/3.x.x: remove fPIC when shared

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* openssl/3.x.x: add 3.0.0-alpha9

* openssl/3.x.x: use get_safe for fPIC

* openssl/3.x.x: don't use get_safe for zlib option

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* openssl/3.x.x: add 3.0.0-alpha10

* openssl/3.x.x: add openssl/3.0.0-alpha11

* openssl: Update Conan conventions

Automatically created by bincrafters-conventions 0.30.2

* openssl/3.x.x: add openssl/3.0.0

* openssl: Update Conan conventions

Automatically created by bincrafters-conventions 0.30.5

* openssl/3.x.x: modernize

Co-Authored-By: Anonymous Maarten <anonymous.maarten@gmail.com>

* openssl/3.x.x: modernize

Co-Authored-By: Anonymous Maarten <anonymous.maarten@gmail.com>

* openssl/3.x.x: replace os.rename -> tools.rename

* opeensl/3.x.x.: nit

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* openssl/3.x.x: readd old versions to config.yml

Co-Authored-By: Anonymous Maarten <anonymous.maarten@gmail.com>

* openssl/3.x.x: remove platform import

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* openssl/3.x.x: fix typo in option name

* openssl/3.x.x: more tools modernizations

* openssl/3.x.x: use textwrap

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* openssl/3.x.x: remove MD5 and SHA1 from test_package

* openssl/3.x.x: use self.options.get_safe()

* openssl: add openssl.pc + fix libdir

* openssl: convert test to pure C source

* openssl: use spaces in test source

* openssl/3.x.x: remove SSL_library_init from test_package

* openssl: run openssl binary in test package

* openssl: digest.c only needs crypto library

* openssl: remove unused definitions for cmake

* openssl: enable fPIC when not enabled + use zlib's shared option correctly

* openssl: don't echo args (there is log.print_run_commands) + don't add shared/zlib multiple times

* openssl: tools.XCRun only acceps Settings object

* openssl: use self.settings.os

* openssl: reformatting + be the first to use f-strings + functools.lru_cache

* openssl: ./Configure --help does not print any targets.

* openssl: fix critical typo

* openssl: fix sneaky usage of tools.os_info in build_requirements

* openssl/3.x.x: remove patch for macOS shared

Co-Authored-By: Bowb <bowb@users.noreply.github.com>

* openssl/3.x.x: port #4460 remove explicit apple deployment target flag

Co-Authored-By: SSE4 <tomskside@gmail.com>

* openssl/3.x.x: port #4597 provide official variables in cmake_find_package

Co-Authored-By: SpaceIm <spaceim@users.noreply.github.com>

* openssl/3.x.x: port #4698 fix rt dependency for SUSE11

Co-Authored-By: Alexey Klimkin <klimkin@gmail.com>

* openssl/3.x.x: port #4772 fix builddirs and add vars module to cmake_find_package only

Co-Authored-By: SpaceIm <spaceim@users.noreply.github.com>

* openssl/3.x.x: port #5441 closes #4740

Co-Authored-By: Dmitry Bely <db4@users.noreply.github.com>

* openssl/3.x.x: port #3998 add libatomic in build dependency for Neutrino OS

Co-Authored-By: Arenoros <arenoros@users.noreply.github.com>

* openssl/3.x.x: port #6337 OpenSSL on Windows: multi-profile support

Co-Authored-By: Stefan Floeren <stefan-floeren@users.noreply.github.com>

* openssl/3.x.x: port #6588 Add macOS ARM target

Co-Authored-By: gmeeker <gmeeker@users.noreply.github.com>

* openssl/3.x.x: port #6884 Build openssl for emscripten

Co-Authored-By: Volodymyr B. <3d4m-vladimir@users.noreply.github.com>

* openssl: reformatting fixes

* openssl: make method property + remove unused import

* openssl: reverse sort openssl's config.yml

* openssl: only run openssl when not cross building

* openssl: port options of openssl 1.1.1

* openssl: fix MSVC install + remove options unsupported by openssl 3 + openssl exe is only available when building with no_stio=False

* force push

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* openssl: add missing options + various reformatting

Co-authored-by: bincrafters-user <bincrafters@gmail.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Bowb <bowb@users.noreply.github.com>
Co-authored-by: SSE4 <tomskside@gmail.com>
Co-authored-by: SpaceIm <spaceim@users.noreply.github.com>
Co-authored-by: Alexey Klimkin <klimkin@gmail.com>
Co-authored-by: Dmitry Bely <db4@users.noreply.github.com>
Co-authored-by: Arenoros <arenoros@users.noreply.github.com>
Co-authored-by: Stefan Floeren <stefan-floeren@users.noreply.github.com>
Co-authored-by: gmeeker <gmeeker@users.noreply.github.com>
Co-authored-by: Volodymyr B. <3d4m-vladimir@users.noreply.github.com>
Co-authored-by: Uilian Ries <uilianries@gmail.com>
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.

None yet

7 participants