denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.98k stars 5.23k forks source link

Issue running deno 1.33.2 in Quarto 1.4.163 to convert document with dot graph on macOS #19589

Open bcdavasconcelos opened 1 year ago

bcdavasconcelos commented 1 year ago
---
format:
  pdf:
    pdf-engine: lualatex
    papersize: a4
---

# Abstract {#sec-scriv150}

```{dot}
digraph finite_state_machine {
    Fontname="Avenir,Helvetica,sans-serif"
    node [fontname="Avenir,Helvetica,sans-serif"]
    edge [fontname="Avenir,Helvetica,sans-serif"]
    rankdir=LR;
    node [shape = doublecircle]; 0 3 4 8;
    node [shape = circle];
    0 -> 2 [label = "SS(B)"];
    0 -> 1 [label = "SS(S)"];
    1 -> 3 [label = "S($end)"];
    2 -> 6 [label = "SS(b)"];
    2 -> 5 [label = "SS(a)"];
    2 -> 4 [label = "S(A)"];
    5 -> 7 [label = "S(b)"];
    5 -> 5 [label = "S(a)"];
    6 -> 6 [label = "S(b)"];
    6 -> 5 [label = "S(a)"];
    7 -> 8 [label = "S(b)"];
    7 -> 5 [label = "S(a)"];
    8 -> 6 [label = "S(b)"];
    8 -> 5 [label = "S(a)"];
}
(base) ➜  export-mmd git:(main) ✗ quarto render export.qmd --to pdf

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos aarch64
Version: 1.33.2
Args: ["/Applications/quarto/bin/tools/deno-aarch64-apple-darwin/deno", "run", "--unstable", "--no-config", "--allow-read", "--allow-write", "--allow-run", "--allow-env", "--allow-net", "--allow-ffi", "--no-check", "--importmap=/Applications/quarto/bin/vendor/import_map.json", "/Applications/quarto/bin/quarto.js", "render", "export.qmd", "--to", "pdf"]

thread 'main' panicked at 'Failed to add platform cert to root cert store: MissingOrMalformedExtensions', cli/args/mod.rs:495:14
stack backtrace:
   0:        0x10116600c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3c406a4521928e59
   1:        0x1008aa4c0 - core::fmt::write::hc60df9bae744c40c
   2:        0x10113b178 - std::io::Write::write_fmt::h1c4129dfc94f7c33
   3:        0x10116a760 - std::sys_common::backtrace::print::h34db077f1fa49c76
   4:        0x10116a3b4 - std::panicking::default_hook::{{closure}}::hff4fe3239c020cef
   5:        0x10116a080 - std::panicking::default_hook::hd2988fbcc86fdc46
   6:        0x10143a644 - deno::setup_panic_hook::{{closure}}::h3f9f36b0726e6206
   7:        0x10116b06c - std::panicking::rust_panic_with_hook::h01730ad11d62092c
   8:        0x10116ae64 - std::panicking::begin_panic_handler::{{closure}}::h30f454e305d4a708
   9:        0x10116add4 - std::sys_common::backtrace::__rust_end_short_backtrace::hb7ff1894d55794a1
  10:        0x10116adb0 - _rust_begin_unwind
  11:        0x1008a8618 - core::panicking::panic_fmt::hf1070b3fc33229fa
  12:        0x1008ae878 - core::result::unwrap_failed::h334387d5f1f555c1
  13:        0x101279b9c - deno::args::get_root_cert_store::hb66d79d5abb6ab27
  14:        0x101278dac - once_cell::imp::OnceCell<T>::initialize::{{closure}}::h39279fd316985982
  15:        0x101046884 - once_cell::imp::initialize_or_wait::hdb964ba2d00af943
  16:        0x101278af8 - <deno::args::CliRootCertStoreProvider as deno_tls::RootCertStoreProvider>::get_or_try_init::h92f538024b8ebcce
  17:        0x100aa5e1c - deno_fetch::Options::root_cert_store::h1de1cad617bb015d
  18:        0x100aa65c4 - deno_fetch::get_or_create_client_from_state::hf5fdb4eb201edaf7
  19:        0x100ed7734 - deno_fetch::op_fetch::v8_fn_ptr::hb2ae877a32903d12

On macOS 13.3.1 (a)

cderv commented 1 year ago

We believe this could be link to deno version bundled in Quarto (1.33.2) and that Deno 1.33.4 and above does not have this issue.

For the context, issue we found is set setting DENO_TLS_CA_STORE to system caused a panic issue with deno

$env:DENO_TLS_CA_STORE="system,mozilla"
deno run --allow-net fetch.ts

with fetch.ts being

const url="https://github.com/quarto-ext/fancy-text/archive/refs/heads/main.zip"
const fileResponse = await fetch(url)

@bcdavasconcelos please do what out for https://github.com/quarto-dev/quarto-cli/pull/6303 as once merged and a new pre-release build is done it could solve your issue.