Skip to content

Commit 55501be

Browse files
committed
call swift driver with absolute path
1 parent a9e0cbe commit 55501be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

classes/swift.bbclass

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ python swift_do_package_resolve() {
6060

6161
s = d.getVar('S')
6262
b = d.getVar('B')
63+
recipe_sysroot_native = d.getVar("STAGING_DIR_NATIVE", True)
6364

6465
env = os.environ.copy()
6566

6667
ssh_auth_sock = d.getVar('BB_ORIGENV').get('SSH_AUTH_SOCK')
6768
if ssh_auth_sock:
6869
env['SSH_AUTH_SOCK'] = ssh_auth_sock
6970

70-
ret = subprocess.call(['swift', 'package', 'resolve', '--package-path', s, '--build-path', b], env=env)
71+
ret = subprocess.call([f'{recipe_sysroot_native}/usr/bin/swift', 'package', 'resolve', '--package-path', s, '--build-path', b], env=env)
7172
if ret != 0:
7273
bb.fatal('swift package resolve failed')
7374

@@ -222,13 +223,14 @@ python swift_do_compile() {
222223
extra_oeswift = shlex.split(d.getVar('EXTRA_OESWIFT'))
223224
ssh_auth_sock = d.getVar('BB_ORIGENV').get('SSH_AUTH_SOCK')
224225
recipe_sysroot = d.getVar("STAGING_DIR_TARGET", True)
226+
recipe_sysroot_native = d.getVar("STAGING_DIR_NATIVE", True)
225227

226228
env = os.environ.copy()
227229
if ssh_auth_sock:
228230
env['SSH_AUTH_SOCK'] = ssh_auth_sock
229231
env['SYSROOT'] = recipe_sysroot
230232

231-
args = ['swift', 'build', '--package-path', s, '--build-path', b, '-c', build_mode, '--destination', destination_json] + extra_oeswift
233+
args = [f'{recipe_sysroot_native}/usr/bin/swift', 'build', '--package-path', s, '--build-path', b, '-c', build_mode, '--destination', destination_json] + extra_oeswift
232234

233235
ret = subprocess.call(args, env=env, cwd=s)
234236
if ret != 0:

0 commit comments

Comments
 (0)