From 55d021ccb10ae30c385db84ad3dce66f1d37a395 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Tue, 7 Feb 2023 16:30:57 -0500 Subject: [PATCH] fix build (publish): Copy libspark.dll to publish dir Bugs (fixed): * Spark.exe generated by the installer crashes immediately on launch because it cannot find the libspark.dll. Cause: Sure enough, libspark.dll isn't in the install folder (AppData\Roaming\bts\Spark) * Build libspark explicitly * Fix libspark.dll copy src path --- tools/py/build_spark.py | 2 +- tools/py/core/file_utils.py | 2 +- tools/py/publish_spark.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/py/build_spark.py b/tools/py/build_spark.py index fedbddccc..96fa4c02c 100644 --- a/tools/py/build_spark.py +++ b/tools/py/build_spark.py @@ -310,7 +310,7 @@ def build( build_cmd_steps.append(f'cd {Path(t.path).parent}') build_cmd_steps.append('dotnet publish -c Release -r win-x64 --sc') build_cmd_steps.append( - f'copy {bins.joinpath("libspark.dll")} {bins.joinpath("publish")}') + f'copy {bins.joinpath("libspark.dll")} {bins.joinpath("win-x64", "publish")}') build_cmd = ' && '.join(build_cmd_steps) proc_results.append(subprocess.run(build_cmd)) diff --git a/tools/py/core/file_utils.py b/tools/py/core/file_utils.py index a2dcf6da1..b0fb82163 100644 --- a/tools/py/core/file_utils.py +++ b/tools/py/core/file_utils.py @@ -42,7 +42,7 @@ class SparkPaths: @staticmethod def client_bins(build_root=_default_build(), configuration='Release'): - return build_root.joinpath(configuration, 'bin', 'net6.0-windows', 'win-x64') + return build_root.joinpath(configuration, 'bin', 'net6.0-windows') @staticmethod def client_sln(): diff --git a/tools/py/publish_spark.py b/tools/py/publish_spark.py index 14db7689a..69ff3cf07 100644 --- a/tools/py/publish_spark.py +++ b/tools/py/publish_spark.py @@ -41,7 +41,7 @@ def _main(): configuration='release', restore=True, build_dir=output_dir, - targets=['publish'], + targets=['libspark', 'publish'], verbosity=args.verbosity)