Skip to content

Commit 3086c36

Browse files
committed
deno - use --allow-all to avoid issues with reading / writing on network drive
This is an issue with Deno 1.46.3 where --allow-read and --allow-write does not give enough permissions to read / write with files on network drive closes #11332
1 parent adc7186 commit 3086c36

File tree

8 files changed

+18
-12
lines changed

8 files changed

+18
-12
lines changed

package/launcher/src/main.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,9 @@ fn main() {
8787
String::from("--no-config"),
8888
String::from("--cached-only"),
8989
String::from("--no-lock"),
90-
String::from("--allow-read"),
91-
String::from("--allow-write"),
92-
String::from("--allow-run"),
93-
String::from("--allow-env"),
94-
String::from("--allow-net"),
95-
String::from("--allow-ffi"),
90+
// Using --allow-all as there is otherwise an issue in Deno 1.46.3 with --allow-read and --allow-write with network drives
91+
// https://github.com/quarto-dev/quarto-cli/issues/11332
92+
String::from("--allow-all"),
9693
];
9794

9895
// # --enable-experimental-regexp-engine is required for /regex/l, https://github.com/quarto-dev/quarto-cli/issues/9737

package/scripts/common/quarto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ fi
169169
export DENO_TLS_CA_STORE=system,mozilla
170170
export DENO_NO_UPDATE_CHECK=1
171171
# Be sure to include any already defined QUARTO_DENO_OPTIONS
172-
QUARTO_DENO_OPTIONS="--unstable-ffi --unstable-kv --no-config --no-lock ${QUARTO_CACHE_OPTIONS} --allow-read --allow-write --allow-run --allow-env --allow-net --allow-ffi ${QUARTO_DENO_OPTIONS}"
172+
## Using --allow-all as there is otherwise an issue in Deno 1.46.3 with --allow-read and --allow-write with network drives
173+
## https://github.com/quarto-dev/quarto-cli/issues/11332
174+
QUARTO_DENO_OPTIONS="--unstable-ffi --unstable-kv --no-config --no-lock ${QUARTO_CACHE_OPTIONS} --allow-all ${QUARTO_DENO_OPTIONS}"
173175

174176
# --enable-experimental-regexp-engine is required for /regex/l, https://github.com/quarto-dev/quarto-cli/issues/9737
175177
if [ "$QUARTO_DENO_V8_OPTIONS" != "" ]; then

package/scripts/windows/quarto.cmd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ IF NOT DEFINED QUARTO_DENO (
105105

106106
SET "DENO_TLS_CA_STORE=system,mozilla"
107107
SET "DENO_NO_UPDATE_CHECK=1"
108-
SET "QUARTO_DENO_OPTIONS=--unstable-kv --unstable-ffi --no-config --no-lock --allow-read --allow-write --allow-run --allow-env --allow-net --allow-ffi !QUARTO_DENO_OPTIONS!"
108+
REM Using --allow-all as there is otherwise an issue in Deno 1.46.3 with --allow-read and --allow-write with network drives
109+
REM https://github.com/quarto-dev/quarto-cli/issues/11332
110+
SET "QUARTO_DENO_OPTIONS=--unstable-kv --unstable-ffi --no-config --no-lock --allow-all !QUARTO_DENO_OPTIONS!"
109111

110112
REM Add expected V8 options to QUARTO_DENO_V8_OPTIONS
111113
IF DEFINED QUARTO_DENO_V8_OPTIONS (

package/src/common/compile-quarto-latexmk.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,18 @@ export function compileQuartoLatexmkCommand() {
6868
});
6969
}
7070

71+
// Using --allow-all as there is otherwise an issue in Deno 1.46.3 with --allow-read and --allow-write with network drives
72+
// https://github.com/quarto-dev/quarto-cli/issues/11332
73+
/*
7174
const kFlags = [
7275
"--allow-read",
7376
"--allow-write",
7477
"--allow-run",
7578
"--allow-env",
7679
"--allow-net",
7780
];
81+
*/
82+
const kFlags = ["--allow-all"];
7883

7984
export async function installQuartoLatexmk(
8085
config: Configuration,

package/src/quarto-bld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ export DENO_NO_UPDATE_CHECK=1
1717

1818
# TODO: Consider generating a source map or something to get a good stack
1919
# Create the Deno bundle
20-
"$QUARTO_DENO" run --no-check --unstable-kv --unstable-ffi --allow-env --allow-read --allow-write --allow-run --allow-net --allow-ffi --v8-flags=--stack-trace-limit=100 --importmap="${SCRIPT_PATH}/../../src/import_map.json" "$SCRIPT_PATH/bld.ts" $@
20+
"$QUARTO_DENO" run --no-check --unstable-kv --unstable-ffi --allow-all --v8-flags=--stack-trace-limit=100 --importmap="${SCRIPT_PATH}/../../src/import_map.json" "$SCRIPT_PATH/bld.ts" $@

package/src/quarto-bld.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ if NOT DEFINED QUARTO_DENO (
99
SET "RUST_BACKTRACE=full"
1010
SET "DENO_NO_UPDATE_CHECK=1"
1111

12-
"%QUARTO_DENO%" run --unstable-kv --unstable-ffi --allow-read --allow-write --allow-run --allow-env --allow-net --allow-ffi --importmap=%~dp0\..\..\src\dev_import_map.json %~dp0\bld.ts %*
12+
"%QUARTO_DENO%" run --unstable-kv --unstable-ffi --allow-all --importmap=%~dp0\..\..\src\dev_import_map.json %~dp0\bld.ts %*

tests/run-tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ $Env:QUARTO_DEBUG = "true"
5656
# Preparing running Deno with default arguments
5757

5858
$QUARTO_IMPORT_MAP_ARG="--importmap=$(Join-Path $QUARTO_SRC_DIR "import_map.json")"
59-
$QUARTO_DENO_OPTIONS="--config test-conf.json --v8-flags=--enable-experimental-regexp-engine,--max-old-space-size=8192,--max-heap-size=8192 --unstable-kv --unstable-ffi --no-lock --allow-read --allow-write --allow-run --allow-env --allow-net --check"
59+
$QUARTO_DENO_OPTIONS="--config test-conf.json --v8-flags=--enable-experimental-regexp-engine,--max-old-space-size=8192,--max-heap-size=8192 --unstable-kv --unstable-ffi --no-lock --allow-all --check"
6060

6161
# Parsing argument passed to the script
6262

tests/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export QUARTO_BIN_PATH=$DENO_DIR
2323
export QUARTO_SHARE_PATH="`cd "$QUARTO_ROOT/src/resources/";pwd`"
2424
export QUARTO_DEBUG=true
2525

26-
QUARTO_DENO_OPTIONS="--config test-conf.json --v8-flags=--enable-experimental-regexp-engine,--max-old-space-size=8192,--max-heap-size=8192 --unstable-kv --unstable-ffi --no-lock --allow-read --allow-write --allow-run --allow-env --allow-net"
26+
QUARTO_DENO_OPTIONS="--config test-conf.json --v8-flags=--enable-experimental-regexp-engine,--max-old-space-size=8192,--max-heap-size=8192 --unstable-kv --unstable-ffi --no-lock --allow-all"
2727

2828

2929
if [[ -z $GITHUB_ACTION ]] && [[ -z $QUARTO_TESTS_NO_CONFIG ]]

0 commit comments

Comments
 (0)