Skip to content

Commit

Permalink
Replace Circle-CI CPU_CORES hack with environment variables (now supp…
Browse files Browse the repository at this point in the history
…orted upstream)
  • Loading branch information
aseering committed Dec 30, 2019
1 parent f98aaf6 commit 6b308e2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ defaults: &defaults
working_directory: ~/repo
docker:
- image: iodide/pyodide-env:0.3.1
environment:
- EMSDK_NUM_CORES: 4
EMCC_CORES: 4

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ PYODIDE_EMCC=$(PYODIDE_ROOT)/ccache/emcc
PYODIDE_CXX=$(PYODIDE_ROOT)/ccache/em++

SHELL := /bin/bash
CC=emcc
CXX=em++
CC=$(shell which emcc)
CXX=$(shell which em++)
OPTFLAGS=-O3
CFLAGS=$(OPTFLAGS) -g -I$(PYTHONINCLUDE) -Wno-warn-absolute-paths
CXXFLAGS=$(CFLAGS) -std=c++14
Expand Down
7 changes: 5 additions & 2 deletions cpython/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ BZIP2TARBALL=$(ROOT)/downloads/bzip2-1.0.2.tar.gz
BZIP2BUILD=$(ROOT)/build/bzip2-1.0.2
BZIP2URL=ftp://sources.redhat.com/pub/bzip2/v102/bzip2-1.0.2.tar.gz

ifeq ($(shell uname),Darwin)
MAC_SDK_PATH := $(shell xcrun --show-sdk-path)
MAC_BUILD_VARS := CFLAGS=-I$(MAC_SDK_PATH)/usr/include CXXFLAGS=-I$(MAC_SDK_PATH)/usr/include
endif

all: $(INSTALL)/lib/$(LIB)

Expand Down Expand Up @@ -72,13 +76,12 @@ $(BZIP2TARBALL):
[ -d $(ROOT)/downloads ] || mkdir $(ROOT)/downloads
wget -q -O $@ $(BZIP2URL)


$(HOSTPYTHON) $(HOSTPGEN): $(TARBALL)
mkdir -p $(HOSTINSTALL)
[ -d $(HOSTBUILD) ] || tar -C $(HOSTINSTALL) -xf $(TARBALL)
( \
cd $(HOSTBUILD); \
PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" ./configure --prefix=$(HOSTINSTALL) || cat config.log && \
PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" ./configure $(MAC_BUILD_VARS) --prefix=$(HOSTINSTALL) || cat config.log && \
make regen-grammar && \
make install && \
cp Parser/pgen$(EXE) $(HOSTINSTALL)/bin/ && \
Expand Down
4 changes: 0 additions & 4 deletions emsdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ include ../Makefile.envs

all: emsdk/.complete

# We hack the CPU_CORES, because if you use all of the cores on Circle-CI, you
# run out of memory.

emsdk/.complete:
if [ -d emsdk ]; then rm -rf emsdk; fi
git clone https://github.com/juj/emsdk.git
sed -i -e "s#CPU_CORES = max(multiprocessing.cpu_count()-1, 1)#CPU_CORES = 3#g" emsdk/emsdk
( \
cd emsdk && \
./emsdk install --build=Release sdk-fastcomp-tag-$(EMSCRIPTEN_VERSION)-64bit binaryen-tag-$(EMSCRIPTEN_VERSION)-64bit && \
Expand Down

0 comments on commit 6b308e2

Please sign in to comment.