From 7b89d103ce5ca128ad74568304b9fe618858186d Mon Sep 17 00:00:00 2001 From: Julius Krumbiegel Date: Wed, 11 Dec 2024 10:38:58 +0100 Subject: [PATCH 1/3] Fix powershell ArgumentList bug --- src/execute/julia.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/execute/julia.ts b/src/execute/julia.ts index f83241ef5c3..2809258515d 100644 --- a/src/execute/julia.ts +++ b/src/execute/julia.ts @@ -248,6 +248,12 @@ export const juliaEngine: ExecutionEngine = { }, }; +function powershell_argument_list_to_string(...args: string[]): string { + // formats as '"arg 1" "arg 2" "arg 3"' + const inner = args.map((arg) => `"${arg}"`).join(" "); + return `'${inner}'`; +} + async function startOrReuseJuliaServer( options: JuliaExecuteOptions, ): Promise<{ reused: boolean }> { @@ -310,15 +316,12 @@ async function startOrReuseJuliaServer( "Start-Process", options.julia_cmd, "-ArgumentList", - // string array argument list, each element but the last must have a "," element after - "--startup-file=no", - ",", - `--project=${juliaProject}`, - ",", - resourcePath("julia/quartonotebookrunner.jl"), - ",", - transportFile, - // end of string array + powershell_argument_list_to_string( + "--startup-file=no", + `--project=${juliaProject}`, + resourcePath("julia/quartonotebookrunner.jl"), + transportFile, + ), "-WindowStyle", "Hidden", ], From c3ca827faefe5904440cf79eef89b0968009e052 Mon Sep 17 00:00:00 2001 From: Julius Krumbiegel Date: Tue, 7 Jan 2025 15:47:59 +0100 Subject: [PATCH 2/3] replace backslashes in user-specified project path --- src/execute/julia.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/execute/julia.ts b/src/execute/julia.ts index 2809258515d..e35b45e8b62 100644 --- a/src/execute/julia.ts +++ b/src/execute/julia.ts @@ -34,7 +34,7 @@ import { } from "../config/format.ts"; import { resourcePath } from "../core/resources.ts"; import { quartoRuntimeDir } from "../core/appdirs.ts"; -import { normalizePath } from "../core/path.ts"; +import { normalizePath, pathWithForwardSlashes } from "../core/path.ts"; import { isInteractiveSession } from "../core/platform.ts"; import { runningInCI } from "../core/ci-info.ts"; import { sleep } from "../core/async.ts"; @@ -271,6 +271,7 @@ async function startOrReuseJuliaServer( await ensureQuartoNotebookRunnerEnvironment(options); juliaProject = juliaRuntimeDir(); } else { + juliaProject = pathWithForwardSlashes(juliaProject); trace( options, `Custom julia project set via QUARTO_JULIA_PROJECT="${juliaProject}". Checking if QuartoNotebookRunner can be loaded.`, From f44e5526334885423995e561338436020af8a95e Mon Sep 17 00:00:00 2001 From: Julius Krumbiegel Date: Wed, 8 Jan 2025 16:01:54 +0100 Subject: [PATCH 3/3] add changelog --- news/changelog-1.7.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/news/changelog-1.7.md b/news/changelog-1.7.md index daec9d8d52c..86a5d74ea9f 100644 --- a/news/changelog-1.7.md +++ b/news/changelog-1.7.md @@ -22,6 +22,12 @@ All changes included in 1.7: that allows to check whether a node is empty, i.e., whether it's an empty list, has no child nodes, and contains no text. +## Engines + +### `julia` + +- ([#11659](https://github.com/quarto-dev/quarto-cli/pull/11659)): Fix escaping bug where paths containing spaces or backslashes break server startup on Windows. + ## Other Fixes and Improvements - ([#11643](https://github.com/quarto-dev/quarto-cli/issues/11643)): Improve highlighting of nested code block inside markdown code block, i.e. using ` ```{{python}} ` or ` ```python ` inside ` ````markdown` fenced code block.