Skip to content

Commit 5768885

Browse files
committed
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().
1 parent f0ee6b1 commit 5768885

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Utilities/build-script-helper.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ def get_swiftpm_options(swift_exec: str, args: argparse.Namespace) -> List[str]:
124124
'-Xcxx', '-I', '-Xcxx',
125125
os.path.join(args.toolchain, 'lib', 'swift', 'Block'),
126126
]
127+
if args.action == 'install':
128+
swiftpm_args += ['--disable-local-rpath']
127129

128130
if '-android' in build_target:
129131
swiftpm_args += [
@@ -181,6 +183,9 @@ def get_swiftpm_environment_variables(swift_exec: str, args: argparse.Namespace)
181183
if args.action == 'test' and args.skip_long_tests:
182184
env['SKIP_LONG_TESTS'] = '1'
183185

186+
if args.action == 'install':
187+
additional_env['SOURCEKIT_LSP_CI_INSTALL'] = "1"
188+
184189
return env
185190

186191

@@ -190,8 +195,6 @@ def build_single_product(product: str, swift_exec: str, args: argparse.Namespace
190195
"""
191196
swiftpm_args = get_swiftpm_options(swift_exec, args)
192197
additional_env = get_swiftpm_environment_variables(swift_exec, args)
193-
if args.action == 'install':
194-
additional_env['SOURCEKIT_LSP_CI_INSTALL'] = "1"
195198
cmd = [swift_exec, 'build', '--product', product] + swiftpm_args
196199
check_call(cmd, additional_env=additional_env, verbose=args.verbose)
197200

0 commit comments

Comments
 (0)