profile
viewpoint

denoland/deno 71602

A secure JavaScript and TypeScript runtime

ry/deno 399

ry/deno_typescript 32

To generate snapshots of TypeScript files during build.rs

ry/awesome-deno 16

🎉A curated list of awesome things related to Deno

ry/eecs151 12

http://inst.eecs.berkeley.edu/~eecs151/fa19/

ry/go 10

The Go programming language

ry/parcel 10

📦🚀 Blazing fast, zero configuration web application bundler

ry/aws-appsync-chat 9

Real-Time Offline Ready Chat App written with GraphQL, AWS AppSync, & AWS Amplify

issue commentdenoland/deno

Building for arm64

Thanks @Dygear for the extra confirmation and detailed information. I am also using an 8gb Pi 4 but my knowledge of the toolchain is not nearly as detailed as yours. I cloned the repo like you did and also set V8_FROM_SOURCE but it did not take a while to build, the build process was exactly the same and the failure was the same for me. This got me thinking that there must be some other steps that people just implicitly know to do that was not conveyed above but I don't know.

afinch7

comment created time in an hour

push eventdenoland/deno

Nayeem Rahman

commit sha 1518fabfbba3cb951357f7c7977d6346943a9a8f

fix(std/async): make pooledMap() errors catchable (#9217)

view details

push time in 2 hours

PR merged denoland/deno

fix(std/async): Make pooledMap() errors catchable

Fixes #9070.

cc @lucacasonato

+62 -16

0 comment

2 changed files

nayeemrmn

pr closed time in 2 hours

issue closeddenoland/deno

std/async: Uncaught exception in pooledMap

When an exception occurs in an async callback in pooledMap, the exception is caught by surrounding try/catch but it also bubbles into an uncaught Promise Exception and crashes the process.

Example stack trace:

2021-01-05T09:57:47.331+01:00	error: Uncaught (in promise) Http: error sending request for url (https://REDACTED.s3.us-east-1.amazonaws.com/aws_sdk/versions/v3.0.0.1/raw/client-codebuild/pagination/ListBuildBatchesForProjectPaginator.ts): connection closed before message completed
2021-01-05T09:57:47.331+01:00	at processResponse (deno:core/core.js:223:11)
2021-01-05T09:57:47.331+01:00	at Object.jsonOpAsync (deno:core/core.js:240:12)
2021-01-05T09:57:47.331+01:00	at async fetch (deno:op_crates/fetch/26_fetch.js:1278:29)
2021-01-05T09:57:47.331+01:00	at async S3Bucket.putObject (<https://deno.land/x/s3@0.2.0/src/bucket.ts>:352:1)
2021-01-05T09:57:47.331+01:00	at async uploadVersionRaw (<file:///var/task/utils/storage.ts>:82:1)
2021-01-05T09:57:47.331+01:00	at async <file:///var/task/api/async/publish.ts>:170:1

I also made a simple gist to reproduce the issue: https://gist.github.com/wperron/1066ad43a77a3cd7aeb3bdecfa44d9d1

cc @lucacasonato

closed time in 2 hours

wperron

issue openeddenoland/deno

Fetch/TypeError with an instant client-side redirect

I'll try to do a simple fetch const response = await fetch("https://energiaseuranta.caruna.fi/mobile/") and I will get a type error

deno run --allow-net caruna.ts

error: Uncaught (in promise) TypeError: error sending request for url (https://energiaseuranta.caruna.fi/): error trying to connect: Connection reset by peer (os error 104) throw new ErrorClass(res.err.message); ^ at processResponse (deno:core/core.js:212:11) at Object.jsonOpAsync (deno:core/core.js:229:12) at async sendFetchReq (deno:op_crates/fetch/26_fetch.js:1233:12) at async fetch (deno:op_crates/fetch/26_fetch.js:1315:29)

The web page uses an instant client-side redirect <meta http-equiv="refresh" content="0;URL=

I don't know how to handle this.

created time in 2 hours

pull request commentdenoland/deno

[WIP] Web Notification API

I agree with @crowlKats - we should not use the deprecated API. The solution would be to implement a crate for the current API.

littledivy

comment created time in 3 hours

Pull request review commentdenoland/deno

fix(std/async): Make pooledMap() errors catchable

 export function pooledMap<T, R>(   (async (): Promise<void> => {     const writer = res.writable.getWriter();     const executing: Array<Promise<unknown>> = [];-    for await (const item of array) {-      const p = Promise.resolve().then(() => iteratorFn(item));-      writer.write(p);-      const e: Promise<unknown> = p.then(() =>-        executing.splice(executing.indexOf(e), 1)-      );-      executing.push(e);-      if (executing.length >= poolLimit) {-        await Promise.race(executing);+    try {+      for await (const item of array) {+        const p = Promise.resolve().then(() => iteratorFn(item));+        // Only write on success. If we `writer.write()` a rejected promise,+        // that will end the iteration. We don't want that yet. Instead let it+        // fail the race, taking us to the catch block where all currently+        // executing jobs are allowed to finish and all rejections among them+        // can be reported together.+        p.then((v) => writer.write(Promise.resolve(v))).catch(() => {});+        const e: Promise<unknown> = p.then(() =>+          executing.splice(executing.indexOf(e), 1)+        );+        executing.push(e);+        if (executing.length >= poolLimit) {+          await Promise.race(executing);+        }+      }+      // Wait until all ongoing events have processed, then close the writer.+      await Promise.all(executing);+      writer.close();+    } catch {+      const errors = [];+      for (const result of await Promise.allSettled(executing)) {+        if (result.status == "rejected") {+          errors.push(result.reason);+        }       }+      const p = Promise.reject(+        new AggregateError(errors, "Threw while mapping."),+      );+      p.catch(() => {});

You're right, writer.write()'s implementation properly inherits the rejection handling so it wouldn't be needed. I think I tested it before I added the handler below.

nayeemrmn

comment created time in 3 hours

Pull request review commentdenoland/deno

fix(std/async): Make pooledMap() errors catchable

 export function pooledMap<T, R>(   (async (): Promise<void> => {     const writer = res.writable.getWriter();     const executing: Array<Promise<unknown>> = [];-    for await (const item of array) {-      const p = Promise.resolve().then(() => iteratorFn(item));-      writer.write(p);-      const e: Promise<unknown> = p.then(() =>-        executing.splice(executing.indexOf(e), 1)-      );-      executing.push(e);-      if (executing.length >= poolLimit) {-        await Promise.race(executing);+    try {+      for await (const item of array) {+        const p = Promise.resolve().then(() => iteratorFn(item));+        // Only write on success. If we `writer.write()` a rejected promise,+        // that will end the iteration. We don't want that yet. Instead let it+        // fail the race, taking us to the catch block where all currently+        // executing jobs are allowed to finish and all rejections among them+        // can be reported together.+        p.then((v) => writer.write(Promise.resolve(v))).catch(() => {});+        const e: Promise<unknown> = p.then(() =>+          executing.splice(executing.indexOf(e), 1)+        );+        executing.push(e);+        if (executing.length >= poolLimit) {+          await Promise.race(executing);+        }+      }+      // Wait until all ongoing events have processed, then close the writer.+      await Promise.all(executing);+      writer.close();+    } catch {+      const errors = [];+      for (const result of await Promise.allSettled(executing)) {+        if (result.status == "rejected") {+          errors.push(result.reason);+        }       }+      const p = Promise.reject(+        new AggregateError(errors, "Threw while mapping."),+      );+      p.catch(() => {});

I commented out this line and tried the script below:

import { pooledMap } from "./std/async/pool.ts";
let iter = pooledMap(4, [...Array(100)], () => {
  throw new Error();
});
try {
  for await (const _ of iter) {}
} catch (e) {
  console.log(e.errors);
}
console.log("finish");

and this script seems finishing without unhandled rejection error. Does this mean the error can be handled by the user?

On the other hand, I confirmed that the empty handler at the next line is necessary to avoid unhandled rejection error.

nayeemrmn

comment created time in 3 hours

push eventdenoland/deno

Kitson Kelly

commit sha 1a9209d1e3ed297c96a698550ab833c54c02a4ee

fix(lsp): handle mbc documents properly (#9151) Co-authored-by: Ryan Dahl <ry@tinyclouds.org>

view details

push time in 3 hours

PR merged denoland/deno

fix(lsp): handle mbc documents properly

Resolves #9018

This PR refactors the way in memory documents are handled and changed, specifically properly handling the way vscode and tsc handle text positions in documents which now properly handles unicode characters which have > 2 bytes for encoding. It also consolidates the way that TypeScript diagnostics are collected. There are other minor improvements and changes as well.

+1478 -849

10 comments

18 changed files

kitsonk

pr closed time in 3 hours

issue closeddenoland/deno

lsp: restructure source management

We currently have 3 abstractions to handle sources in the lsp... doc_data, file_cache and sources. The first two abstractions were adopted from rust_analyzer and they make sense in the context of rust_analyzer but they don't make sense in the way we need to manage sources for the lsp. In addition we had to add sources to manage on disk cache sources and other dependencies for Deno programmes.

In addition, we don't support properly the edits of the files coming from a client in certain situations (see: #8753) and the likely best way to handle that is to store the in-memory documents in an swc SourceMap.

This issue is to track the refactoring of all of this into a single abstraction that properly supports edits to documents containing MBC.

closed time in 3 hours

kitsonk

Pull request review commentdenoland/deno

fix(std/async): Make pooledMap() errors catchable

 export function pooledMap<T, R>(   (async (): Promise<void> => {     const writer = res.writable.getWriter();     const executing: Array<Promise<unknown>> = [];-    for await (const item of array) {-      const p = Promise.resolve().then(() => iteratorFn(item));-      writer.write(p);-      const e: Promise<unknown> = p.then(() =>-        executing.splice(executing.indexOf(e), 1)-      );-      executing.push(e);-      if (executing.length >= poolLimit) {-        await Promise.race(executing);+    try {+      for await (const item of array) {+        const p = Promise.resolve().then(() => iteratorFn(item));+        // Only write on success. If we `writer.write()` a rejected promise,+        // that will end the iteration. We don't want that yet. Instead let it+        // fail the race, taking us to the catch block where all currently+        // executing jobs are allowed to finish and all rejections among them+        // can be reported together.+        p.then((v) => writer.write(Promise.resolve(v))).catch(() => {});+        const e: Promise<unknown> = p.then(() =>+          executing.splice(executing.indexOf(e), 1)+        );+        executing.push(e);+        if (executing.length >= poolLimit) {+          await Promise.race(executing);+        }+      }+      // Wait until all ongoing events have processed, then close the writer.+      await Promise.all(executing);+      writer.close();+    } catch {+      const errors = [];+      for (const result of await Promise.allSettled(executing)) {+        if (result.status == "rejected") {+          errors.push(result.reason);+        }       }+      const p = Promise.reject(+        new AggregateError(errors, "Threw while mapping."),+      );+      p.catch(() => {});

When we writer.write() this rejected promise, it causes the iterator to throw it to the user. An empty catch handler because it is treated like an unhandled rejection otherwise.

nayeemrmn

comment created time in 4 hours

pull request commentdenoland/deno

fix: --location flag panic on unsupported protocol

@nayeemrmn sorry, I missed it 🙏

satyarohith

comment created time in 4 hours

PR closed denoland/deno

fix: --location flag panic on unsupported protocol

<!-- Before submitting a PR, please read https://github.com/denoland/deno/blob/master/docs/contributing.md

  1. Give the PR a descriptive title.

Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports

Examples of bad title: - fix #7123 - update docs - fix bugs

  1. Ensure there is a related issue and it is referenced in the PR text.
  2. Ensure there are tests that cover the changes.
  3. Ensure cargo test passes.
  4. Ensure ./tools/format.js passes without changing files.
  5. Ensure ./tools/lint.js passes. -->

The --location flag panics on an unsupported protocol, this PR fixes that.

Before:

➜ deno run --location file:///Users/sr/test.ts test.ts
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', cli/flags.rs:1478:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

After:

➜ ./target/debug/deno run --location file:///Users/sr/test.ts test.ts    
error: Invalid value for '--location <HREF>': Expected protocol "http" or "https"
+9 -3

2 comments

2 changed files

satyarohith

pr closed time in 4 hours

pull request commentdenoland/deno

fix: --location flag panic on unsupported protocol

Oops! I'm closing it in favor of #9202.

satyarohith

comment created time in 4 hours

Pull request review commentdenoland/deno

fix(std/async): Make pooledMap() errors catchable

 export function pooledMap<T, R>(   (async (): Promise<void> => {     const writer = res.writable.getWriter();     const executing: Array<Promise<unknown>> = [];-    for await (const item of array) {-      const p = Promise.resolve().then(() => iteratorFn(item));-      writer.write(p);-      const e: Promise<unknown> = p.then(() =>-        executing.splice(executing.indexOf(e), 1)-      );-      executing.push(e);-      if (executing.length >= poolLimit) {-        await Promise.race(executing);+    try {+      for await (const item of array) {+        const p = Promise.resolve().then(() => iteratorFn(item));+        // Only write on success. If we `writer.write()` a rejected promise,+        // that will end the iteration. We don't want that yet. Instead let it+        // fail the race, taking us to the catch block where all currently+        // executing jobs are allowed to finish and all rejections among them+        // can be reported together.+        p.then((v) => writer.write(Promise.resolve(v))).catch(() => {});+        const e: Promise<unknown> = p.then(() =>+          executing.splice(executing.indexOf(e), 1)+        );+        executing.push(e);+        if (executing.length >= poolLimit) {+          await Promise.race(executing);+        }+      }+      // Wait until all ongoing events have processed, then close the writer.+      await Promise.all(executing);+      writer.close();

It closes on error, so writer.close() will throw if done in the catch branch.

nayeemrmn

comment created time in 4 hours

pull request commentdenoland/deno

fix: --location flag panic on unsupported protocol

Duplicate of #9202.

satyarohith

comment created time in 4 hours

push eventdenoland/deno_website2

Yoshiya Hinosawa

commit sha 146d069871e0165eefa594feb349a9ca2e244d19

feat: add news in header and menu (#1651)

view details

push time in 4 hours

delete branch denoland/deno_website2

delete branch : feat/add-news-header

delete time in 4 hours

PR merged denoland/deno_website2

Add news in header and menu

The news link is now only in the footer, and it feels so hidden. This PR adds the links to news in the header and the global menu.

+10 -0

0 comment

1 changed file

kt3k

pr closed time in 4 hours

PR opened denoland/vscode_deno

0.0.7
+1 -1

0 comment

1 changed file

pr created time in 5 hours

create barnchdenoland/vscode_deno

branch : 0.0.7

created branch time in 5 hours

push eventdenoland/vscode_deno

Luca Casonato

commit sha 2a581759e2e41215b25a99bb00ed13e4ede4a523

feat: change textDocument/rename to use LSP (#292)

view details

push time in 5 hours

PR merged denoland/vscode_deno

chore: disable built in rename

Ref https://github.com/denoland/deno/pull/8910

+22 -0

0 comment

1 changed file

lucacasonato

pr closed time in 5 hours

Pull request review commentdenoland/deno

fix(compile): panic when cross-compiling between windows and unix

 async fn download_package( pub fn unpack(   archive_data: Vec<u8>,   exe_name: &str,+  windows: bool,

Rename to is_windows.

Liamolucko

comment created time in 5 hours

push eventRTimothyEdwards/magic

Tim Edwards

commit sha 3c42c5a7f397294aa429f0fe24c338622d002f11

Corrected the extraction method for devices with terminals on the implicit global substrate, as a block of code meant to handle this case was left unreachable by another recent code fix.

view details

Tim Edwards

commit sha 171287a13118b6ea6fb522b40dda6168a6812258

Corrected the "extract unique" method so that ports which are made unique will also be assigned a unique port index at the end of the port list. That ensures that the unique names are all properly found in the extracted .subckt for the cell.

view details

push time in 5 hours

push eventRTimothyEdwards/magic

Tim Edwards

commit sha 3c42c5a7f397294aa429f0fe24c338622d002f11

Corrected the extraction method for devices with terminals on the implicit global substrate, as a block of code meant to handle this case was left unreachable by another recent code fix.

view details

Tim Edwards

commit sha 171287a13118b6ea6fb522b40dda6168a6812258

Corrected the "extract unique" method so that ports which are made unique will also be assigned a unique port index at the end of the port list. That ensures that the unique names are all properly found in the extracted .subckt for the cell.

view details

push time in 5 hours

created tagRTimothyEdwards/magic

tag8.3.120

Magic VLSI Layout Tool

created time in 5 hours

issue commentdenoland/deno

Building for arm64

@LukeChannings @frankhale I'm using a Raspberry Pi 4 (8GB). After doing a git pull and cargo clean, interesting -- I'm having the same issue. Something has changed, I just don't know what. I checked out the 1.6.3 tag (git checkout tag/1.6.3), and rebuilt it. That worked fine. So ... Huh. /target/release/gn_out/obj/librusty_v8.a is missing, but only when checking out the 1.7.0 build of deno. After that successful build, I moved back to master and ran cargo build -vvvv again. I didn't clean the build tree at all, just let it run as before. I get this ...

   Compiling deno v1.7.0 (/home/pi/deno/cli)
     Running `CARGO=/home/pi/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/bin/cargo CARGO_CRATE_NAME=build_script_build CARGO_MANIFEST_DIR=/home/pi/deno/cli CARGO_PKG_AUTHORS='the Deno authors' CARGO_PKG_DESCRIPTION='Provides the deno executable' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MIT CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=deno CARGO_PKG_REPOSITORY='https://github.com/denoland/deno' CARGO_PKG_VERSION=1.7.0 CARGO_PKG_VERSION_MAJOR=1 CARGO_PKG_VERSION_MINOR=7 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/home/pi/deno/target/debug/deps:/home/pi/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib:/home/pi/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib' rustc --crate-name build_script_build --edition=2018 cli/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=2c312aa0fc278040 -C extra-filename=-2c312aa0fc278040 --out-dir /home/pi/deno/target/debug/build/deno-2c312aa0fc278040 -C incremental=/home/pi/deno/target/debug/incremental -L dependency=/home/pi/deno/target/debug/deps --extern deno_core=/home/pi/deno/target/debug/deps/libdeno_core-5876bc3f001c0642.rlib --extern deno_fetch=/home/pi/deno/target/debug/deps/libdeno_fetch-5ee2c3da97fadb56.rlib --extern deno_web=/home/pi/deno/target/debug/deps/libdeno_web-dbe712886b8d3ff1.rlib --extern deno_websocket=/home/pi/deno/target/debug/deps/libdeno_websocket-506e36a3b620244c.rlib --extern regex=/home/pi/deno/target/debug/deps/libregex-71aa19e4b49148ed.rlib --extern serde=/home/pi/deno/target/debug/deps/libserde-2e6e5d81f6e8f076.rlib -L /home/pi/deno/target/debug/gn_out/obj -L native=/home/pi/deno/target/debug/build/ring-cdee82299e607e55/out`
     Running `/home/pi/deno/target/debug/build/deno_runtime-34d455a0ce716031/build-script-build`
[deno_runtime 0.7.0] cargo:rustc-env=TARGET=aarch64-unknown-linux-gnu
[deno_runtime 0.7.0] cargo:rustc-env=PROFILE=debug
error: failed to run custom build command for `deno_runtime v0.7.0 (/home/pi/deno/runtime)`

Caused by:
  process didn't exit successfully: `/home/pi/deno/target/debug/build/deno_runtime-34d455a0ce716031/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
  --- stdout
  cargo:rustc-env=TARGET=aarch64-unknown-linux-gnu
  cargo:rustc-env=PROFILE=debug
warning: build failed, waiting for other jobs to finish...

Try it again ...

       Fresh deno_fetch v0.20.0 (/home/pi/deno/op_crates/fetch)
   Compiling deno_runtime v0.7.0 (/home/pi/deno/runtime)
     Running `/home/pi/deno/target/debug/build/deno_runtime-34d455a0ce716031/build-script-build`
[deno_runtime 0.7.0] cargo:rustc-env=TARGET=aarch64-unknown-linux-gnu
[deno_runtime 0.7.0] cargo:rustc-env=PROFILE=debug
[deno_runtime 0.7.0] thread 'main' panicked at 'assertion failed: `(left == right)`
[deno_runtime 0.7.0]   left: `Some(0x558d0de540)`,
[deno_runtime 0.7.0]  right: `Some(0x558d10e3a0)`', /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.16.0/src/scope.rs:1261:7
[deno_runtime 0.7.0] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[deno_runtime 0.7.0] thread 'main' panicked at 'assertion failed: `(left == right)`
[deno_runtime 0.7.0]   left: `Some(0x558d0de540)`,
[deno_runtime 0.7.0]  right: `Some(0x558d10e3a0)`', /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.16.0/src/scope.rs:1261:7
[deno_runtime 0.7.0] stack backtrace:
[deno_runtime 0.7.0]    0:       0x5559a438ac - std::backtrace_rs::backtrace::libunwind::trace::h0bf177acf051491e
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
[deno_runtime 0.7.0]    1:       0x5559a438ac - std::backtrace_rs::backtrace::trace_unsynchronized::h13e350691a2e9c8c
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/../../backtrace/src/backtrace/mod.rs:66
[deno_runtime 0.7.0]    2:       0x5559a438ac - std::sys_common::backtrace::_print_fmt::h01973b8b9262a455
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:79
[deno_runtime 0.7.0]    3:       0x5559a438ac - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha9097f32cb02a890
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:58
[deno_runtime 0.7.0]    4:       0x5559a59fcc - core::fmt::write::h09ec856f07455be4
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/fmt/mod.rs:1082
[deno_runtime 0.7.0]    5:       0x5559a41188 - std::io::Write::write_fmt::h28ee10a061406531
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/io/mod.rs:1514
[deno_runtime 0.7.0]    6:       0x5559a4584c - std::sys_common::backtrace::_print::hb27fc1a755c045cd
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:61
[deno_runtime 0.7.0]    7:       0x5559a4584c - std::sys_common::backtrace::print::h93f2dd83b4ec9f44
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:48
[deno_runtime 0.7.0]    8:       0x5559a4584c - std::panicking::default_hook::{{closure}}::h7fef7b2214a9650e
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:200
[deno_runtime 0.7.0]    9:       0x5559a45584 - std::panicking::default_hook::hd4f1663a72ba25b8
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:219
[deno_runtime 0.7.0]   10:       0x5559a45ef4 - std::panicking::rust_panic_with_hook::h3365a52210317c21
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:569
[deno_runtime 0.7.0]   11:       0x5559a45adc - std::panicking::begin_panic_handler::{{closure}}::h767810307287d8f2
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:476
[deno_runtime 0.7.0]   12:       0x5559a43d34 - std::sys_common::backtrace::__rust_end_short_backtrace::he4cf53edc973a6a9
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:153
[deno_runtime 0.7.0]   13:       0x5559a45aa4 - rust_begin_unwind
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:475
[deno_runtime 0.7.0]   14:       0x5559a45a60 - std::panicking::begin_panic_fmt::he8daa79f0eeee0d2
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:429
[deno_runtime 0.7.0]   15:       0x55584790e4 - rusty_v8::scope::data::ScopeData::try_activate_scope::h389194cb044c04ba
[deno_runtime 0.7.0]                                at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.16.0/src/scope.rs:1261
[deno_runtime 0.7.0]   16:       0x55584790e4 - rusty_v8::scope::data::ScopeData::get_mut::h75398f215fc2770f
[deno_runtime 0.7.0]                                at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.16.0/src/scope.rs:1248
[deno_runtime 0.7.0]   17:       0x555846c668 - <rusty_v8::scope::HandleScope<C> as core::ops::drop::Drop>::drop::h76c8dc9b5e1f1ed1
[deno_runtime 0.7.0]                                at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.16.0/src/scope.rs:636
[deno_runtime 0.7.0]   18:       0x5558467528 - core::ptr::drop_in_place::h5019043c4c0a3232
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/ptr/mod.rs:184
[deno_runtime 0.7.0]   19:       0x555842d78c - deno_core::runtime::JsRuntime::execute::h4bdf2102c1079225
[deno_runtime 0.7.0]                                at /home/pi/deno/core/runtime.rs:408
[deno_runtime 0.7.0]   20:       0x555842d62c - deno_core::runtime::JsRuntime::js_init::hb582601e0480991b
[deno_runtime 0.7.0]                                at /home/pi/deno/core/runtime.rs:340
[deno_runtime 0.7.0]   21:       0x555842ce7c - deno_core::runtime::JsRuntime::new::h2980e23a6f189701
[deno_runtime 0.7.0]                                at /home/pi/deno/core/runtime.rs:299
[deno_runtime 0.7.0]   22:       0x55583fe2c0 - build_script_build::create_runtime_snapshot::h8cb419e74d83d218
[deno_runtime 0.7.0]                                at /home/pi/deno/runtime/build.rs:43
[deno_runtime 0.7.0]   23:       0x55583fe6a0 - build_script_build::main::hba0a43c2be0e59f3
[deno_runtime 0.7.0]                                at /home/pi/deno/runtime/build.rs:67
[deno_runtime 0.7.0]   24:       0x5558401820 - core::ops::function::FnOnce::call_once::h0e4c609c7889b79a
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/ops/function.rs:227
[deno_runtime 0.7.0]   25:       0x55583ffd60 - std::sys_common::backtrace::__rust_begin_short_backtrace::h319d4e8ef7130d19
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:137
[deno_runtime 0.7.0]   26:       0x55584029a4 - std::rt::lang_start::{{closure}}::h1ae6dcd9d3c3f2d1
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/rt.rs:66
[deno_runtime 0.7.0]   27:       0x5559a461e0 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h374c3e02094e44c2
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/ops/function.rs:259
[deno_runtime 0.7.0]   28:       0x5559a461e0 - std::panicking::try::do_call::ha3ec3588007a4da2
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:373
[deno_runtime 0.7.0]   29:       0x5559a461e0 - std::panicking::try::h7d1b1365534463ec
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:337
[deno_runtime 0.7.0]   30:       0x5559a461e0 - std::panic::catch_unwind::he04a9b0c3dd8e3c1
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panic.rs:379
[deno_runtime 0.7.0]   31:       0x5559a461e0 - std::rt::lang_start_internal::h18550bd0c37e45d2
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/rt.rs:51
[deno_runtime 0.7.0]   32:       0x555840297c - std::rt::lang_start::h86cde3ab80c17d20
[deno_runtime 0.7.0]                                at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/rt.rs:65
[deno_runtime 0.7.0]   33:       0x55583fe870 - main
[deno_runtime 0.7.0]   34:       0x7f9032bd24 - __libc_start_main
[deno_runtime 0.7.0]   35:       0x55583fd99c - <unknown>
[deno_runtime 0.7.0] thread panicked while panicking. aborting.
error: failed to run custom build command for `deno_runtime v0.7.0 (/home/pi/deno/runtime)`

Caused by:
  process didn't exit successfully: `/home/pi/deno/target/debug/build/deno_runtime-34d455a0ce716031/build-script-build` (signal: 5, SIGTRAP: trace/breakpoint trap)
  --- stdout
  cargo:rustc-env=TARGET=aarch64-unknown-linux-gnu
  cargo:rustc-env=PROFILE=debug

  --- stderr
  thread 'main' panicked at 'assertion failed: `(left == right)`
    left: `Some(0x558d0de540)`,
   right: `Some(0x558d10e3a0)`', /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.16.0/src/scope.rs:1261:7
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  thread 'main' panicked at 'assertion failed: `(left == right)`
    left: `Some(0x558d0de540)`,
   right: `Some(0x558d10e3a0)`', /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.16.0/src/scope.rs:1261:7
  stack backtrace:
     0:       0x5559a438ac - std::backtrace_rs::backtrace::libunwind::trace::h0bf177acf051491e
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
     1:       0x5559a438ac - std::backtrace_rs::backtrace::trace_unsynchronized::h13e350691a2e9c8c
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/../../backtrace/src/backtrace/mod.rs:66
     2:       0x5559a438ac - std::sys_common::backtrace::_print_fmt::h01973b8b9262a455
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:79
     3:       0x5559a438ac - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha9097f32cb02a890
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:58
     4:       0x5559a59fcc - core::fmt::write::h09ec856f07455be4
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/fmt/mod.rs:1082
     5:       0x5559a41188 - std::io::Write::write_fmt::h28ee10a061406531
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/io/mod.rs:1514
     6:       0x5559a4584c - std::sys_common::backtrace::_print::hb27fc1a755c045cd
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:61
     7:       0x5559a4584c - std::sys_common::backtrace::print::h93f2dd83b4ec9f44
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:48
     8:       0x5559a4584c - std::panicking::default_hook::{{closure}}::h7fef7b2214a9650e
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:200
     9:       0x5559a45584 - std::panicking::default_hook::hd4f1663a72ba25b8
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:219
    10:       0x5559a45ef4 - std::panicking::rust_panic_with_hook::h3365a52210317c21
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:569
    11:       0x5559a45adc - std::panicking::begin_panic_handler::{{closure}}::h767810307287d8f2
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:476
    12:       0x5559a43d34 - std::sys_common::backtrace::__rust_end_short_backtrace::he4cf53edc973a6a9
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:153
    13:       0x5559a45aa4 - rust_begin_unwind
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:475
    14:       0x5559a45a60 - std::panicking::begin_panic_fmt::he8daa79f0eeee0d2
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:429
    15:       0x55584790e4 - rusty_v8::scope::data::ScopeData::try_activate_scope::h389194cb044c04ba
                                 at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.16.0/src/scope.rs:1261
    16:       0x55584790e4 - rusty_v8::scope::data::ScopeData::get_mut::h75398f215fc2770f
                                 at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.16.0/src/scope.rs:1248
    17:       0x555846c668 - <rusty_v8::scope::HandleScope<C> as core::ops::drop::Drop>::drop::h76c8dc9b5e1f1ed1
                                 at /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.16.0/src/scope.rs:636
    18:       0x5558467528 - core::ptr::drop_in_place::h5019043c4c0a3232
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/ptr/mod.rs:184
    19:       0x555842d78c - deno_core::runtime::JsRuntime::execute::h4bdf2102c1079225
                                 at /home/pi/deno/core/runtime.rs:408
    20:       0x555842d62c - deno_core::runtime::JsRuntime::js_init::hb582601e0480991b
                                 at /home/pi/deno/core/runtime.rs:340
    21:       0x555842ce7c - deno_core::runtime::JsRuntime::new::h2980e23a6f189701
                                 at /home/pi/deno/core/runtime.rs:299
    22:       0x55583fe2c0 - build_script_build::create_runtime_snapshot::h8cb419e74d83d218
                                 at /home/pi/deno/runtime/build.rs:43
    23:       0x55583fe6a0 - build_script_build::main::hba0a43c2be0e59f3
                                 at /home/pi/deno/runtime/build.rs:67
    24:       0x5558401820 - core::ops::function::FnOnce::call_once::h0e4c609c7889b79a
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/ops/function.rs:227
    25:       0x55583ffd60 - std::sys_common::backtrace::__rust_begin_short_backtrace::h319d4e8ef7130d19
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:137
    26:       0x55584029a4 - std::rt::lang_start::{{closure}}::h1ae6dcd9d3c3f2d1
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/rt.rs:66
    27:       0x5559a461e0 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h374c3e02094e44c2
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/ops/function.rs:259
    28:       0x5559a461e0 - std::panicking::try::do_call::ha3ec3588007a4da2
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:373
    29:       0x5559a461e0 - std::panicking::try::h7d1b1365534463ec
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:337
    30:       0x5559a461e0 - std::panic::catch_unwind::he04a9b0c3dd8e3c1
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panic.rs:379
    31:       0x5559a461e0 - std::rt::lang_start_internal::h18550bd0c37e45d2
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/rt.rs:51
    32:       0x555840297c - std::rt::lang_start::h86cde3ab80c17d20
                                 at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/rt.rs:65
    33:       0x55583fe870 - main
    34:       0x7f9032bd24 - __libc_start_main
    35:       0x55583fd99c - <unknown>
  thread panicked while panicking. aborting.
warning: build failed, waiting for other jobs to finish...
error: build failed

As I don't know what is going on anymore I went back to the start. git clone --recurse-submodules https://github.com/denoland/deno.git ~/deno_v8 As I don't want to overwrite my actual ~/deno directory, so I put this in ~/deno_v8 to take @LukeChannings' advise and build with V8. cd ~/deno_v8 once it's all checked out. And run V8_FROM_SOURCE=1 cargo build -vv. Luke said this is going to take a long time, so I'm going to sleep. I'll check back once I wake up. But it seems that the problem is there for sure.

afinch7

comment created time in 5 hours

Pull request review commentdenoland/deno

fix(std/async): Make pooledMap() errors catchable

 export function pooledMap<T, R>(   (async (): Promise<void> => {     const writer = res.writable.getWriter();     const executing: Array<Promise<unknown>> = [];-    for await (const item of array) {-      const p = Promise.resolve().then(() => iteratorFn(item));-      writer.write(p);-      const e: Promise<unknown> = p.then(() =>-        executing.splice(executing.indexOf(e), 1)-      );-      executing.push(e);-      if (executing.length >= poolLimit) {-        await Promise.race(executing);+    try {+      for await (const item of array) {+        const p = Promise.resolve().then(() => iteratorFn(item));+        // Only write on success. If we `writer.write()` a rejected promise,+        // that will end the iteration. We don't want that yet. Instead let it+        // fail the race, taking us to the catch block where all currently+        // executing jobs are allowed to finish and all rejections among them+        // can be reported together.+        p.then((v) => writer.write(Promise.resolve(v))).catch(() => {});+        const e: Promise<unknown> = p.then(() =>+          executing.splice(executing.indexOf(e), 1)+        );+        executing.push(e);+        if (executing.length >= poolLimit) {+          await Promise.race(executing);+        }+      }+      // Wait until all ongoing events have processed, then close the writer.+      await Promise.all(executing);+      writer.close();+    } catch {+      const errors = [];+      for (const result of await Promise.allSettled(executing)) {+        if (result.status == "rejected") {+          errors.push(result.reason);+        }       }+      const p = Promise.reject(+        new AggregateError(errors, "Threw while mapping."),+      );+      p.catch(() => {});

I think we shouldn't attach catch handler here because this error can be handled by the user of pooledMap.

nayeemrmn

comment created time in 6 hours

more