Skip to content

Commit 59934ae

Browse files
committed
Escape weakNodeApiPath
1 parent 3651d7b commit 59934ae

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/ferric/src/cargo.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,12 @@ export function getTargetEnvironmentVariables({
169169
const weakNodeApiPath = getWeakNodeApiAndroidLibraryPath(target);
170170

171171
return {
172-
RUSTFLAGS: `-L ${weakNodeApiPath} -l weak-node-api`,
172+
CARGO_ENCODED_RUSTFLAGS: [
173+
"-L",
174+
weakNodeApiPath,
175+
"-l",
176+
"weak-node-api",
177+
].join(String.fromCharCode(0x1f)),
173178
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER: joinPathAndAssertExistence(
174179
toolchainBinPath,
175180
`aarch64-linux-android${androidApiLevel}-clang`
@@ -205,7 +210,12 @@ export function getTargetEnvironmentVariables({
205210
} else if (isAppleTarget(target)) {
206211
const weakNodeApiFrameworkPath = getWeakNodeApiFrameworkPath(target);
207212
return {
208-
RUSTFLAGS: `-L framework=${weakNodeApiFrameworkPath} -l framework=weak-node-api`,
213+
CARGO_ENCODED_RUSTFLAGS: [
214+
"-L",
215+
`framework=${weakNodeApiFrameworkPath}`,
216+
"-l",
217+
"framework=weak-node-api",
218+
].join(String.fromCharCode(0x1f)),
209219
};
210220
} else {
211221
throw new Error(`Unexpected target: ${target}`);

0 commit comments

Comments
 (0)