This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
boa version currently used in emscripten forge #334
Draft
DerThorsten
wants to merge
30
commits into
mamba-org:main
Choose a base branch
from
DerThorsten:python_api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
ff6a064
hacky emscripten experiments
DerThorsten f9224fc
hacky hack
DerThorsten f90dc50
Merge branch 'emscripten' into master
DerThorsten 00e9f92
Merge pull request #2 from DerThorsten/master
DerThorsten 210a62d
emscripten wip
DerThorsten ab5013e
wip
DerThorsten 3500b3d
hack to not install pip by default
DerThorsten 38e20c4
hack to set emsdk dir
DerThorsten 252287a
fixed
DerThorsten 9ad2be7
renaming EMSDK_DIR
DerThorsten d90c12b
using monkeypatch
DerThorsten bd613a7
fixed monkeypatch
DerThorsten 8e33dbf
improved monkeypatching
DerThorsten abbe512
conda monkeypatch
DerThorsten cd388a3
cleanup monkeypatch
DerThorsten f0cc3d0
merged
DerThorsten 19964be
wip
DerThorsten e1bcfd4
wip
DerThorsten b453309
added post build callback
DerThorsten d601415
improved callback
DerThorsten 0479d2b
wip
DerThorsten 1f61682
adding final names
DerThorsten 75aeabe
Add emscripten wasm filetype patch
martinRenou 92064d2
Merge pull request #5 from martinRenou/postcb
DerThorsten 172c1dc
make it non opt
DerThorsten b5e3e2e
Merge branch 'main' into postcb
DerThorsten a42b870
updated for new conda-bld
DerThorsten 41581ca
Merge remote-tracking branch 'upstream/main' into newoba
DerThorsten 65d2e34
added python api
DerThorsten c5d52c1
hotfix to remove breakpoint
DerThorsten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
import os | ||
import sys | ||
|
||
|
||
############################################### | ||
# CONDA MONKEY-PATCH | ||
############################################### | ||
from conda.base import constants | ||
|
||
KNOWN_SUBDIRS = PLATFORM_DIRECTORIES = ( | ||
"noarch", | ||
"linux-32", | ||
"linux-64", | ||
"linux-aarch64", | ||
"linux-armv6l", | ||
"linux-armv7l", | ||
"linux-ppc64", | ||
"linux-ppc64le", | ||
"linux-s390x", | ||
"osx-64", | ||
"osx-arm64", | ||
"win-32", | ||
"win-64", | ||
"zos-z", | ||
"emscripten-32", | ||
) | ||
constants.KNOWN_SUBDIRS = KNOWN_SUBDIRS | ||
constants.PLATFORM_DIRECTORIES = PLATFORM_DIRECTORIES | ||
|
||
|
||
############################################### | ||
# CONDA-BUILD MONKEY-PATCH | ||
############################################### | ||
|
||
from conda_build import exceptions, utils, variants, environ | ||
from conda_build.conda_interface import non_x86_linux_machines | ||
from conda_build import metadata | ||
from conda_build import utils, environ | ||
from conda_build.features import feature_list | ||
|
||
try: | ||
from conda_build.conda_interface import string_types | ||
except ImportError: | ||
string_types = str | ||
from conda_build.post import filetypes_for_platform | ||
|
||
|
||
filetypes_for_platform["emscripten"] = ["wasm"] | ||
|
||
|
||
def ns_cfg(config): | ||
# Remember to update the docs of any of this changes | ||
plat = config.host_subdir | ||
d = dict( | ||
linux=plat.startswith("linux-"), | ||
linux32=bool(plat == "linux-32"), | ||
linux64=bool(plat == "linux-64"), | ||
arm=plat.startswith("linux-arm"), | ||
osx=plat.startswith("osx-"), | ||
emscripten=plat.startswith("emscripten-"), | ||
emscripten32=bool(plat == "emscripten-32"), | ||
emscripten64=bool(plat == "emscripten-64"), | ||
unix=plat.startswith(("linux-", "osx-", "emscripten-")), | ||
win=plat.startswith("win-"), | ||
win32=bool(plat == "win-32"), | ||
win64=bool(plat == "win-64"), | ||
x86=plat.endswith(("-32", "-64")), | ||
x86_64=plat.endswith("-64"), | ||
os=os, | ||
environ=os.environ, | ||
nomkl=bool(int(os.environ.get("FEATURE_NOMKL", False))), | ||
) | ||
|
||
defaults = variants.get_default_variant(config) | ||
py = config.variant.get("python", defaults["python"]) | ||
# there are times when python comes in as a tuple | ||
if not hasattr(py, "split"): | ||
py = py[0] | ||
# go from "3.6 *_cython" -> "36" | ||
# or from "3.6.9" -> "36" | ||
py = int("".join(py.split(" ")[0].split(".")[:2])) | ||
|
||
d["build_platform"] = config.build_subdir | ||
|
||
d.update( | ||
dict( | ||
py=py, | ||
py3k=bool(30 <= py < 40), | ||
py2k=bool(20 <= py < 30), | ||
py26=bool(py == 26), | ||
py27=bool(py == 27), | ||
py33=bool(py == 33), | ||
py34=bool(py == 34), | ||
py35=bool(py == 35), | ||
py36=bool(py == 36), | ||
) | ||
) | ||
|
||
np = config.variant.get("numpy") | ||
if not np: | ||
np = defaults["numpy"] | ||
if config.verbose: | ||
utils.get_logger(__name__).warn( | ||
"No numpy version specified in conda_build_config.yaml. " | ||
"Falling back to default numpy value of {}".format(defaults["numpy"]) | ||
) | ||
d["np"] = int("".join(np.split(".")[:2])) | ||
|
||
pl = config.variant.get("perl", defaults["perl"]) | ||
d["pl"] = pl | ||
|
||
lua = config.variant.get("lua", defaults["lua"]) | ||
d["lua"] = lua | ||
d["luajit"] = bool(lua[0] == "2") | ||
|
||
for machine in non_x86_linux_machines: | ||
d[machine] = bool(plat.endswith("-%s" % machine)) | ||
|
||
for feature, value in feature_list: | ||
d[feature] = value | ||
d.update(os.environ) | ||
|
||
# here we try to do some type conversion for more intuitive usage. Otherwise, | ||
# values like 35 are strings by default, making relational operations confusing. | ||
# We also convert "True" and things like that to booleans. | ||
for k, v in config.variant.items(): | ||
if k not in d: | ||
try: | ||
d[k] = int(v) | ||
except (TypeError, ValueError): | ||
if isinstance(v, string_types) and v.lower() in ("false", "true"): | ||
v = v.lower() == "true" | ||
d[k] = v | ||
return d | ||
|
||
|
||
metadata.ns_cfg = ns_cfg | ||
|
||
|
||
DEFAULT_SUBDIRS = { | ||
"linux-64", | ||
"linux-32", | ||
"linux-s390x", | ||
"linux-ppc64", | ||
"linux-ppc64le", | ||
"linux-armv6l", | ||
"linux-armv7l", | ||
"linux-aarch64", | ||
"win-64", | ||
"win-32", | ||
"osx-64", | ||
"osx-arm64", | ||
"zos-z", | ||
"noarch", | ||
"emscripten-32", | ||
} | ||
|
||
utils.DEFAULT_SUBDIRS = DEFAULT_SUBDIRS | ||
|
||
|
||
def get_shlib_ext(host_platform): | ||
# Return the shared library extension. | ||
if host_platform.startswith("win"): | ||
return ".dll" | ||
elif host_platform in ["osx", "darwin"]: | ||
return ".dylib" | ||
elif host_platform.startswith("linux") or host_platform.startswith("emscripten"): | ||
return ".so" | ||
elif host_platform == "noarch": | ||
# noarch packages should not contain shared libraries, use the system | ||
# platform if this is requested | ||
return get_shlib_ext(sys.platform) | ||
else: | ||
raise NotImplementedError(host_platform) | ||
|
||
|
||
environ.get_shlib_ext = get_shlib_ext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you check / do you know if
conda-build
does something similar?