From 07c56d95e3f9568902ecb8c754dee5bad89bfc52 Mon Sep 17 00:00:00 2001 From: John Lindsay Date: Sun, 19 May 2024 05:23:32 -0400 Subject: [PATCH] Update build.py --- build.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/build.py b/build.py index 9a370319..c4bc2519 100755 --- a/build.py +++ b/build.py @@ -24,8 +24,8 @@ def build(do_clean=False, exclude_runner=False, create_zip_artifact=False): plugins_dir = os.path.join(app_dir, 'whitebox-plugins/src') target_dir = os.path.join(app_dir, 'target/release') - # if platform.system() == "Linux": - # target_dir = os.path.join(app_dir, 'target/x86_64-unknown-linux-musl/release') + if platform.system() == "Linux": + target_dir = os.path.join(app_dir, 'target/x86_64-unknown-linux-musl/release') if do_clean: print("Cleaning old files...") @@ -52,18 +52,18 @@ def build(do_clean=False, exclude_runner=False, create_zip_artifact=False): print("Compiling...") - result = subprocess.run(['cargo', 'build', "--release"], stdout=subprocess.PIPE) - if len(result.stdout) > 0: - print(result.stdout) - # if platform.system() != 'Linux': - # result = subprocess.run(['cargo', 'build', "--release"], stdout=subprocess.PIPE) - # if len(result.stdout) > 0: - # print(result.stdout) - # else: - # print("Compiling for musl target...") - # result = subprocess.run(['cargo', 'build', "--release", "--target=x86_64-unknown-linux-musl"], stdout=subprocess.PIPE) - # if len(result.stdout) > 0: - # print(result.stdout) + # result = subprocess.run(['cargo', 'build', "--release"], stdout=subprocess.PIPE) + # if len(result.stdout) > 0: + # print(result.stdout) + if platform.system() != 'Linux': + result = subprocess.run(['cargo', 'build', "--release"], stdout=subprocess.PIPE) + if len(result.stdout) > 0: + print(result.stdout) + else: + print("Compiling for musl target...") + result = subprocess.run(['cargo', 'build', "--release", "--target=x86_64-unknown-linux-musl"], stdout=subprocess.PIPE) + if len(result.stdout) > 0: + print(result.stdout) if not os.path.exists(output_plugin_dir): os.makedirs(output_plugin_dir)