From b1beadaceeac5556c5e4932155a58c300cf1d39b Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 2 Oct 2018 10:37:24 +0100 Subject: [PATCH 1/4] CircleCI config file --- .circleci/config.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..0ef608b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,23 @@ +version: 2 +jobs: + build: + docker: + - image: trzeci/emscripten + + working_directory: ~/repo + + steps: + - checkout + - run: + name: Native Compile + command: make + - run: + name: Native Tests + command: make test + - run: + name: JS Compile + command: make js + - run: + name: JS Tests + working_directory: ~/repo/javascript + command: npm run test From 3e775938e50bffdfcb20241d598fea74ddaaf7e0 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 3 Oct 2018 16:06:15 +0100 Subject: [PATCH 2/4] Replace the impenetrable line of perl with python Mostly because the standard emscripten docker image does not have libjson-perl, but python always comes with json. But also because it was impenetrable. --- Makefile | 2 +- exports.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 exports.py diff --git a/Makefile b/Makefile index 154954c..901e78f 100644 --- a/Makefile +++ b/Makefile @@ -164,7 +164,7 @@ fuzzers: $(FUZZER_BINARIES) $(FUZZER_DEBUG_BINARIES) .PHONY: fuzzers $(JS_EXPORTED_FUNCTIONS): $(PUBLIC_HEADERS) - perl -MJSON -ne '$$f{"_$$1"}=1 if /(olm_[^( ]*)\(/; END { @f=sort keys %f; print encode_json \@f }' $^ > $@.tmp + ./exports.py $^ > $@.tmp mv $@.tmp $@ all: test js lib debug doc diff --git a/exports.py b/exports.py new file mode 100755 index 0000000..b37cbbb --- /dev/null +++ b/exports.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +import sys +import re +import json + +expr = re.compile(r"(olm_[^( ]*)\(") + +exports = set() + +for f in sys.argv[1:]: + with open(f) as fp: + for line in fp: + matches = expr.search(line) + if matches is not None: + exports.add('_%s' % (matches.group(1),)) + +json.dump(sorted(exports), sys.stdout) From 8161fa51a8d92da400114f20e101fd1774145005 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 3 Oct 2018 16:24:21 +0100 Subject: [PATCH 3/4] run npm install --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0ef608b..07fa3fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,6 +17,9 @@ jobs: - run: name: JS Compile command: make js + - run: + name: Install JS Deps + command: npm install - run: name: JS Tests working_directory: ~/repo/javascript From 031eb2dc7591b85937668513d44a08991f4b3d8e Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 3 Oct 2018 16:26:17 +0100 Subject: [PATCH 4/4] ...in the right dir --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07fa3fb..0a891db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,6 +19,7 @@ jobs: command: make js - run: name: Install JS Deps + working_directory: ~/repo/javascript command: npm install - run: name: JS Tests