Skip to content
Merged
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
92 changes: 92 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
version: 2.1

orbs:
win: circleci/windows@1.0.0

executors:
bionic:
docker:
- image: buildpack-deps:bionic

jobs:
flake8:
executor: bionic
steps:
- checkout
- run:
name: install pip
command: |
apt-get update -q
apt-get install -q -y python-pip python3-pip
- run: python2 -m pip install --upgrade pip
- run: python3 -m pip install --upgrade pip
- run: python2 -m pip install flake8==3.7.8
- run: python3 -m pip install flake8==3.7.8
- run: python2 -m flake8 --show-source --statistics
- run: python3 -m flake8 --show-source --statistics
test-linux:
executor: bionic
environment:
EMSDK_NOTTY: "1"
# I don't know why circleci VMs pretent to have 36 cores but its a lie.
EMSDK_NUM_CORES: "4"
steps:
- checkout
- run:
name: Install debian packages
command: apt-get update -q && apt-get install -q -y cmake build-essential openjdk-8-jre-headless
- run: ./test.sh
- run: ./test.py
test-mac:
macos:
xcode: "9.0"
environment:
EMSDK_NOTTY: "1"
# Without this, any `brew installl` command will result in self-update of
# brew itself which takes more than 4 minutes.
HOMEBREW_NO_AUTO_UPDATE: "1"
steps:
- checkout
- run:
name: Install cmake
command: brew install cmake
- run: ./test.sh
# TODO(sbc): Re-enable once the upstream emscripten fix makes it into
# a relase: https://github.com/emscripten-core/emscripten/pull/9347
#- run: ./test.py
test-windows:
executor:
name: win/vs2019
shell: bash.exe
environment:
# We need python installed before we can test anytyhing.
# There seems to be undocument copy of python installed here. Hopefully
# if this disappears there will be another way of getting a re-installed
# version.
PYTHON_BIN: "C:\\Python27amd64"
PYTHONUNBUFFERED: "1"
EMSDK_NOTTY: "1"
steps:
- checkout
- run:
name: Add python to bash path
command: echo "export PATH=\"$PATH:/c/python27amd64/\"" >> $BASH_ENV
- run:
name: Install latest
shell: cmd.exe
command: test.bat
- run: python test.py

workflows:
flake8:
jobs:
- flake8
test-linux:
jobs:
- test-linux
test-mac:
jobs:
- test-mac
test-windows:
jobs:
- test-windows
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

15 changes: 0 additions & 15 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion emsdk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ base_dir=$(dirname "$0")

# Look for python3 first. This is especially important on macOS (See:
# https://github.com/emscripten-core/emsdk/pull/273)
python=$(which python3)
python=$(which python3 2> /dev/null)
if [ $? != 0 ]; then
python=python
fi
Expand Down
34 changes: 17 additions & 17 deletions emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@

emsdk_packages_url = emsdk_master_server

emscripten_git_repo = 'https://github.com/emscripten-core/emscripten.git'
binaryen_git_repo = 'https://github.com/WebAssembly/binaryen.git'
emscripten_releases_repo = 'https://chromium.googlesource.com/emscripten-releases'

emscripten_releases_download_url_template = "https://storage.googleapis.com/webassembly/emscripten-releases-builds/%s/%s/wasm-binaries.%s"
Expand All @@ -54,8 +52,8 @@
zips_subdir = 'zips/'

# Enable this to do very verbose printing about the different steps that are being run. Useful for debugging.
VERBOSE = bool(os.getenv('EMSDK_VERBOSE')) if os.getenv('EMSDK_VERBOSE') is not None else False
TTY_OUTPUT = sys.stdout.isatty()
VERBOSE = int(os.getenv('EMSDK_VERBOSE', '0'))
TTY_OUTPUT = not os.getenv('EMSDK_NOTTY', not sys.stdout.isatty())

POWERSHELL = bool(os.getenv('EMSDK_POWERSHELL'))

Expand Down Expand Up @@ -98,7 +96,7 @@
print()

# Don't saturate all cores to not steal the whole system, but be aggressive.
CPU_CORES = max(multiprocessing.cpu_count() - 1, 1)
CPU_CORES = int(os.environ.get('EMSDK_NUM_CORES', max(multiprocessing.cpu_count() - 1, 1)))

CMAKE_BUILD_TYPE_OVERRIDE = None

Expand Down Expand Up @@ -627,7 +625,8 @@ def download_file(url, dstpath, download_even_if_exists=False, filename_prefix='
sys.stdout.flush()
progress_shown += 1
if not TTY_OUTPUT:
print(']')
print(']')
sys.stdout.flush()
except Exception as e:
print("Error downloading URL '" + url + "': " + str(e))
rmfile(file_name)
Expand Down Expand Up @@ -918,7 +917,8 @@ def make_build(build_root, build_type, build_target_platform='x64'):
def cmake_configure(generator, build_root, src_root, build_type, extra_cmake_args=[]):
if VERBOSE: print('cmake_configure(generator=' + str(generator) + ', build_root=' + str(build_root) + ', src_root=' + str(src_root) + ', build_type=' + str(build_type) + ', extra_cmake_args=' + str(extra_cmake_args) + ')')
# Configure
if not os.path.isdir(build_root): os.mkdir(build_root) # Create build output directory if it doesn't yet exist.
if not os.path.isdir(build_root):
os.mkdir(build_root) # Create build output directory if it doesn't yet exist.
try:
if generator: generator = ['-G', generator]
else: generator = []
Expand Down Expand Up @@ -1463,7 +1463,8 @@ def is_installed(self):

def each_path_exists(pathlist):
for path in pathlist:
if not os.path.exists(path): return False
if not os.path.exists(path):
return False
return True

content_exists = os.path.exists(self.installation_path()) and each_path_exists(activated_path) and (os.path.isfile(self.installation_path()) or num_files_in_directory(self.installation_path()) > 0)
Expand Down Expand Up @@ -1953,12 +1954,9 @@ def load_releases_versions():


def is_string(s):
# Python3 compat
try:
basestring
except NameError:
basestring = str
return isinstance(s, basestring)
if sys.version_info[0] >= 3:
return isinstance(s, str)
return isinstance(s, basestring) # noqa


def load_sdk_manifest():
Expand Down Expand Up @@ -2759,6 +2757,7 @@ def print_tools(t):
success = tool.install()
if not success:
return 1
return 0
elif cmd == 'uninstall':
if len(sys.argv) <= 2:
print("Syntax error. Call 'emsdk uninstall <tool name>'. Call 'emsdk list' to obtain a list of available tools.")
Expand All @@ -2768,9 +2767,10 @@ def print_tools(t):
print("Error: Tool by name '" + sys.argv[2] + "' was not found.")
return 1
tool.uninstall()
else:
print("Unknown command '" + cmd + "' given! Type 'emsdk help' to get a list of commands.")
return 1
return 0

print("Unknown command '" + cmd + "' given! Type 'emsdk help' to get a list of commands.")
return 1


if __name__ == '__main__':
Expand Down
6 changes: 6 additions & 0 deletions test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:: equivilent of test.sh as windows bat file
set PATH=%PATH%;%PYTHON_BIN%
@CALL emsdk install latest
@CALL emsdk activate latest
@CALL emsdk_env.bat --build=Release
@CALL emcc.bat -v
Loading