Skip to content

Commit

Permalink
wasm cerbero: Download and extract emsdk-3.1.58 (preliminary version)
Browse files Browse the repository at this point in the history
Using the command:

    ./cerbero-uninstalled --config ./config/cross-emscripten-wasm.cbc bootstrap --system=no

Downloaded and extracted:

    ~/.cache/cerbero-sources/emsdk-3.1.58.tar.gz (bundle)
    ~/github/cerbero/build/emsdk-3.1.58 (extracted folder)

But still problems with:

  File "/home/jenkins/github/cerbero/cerbero/commands/bootstrap.py", line 113, in run
    run_until_complete(bootstrapper.start(jobs=args.jobs))
  File "/home/jenkins/github/cerbero/cerbero/utils/__init__.py", line 769, in run_until_complete
    result = loop.run_until_complete(tasks)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 612, in run_until_complete
    return future.result()
  File "/home/jenkins/github/cerbero/cerbero/bootstrap/build_tools.py", line 127, in start
    self.setup_venv()
  File "/home/jenkins/github/cerbero/cerbero/bootstrap/build_tools.py", line 110, in setup_venv
    venv.create(self.config.build_tools_prefix, symlinks=self.config.platform != Platform.WINDOWS, with_pip=True)
  File "/usr/lib/python3.8/venv/__init__.py", line 391, in create
    builder.create(env_dir)
  File "/usr/lib/python3.8/venv/__init__.py", line 68, in create
    self._setup_pip(context)
  File "/usr/lib/python3.8/venv/__init__.py", line 289, in _setup_pip
    subprocess.check_output(cmd, stderr=subprocess.STDOUT)
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/jenkins/github/cerbero/build/build-tools/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
(failed reverse-i-search)`fid': ./cerbero-uninstalled --config ./con^Cg/cross-emscripten-wasm.cbc bootstrap --system=no

Issue: RDI_1625
  • Loading branch information
dememax committed Jun 11, 2024
1 parent 918a357 commit bcdb4d2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
25 changes: 22 additions & 3 deletions cerbero/bootstrap/emscripten.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# FLUENDO S.A.
# Copyright (C) <2024> <support@fluendo.com>
# Bootstrap for Emscripten.

from cerbero.bootstrap import BootstrapperBase
from cerbero.bootstrap.bootstrapper import register_toolchain_bootstrapper
from cerbero.enums import Platform, Architecture, Distro, DistroVersion
import os.path

# SDK
SDK_URL = 'https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.58.tar.gz'
SDK_CHECKSUM = '6d860f7ae4bd16bfc18f732200e6608cb2aa739f2ddf9c522755cb0d4037f025'
EMSDK_VERSION = '3.1.58'
EMSDK_BUNDLE_EXT = '.tar.gz'
EMSDK_BASE_URL = 'https://github.com/emscripten-core/emsdk/archive/refs/tags/%s' + EMSDK_BUNDLE_EXT
EMSDK_CHECKSUMS = {
'3.1.58' + EMSDK_BUNDLE_EXT:
'6d860f7ae4bd16bfc18f732200e6608cb2aa739f2ddf9c522755cb0d4037f025'
}

class EmscriptenBootstrapper(BootstrapperBase):
"""
Expand All @@ -13,7 +22,17 @@ class EmscriptenBootstrapper(BootstrapperBase):
"""

def __init__(self, config, offline, assume_yes):
super().__init__(config, offline)
self.prefix = self.config.toolchain_prefix
url = EMSDK_BASE_URL % (EMSDK_VERSION)
buldle_name = 'emsdk-' + EMSDK_VERSION + EMSDK_BUNDLE_EXT
urls = (url, buldle_name, EMSDK_CHECKSUMS[os.path.basename(url)])
self.fetch_urls.append(urls)
self.extract_steps.append((url, True, self.prefix))

async def start(self, jobs=0):
pass


def register_all():
register_toolchain_bootstrapper(Distro.EMSCRIPTEN, EmscriptenBootstrapper)
9 changes: 9 additions & 0 deletions config/cross-emscripten-wasm.cbc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# FLUENDO S.A.
# Copyright (C) <2024> <support@fluendo.com>
# Cross-compilation config file for Emscripten WASM.

from cerbero.config import Platform, Architecture, Distro

target_platform = Platform.EMSCRIPTEN
target_distro = Distro.EMSCRIPTEN
target_arch = Architecture.WASM
8 changes: 8 additions & 0 deletions config/emscripten.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# FLUENDO S.A.
# Copyright (C) <2024> <support@fluendo.com>
# Platform config file for Emscripten.

import os.path

if not toolchain_prefix:
toolchain_prefix = home_dir # the bundle contains 'emsdk-X.Y.Z' root folder

0 comments on commit bcdb4d2

Please sign in to comment.