From dd41047b0ad817c1b80ad51461c912a68c349d1e Mon Sep 17 00:00:00 2001 From: Finagolfin Date: Thu, 12 Oct 2023 17:58:24 +0530 Subject: [PATCH] Use new SwiftPM flag to remove `$ORIGIN` from installed sourcekit-lsp ELF executable runpath Also, move installation-only environment variable into get_swiftpm_environment_variables(). --- Utilities/build-script-helper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Utilities/build-script-helper.py b/Utilities/build-script-helper.py index daf1169ed..0be9c2da5 100755 --- a/Utilities/build-script-helper.py +++ b/Utilities/build-script-helper.py @@ -124,6 +124,8 @@ def get_swiftpm_options(swift_exec: str, args: argparse.Namespace) -> List[str]: '-Xcxx', '-I', '-Xcxx', os.path.join(args.toolchain, 'lib', 'swift', 'Block'), ] + if args.action == 'install': + swiftpm_args += ['--disable-local-rpath'] if '-android' in build_target: swiftpm_args += [ @@ -181,6 +183,9 @@ def get_swiftpm_environment_variables(swift_exec: str, args: argparse.Namespace) if args.action == 'test' and not args.skip_long_tests: env['SOURCEKIT_LSP_ENABLE_LONG_TESTS'] = '1' + if args.action == 'install': + env['SOURCEKIT_LSP_CI_INSTALL'] = "1" + return env @@ -190,8 +195,6 @@ def build_single_product(product: str, swift_exec: str, args: argparse.Namespace """ swiftpm_args = get_swiftpm_options(swift_exec, args) additional_env = get_swiftpm_environment_variables(swift_exec, args) - if args.action == 'install': - additional_env['SOURCEKIT_LSP_CI_INSTALL'] = "1" cmd = [swift_exec, 'build', '--product', product] + swiftpm_args check_call(cmd, additional_env=additional_env, verbose=args.verbose)