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

emsdk: add new version 3.1.72 #24218

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions recipes/emsdk/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"3.1.72":
url: "https://github.com/emscripten-core/emsdk/archive/3.1.72.tar.gz"
sha256: "62886722da99173789f1efc31b754c83c8ea09575035ce7fdfe5a7389bb3cec3"
"3.1.50":
url: "https://github.com/emscripten-core/emsdk/archive/3.1.50.tar.gz"
sha256: "7491a881eb5ee15fe81bbabcfff1fd571e45ccdb24a81890af429f9970cbd1f3"
Expand Down
21 changes: 13 additions & 8 deletions recipes/emsdk/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
from conan import ConanFile, conan_version
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import cross_building
from conan.tools.env import Environment
from conan.tools.files import chdir, copy, get, replace_in_file
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
import json
import os
import platform

required_conan_version = ">=1.52.0"


class EmSDKConan(ConanFile):
name = "emsdk"
description = "Emscripten SDK. Emscripten is an Open Source LLVM to JavaScript compiler"
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/kripken/emscripten"
topics = ("emsdk", "emscripten", "sdk")
license = "MIT"
topics = ("emscripten", "sdk")
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved
package_type = "application"
settings = "os", "arch", "compiler", "build_type"

short_paths = True

@property
Expand All @@ -28,8 +30,12 @@ def _settings_build(self):
def layout(self):
basic_layout(self, src_folder="src")

def requirements(self):
self.requires("nodejs/16.3.0")
Copy link
Member

Choose a reason for hiding this comment

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

There has been some talk about this recipe requiring nodejs directly, instead of it being a tool_requires, we should clarify if it's really needed or if we could get away with tool_requireing it.

The issue is that users of emsdk are not able to override nodejs, and they get conflicts using it as a tool_requires


def build_requirements(self):
if Version(self.version) < "3.1.68":
self.tool_requires("nodejs/16.3.0")
else:
self.tool_requires("nodejs/20.16.0")
Copy link
Member

Choose a reason for hiding this comment

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

Where does this restriction come from? Is it LTS releated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AbrilRBS
After reading this issue, I have decided that we should update node.js at least for the latest emsdk.

# self.requires("python") # FIXME: Not available as Conan package
# self.requires("wasm") # FIXME: Not available as Conan package

Expand All @@ -38,8 +44,7 @@ def package_id(self):
del self.info.settings.build_type

def source(self):
get(self, **self.conan_data["sources"][self.version],
destination=self.source_folder, strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)

@property
def _relative_paths(self):
Expand Down Expand Up @@ -125,7 +130,7 @@ def package(self):
"set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)",
"set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)")
if not cross_building(self):
self.run("embuilder build MINIMAL", env=["conanemsdk", "conanrun"]) # force cache population
self.run("embuilder build MINIMAL", env=["conanemsdk", "conanrun", "conanbuild"]) # force cache population
# the line below forces emscripten to accept the cache as-is, even after re-location
# https://github.com/emscripten-core/emscripten/issues/15053#issuecomment-920950710
os.remove(os.path.join(self._em_cache, "sanity.txt"))
Expand Down
2 changes: 2 additions & 0 deletions recipes/emsdk/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.1.72":
folder: all
"3.1.50":
folder: all
"3.1.49":
Expand Down