diff --git a/blst b/blst index fd7f270c..97878c22 160000 --- a/blst +++ b/blst @@ -1 +1 @@ -Subproject commit fd7f270c173093ea07385d29020d34e9e8709967 +Subproject commit 97878c222e7b21670d6926cc98ce3e400249393f diff --git a/blst_wrap.py b/blst_wrap.py deleted file mode 100644 index e3cd75bc..00000000 --- a/blst_wrap.py +++ /dev/null @@ -1,62 +0,0 @@ -import sys -import subprocess -import re -import shutil -import os -import os.path - - -pythonScript = sys.argv[0] -# ../blst.swg -SOURCE_SWIG_FILE = sys.argv[1] -# <(INTERMEDIATE_DIR)/blst_wrap.cpp -# In Github actions: /home/runner/work/blst-ts/blst-ts/blst/bindings/node.js/build/Release/obj.target/blst/geni/blst_wrap.cpp -BLST_WRAP_CPP_TARGET = sys.argv[2] -BLST_WRAP_CPP_PREBUILD = os.getenv('BLST_WRAP_CPP_PREBUILD') -SWIG_SKIP_RUN = os.getenv('SWIG_SKIP_RUN') - -print("SOURCE_SWIG_FILE", SOURCE_SWIG_FILE) -print("BLST_WRAP_CPP_TARGET", BLST_WRAP_CPP_TARGET) -print("BLST_WRAP_CPP_PREBUILD", BLST_WRAP_CPP_PREBUILD) -print("SWIG_SKIP_RUN", SWIG_SKIP_RUN) -print("CWD", os.getcwd()) - - -if BLST_WRAP_CPP_PREBUILD and os.path.isfile(BLST_WRAP_CPP_PREBUILD): - print("Copying and using BLST_WRAP_CPP_PREBUILD") - shutil.copyfile(BLST_WRAP_CPP_PREBUILD, BLST_WRAP_CPP_TARGET) - sys.exit(0) -else: - if SWIG_SKIP_RUN: - print("BLST_WRAP_CPP_PREBUILD not found, but it should exist since SWIG_SKIP_RUN=true") - sys.exit(201) - else: - print("BLST_WRAP_CPP_TARGET not found, building") - -try: - version = subprocess.check_output(["swig", "-version"]).decode('ascii') - print(version) - v = re.search(r'SWIG Version ([0-9]+)', version) - if v and int(v.group(1)) >= 4: - print("Running SWIG...") - subprocess.check_call(["swig", "-c++", "-javascript", - "-node", "-DV8_VERSION=0x060000", - "-o", BLST_WRAP_CPP_TARGET, SOURCE_SWIG_FILE]) - else: - print("Unsupported swig version") - sys.exit(202) - -except OSError as e: - if e.errno == 2: # "no such file or directory" - print("SWIG not installed", e) - else: - print("Error checking SWIG version", e) - sys.exit(e.errno) - - -if BLST_WRAP_CPP_PREBUILD: - print("Copying built BLST_WRAP_CPP_TARGET to BLST_WRAP_CPP_PREBUILD") - shutil.copyfile(BLST_WRAP_CPP_TARGET, BLST_WRAP_CPP_PREBUILD) - - -print("Done") diff --git a/src/scripts/buildBindings.ts b/src/scripts/buildBindings.ts index 075bc5c9..aaefc907 100644 --- a/src/scripts/buildBindings.ts +++ b/src/scripts/buildBindings.ts @@ -8,8 +8,6 @@ import { findBindingsFile, BINDINGS_DIR, BLST_WRAP_CPP_PREBUILD, - BLST_WRAP_PY_PATCH, - BLST_WRAP_PY_FILE, } from "./paths"; export async function buildBindings(binaryPath: string) { @@ -37,9 +35,6 @@ export async function buildBindings(binaryPath: string) { } } - // Copy patched blst_wrap.py and bindings.gyp - fs.copyFileSync(BLST_WRAP_PY_PATCH, BLST_WRAP_PY_FILE); - // From https://github.com/sass/node-sass/blob/769f3a6f5a3949bd8e69c6b0a5d385a9c07924b4/scripts/build.js#L59 const nodeJsExec = process.execPath; const nodeGypExec = require.resolve( diff --git a/src/scripts/paths.ts b/src/scripts/paths.ts index b74e687e..ab191178 100644 --- a/src/scripts/paths.ts +++ b/src/scripts/paths.ts @@ -16,10 +16,6 @@ export const BLST_WRAP_CPP_PREBUILD = path.resolve( "blst_wrap.cpp" ); -// Paths for custom python script to build blst_wrap.cpp -export const BLST_WRAP_PY_PATCH = path.join(ROOT_DIR, "blst_wrap.py"); -export const BLST_WRAP_PY_FILE = path.join(BINDINGS_DIR, "blst_wrap.py"); - /** * Get binary name. * name: {platform}-{arch}-{v8 version}.node