Commit graph

655 commits

Author SHA1 Message Date
snek
4ddd342d8f
refactor(unstable): improved arg handling and metadata (#30772)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-09-19 16:36:47 +02:00
Leo Kettmeir
71909e7608
fix(tunnel): make auth more robust (#30731) 2025-09-17 14:23:35 +02:00
Leo Kettmeir
e02e4c2042
feat: permission audit log (#30575)
Adds a `DENO_PERMISSIONS_AUDIT` env var to set the path for a JSONL
permission audit log, with contains the permission and value.
Additionally this can be combined with `DENO_TRACE_PERMISSIONS`, which
will then include the traces in the audit log too.
2025-09-08 14:23:11 +02:00
Meet Dhanani
8424cd4a32
feat(cli): reload environment variables with --watch and --env-file (#30197) 2025-09-04 09:32:30 -04:00
Edilson Pateguana
2607bc7eb6
fix(cli/run): resolve conflict when dir has same name as a task (#29538)
Some checks are pending
ci / publish canary (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
2025-09-03 23:14:49 +00:00
Bartek Iwańczuk
4dfd44faab
feat: deno run with no arguments prints list of available tasks (#30592)
Closes https://github.com/denoland/deno/issues/29552

---------

Signed-off-by: David Sherret <dsherret@users.noreply.github.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2025-09-03 15:44:22 +00:00
David Sherret
17d02c228f
feat: permissions in the config file (#30330)
Co-authored-by: nathanwhit <nathanwhit@users.noreply.github.com>
2025-09-02 13:37:33 +00:00
David Sherret
82f6b4714a
fix: add another space after warning symbol (#30482)
The warning symbol was overlapping the text in my terminal.
2025-08-26 08:19:51 -07:00
snek
b7e89f85c3
fix(unstable): support unstable-raw-imports when prewarmed (#30530) 2025-08-26 15:45:28 +02:00
Divy
b5808041e0
feat: allow disable hostname verification in TLS (#30409)
Fixes https://github.com/denoland/deno/issues/28903
Closes https://github.com/denoland/deno/issues/26190

- Adds a new option `unsafelyDisableHostnameVerification` to
`Deno.connectTls` and `Deno.startTls` to ignore DNS name mismatch errors
from rustls server verifier.
- Disable hostname verification in Node.js TLSSocket if
`checkServerIdentity` is a no-op.

---------

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-08-23 10:37:57 +05:30
Leo Kettmeir
45d333a1c3
fix: enable keyring features and dont clear token when config is missing (#30468)
Some checks are pending
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-08-20 15:57:13 +00:00
Leo Kettmeir
9b16106d28
refactor: rename deploy env vars (#30393)
Some checks are pending
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-08-15 02:28:08 +00:00
cions
ebfd3c3d7c
fix: android build (#30360)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Fix build error on Android.

Patches from https://github.com/cions/termux-deno
2025-08-12 15:47:18 +02:00
snek
c69a8fa414
fix(unstable): update deno_tunnel for better reconnect errors (#30381) 2025-08-12 11:45:37 +02:00
林炳权
68297b5f10
chore: Rust 1.89.0 (#30364)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Related PR: https://github.com/denoland/deno/pull/30354
2025-08-09 11:11:48 +00:00
snek
3a5ba56801
fix: tunnels in processes that don't listen (#30178)
fix issue with tunneling vite, which spawns subprocesses, where the
subprocess runs a server.
2025-07-24 18:09:27 +02:00
David Sherret
7b154300b8
refactor: upgrade to deno_core 0.353.0 (#30164) 2025-07-22 10:38:38 -04:00
snek
265018784f
feat(unstable): add useful metadata to tunnel (#30161)
Some checks are pending
ci / build libs (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
send hostname and entrypoint when connecting to tunnel
2025-07-21 17:26:56 +00:00
snek
5f0a3ace4f
chore: update deno_tunnel (#30154)
tunnels now automatically reconnect and migrate. also use `shutdown` in
telemetry instead of `flush` because it times out after 5s, which is
important if the tunnel connection is hanged for some reason.
2025-07-21 10:59:30 +02:00
snek
46009f7368
chore: switch to deno_tunnel crate (#30049)
switch to `deno_tunnel` crate for shared code with deploy
2025-07-14 16:11:02 +02:00
snek
6a30592c11
fix: early init logging (#30034)
use a swappable logging impl so we can get data right from the process
start
2025-07-08 16:17:33 +00:00
Leo Kettmeir
b59576cc0f
feat(unstable): tunnelling (#30022)
Co-authored-by: snek <snek@deno.com>
2025-07-08 02:44:50 +02:00
Nathan Whitaker
9379a74e08
chore: update to edition 2024 (#29923)
Some checks are pending
ci / publish canary (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
2025-07-02 17:59:39 -07:00
David Sherret
7a1e949c47
refactor: extract DenoDir, Emitter, EmitCache and ParsedSourceCache from cli crate (#29961) 2025-07-02 08:56:02 -04:00
David Sherret
ec32c6e5ba
feat(unstable): bytes and text imports (#29855)
Some checks are pending
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-06-26 11:21:16 -04:00
Bartek Iwańczuk
a8f59c1af9
feat: add DENO_COMPAT env var (#29889)
This commit adds the `DENO_COMPAT` env var, that
when specified enables several features:
- --unstable-bare-node-builtins
- --unstable-detect-cjs
- --unstable-sloppy-imports

With Deno v2.3.x, it is a common situation where these 3 flags have to
specified
to run an existing Node.js project, causing a friction that many users
experience.

The idea is that this env var could be "set and forget" for many people,
that should
provide better DX for running Node.js projects.

It is necessary to note that using this env var _impacts performance_ -
especially startup time.
2025-06-26 12:06:24 +02:00
Bartek Iwańczuk
1192bc0040
feat: rename --unstable-node-conditions to --unstable-conditions (#29885)
The `DENO_NODE_CONDITIONS` env var was renamed to `DENO_CONDITIONS`.

Ref https://github.com/denoland/deno/pull/29628
Ref https://github.com/denoland/deno/issues/23757
2025-06-26 12:05:57 +02:00
Bartek Iwańczuk
bff09506bd
feat(unstable): add DENO_NODE_CONDITIONS env var (#29848)
Some checks are pending
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Follow up to https://github.com/denoland/deno/pull/29586 that
adds a `DENO_NODE_CONDITIONS` env var that allows to
specify conditional exports when the user can't control
CLI flags passed to the command (eg. on Deploy).
2025-06-25 07:16:11 +00:00
Divy Srivastava
d84866e933
chore: use aws_lc_rs (#28244) 2025-06-19 01:07:00 -07:00
Nathan Whitaker
9602e13d53
fix(process,node): roll our own process spawning on windows (#29609)
Fixes #16899.
Fixes https://github.com/denoland/deno/issues/23524.
Fixes https://github.com/denoland/deno/issues/23938.
Fixes https://github.com/denoland/deno/issues/27869.

Unblocks #5501.

This PR adds support for additional stdio pipes to windows, as well as
the detached option in `node:child_process`. I also ported over the
`kill` implementation for windows, which means we now can support
`kill(0)` as well as some other signals.

This means that playwright will now work on windows.

Now that we have a way to support detached processes on all platforms,
we can also easily add a `detached` option to `Deno.Command`, similar to
`child_process.spawn`.

---

The reason for moving away from `std::process::Command` is that the
standard library doesn't expose what we need to control the file
descriptor table of child processes on windows. The implementation here
is based off of parts of `std` and parts of `libuv`, and allows us to
support passing extra pipes in addition to detached processes on
windows.
2025-06-12 02:56:13 +00:00
Nathan Whitaker
7a837f9fdb
feat(bundle, unstable): bundling backed by esbuild (#29470)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
todo:
- [ ] cleanup cli, decide what flags we want to commit to
- [x] decide what to do about node addons - (you can mark them external
via `--external`)
- [x] move `esbuild_rs` to the `denoland` org
- [x] figure out the dynamic require issue
- [x] figure out how to test this
- [x] clean up / revert all the random changes
2025-06-07 21:20:10 +02:00
Leo Kettmeir
5b0da88619
feat(unstable): deploy subcommand (#29407) 2025-05-30 16:28:49 +00:00
Volker Schlecht
99264cd2f2
fix: Support virtio vsock only on systems on which it is available (#29268) (#29354)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
See https://github.com/denoland/deno/issues/29268 for the related
discussion. @devsnek @marvinhagemeister
2025-05-21 15:54:05 +02:00
Yoshiya Hinosawa
4801c0e7bb
fix(coverage): pass DENO_COVERAGE_DIR env var correctly (#29363)
Some checks are pending
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-05-19 17:30:01 +09:00
David Sherret
94683caba1
refactor: add NpmInstallerFactory and push more functionality down into deno_npm_installer (#29342)
Some checks are pending
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
2025-05-17 15:10:06 -04:00
Yusuke Tanaka
9b2b1c41f5
fix(cli): configure v8 isolate with cgroups-constrained memory limit (#29078)
This change configures V8 isolates to respect memory limits imposed by
cgroups on Linux.

It adds support for detecting both cgroups v1 and v2 memory limits,
enabling Deno to properly adapt to containerized environments with
memory constraints. When cgroups information is unavailable or not
applicable, it falls back to using the system's total memory as before.

Closes #29077

## Test

For testing, I created a ubuntu VM with 1Gi memory. Within this VM, set
up a cgroup with 512Mi memory limit, then ran the following script to
see how much heap size limit the V8 isolate had.

```js
import * as v8 from "node:v8";

console.log(v8.getHeapStatistics());
```

### Ubuntu 20.04

In this version of ubuntu, hybrid mode is enabled by default.

```
$ cat /proc/self/cgroup
12:rdma:/
11:blkio:/user.slice
10:devices:/user.slice
9:cpu,cpuacct:/user.slice
8:pids:/user.slice/user-1000.slice/session-3.scope
7:memory:/user.slice/user-1000.slice/session-3.scope
6:perf_event:/
5:freezer:/
4:net_cls,net_prio:/
3:hugetlb:/
2:cpuset:/
1:name=systemd:/user.slice/user-1000.slice/session-3.scope
0::/user.slice/user-1000.slice/session-3.scope
```

Create a new cgroup with 512Mi memory limit and run the above script in
this cgroup:

```
$ sudo cgcreate -g memory:/mygroup
$ sudo cgset -r memory.limit_in_bytes=$((512 * 1024 * 1024)) mygroup
$ sudo cgexec -g memory:mygroup ./deno run main.mjs
{
  total_heap_size: 7745536,
  total_heap_size_executable: 0,
  total_physical_size: 7090176,
  total_available_size: 266348216,
  used_heap_size: 6276752,
  heap_size_limit: 271581184,
  malloced_memory: 303200,
  peak_malloced_memory: 140456,
  does_zap_garbage: 0,
  number_of_native_contexts: 1,
  number_of_detached_contexts: 0,
  total_global_handles_size: 24576,
  used_global_handles_size: 22432,
  external_memory: 3232012
}
```

This indicates that the isolate was informed of cgroup-constrained
memory limit (512Mi) and hence got ~270M heap limit.

### Ubuntu 22.04

In this version of ubuntu, cgroup v2 is used.

```
$ cat /proc/self/cgroup
0::/user.slice/user-1000.slice/session-3.scope
```

Run the above script using `systemd-run`:

```
$ sudo systemd-run --property=MemoryMax=512M --pty bash -c '/home/ubuntu/deno run /home/ubuntu/main.mjs'
{
  total_heap_size: 7745536,
  total_heap_size_executable: 0,
  total_physical_size: 7090176,
  total_available_size: 266348184,
  used_heap_size: 6276784,
  heap_size_limit: 271581184,
  malloced_memory: 303200,
  peak_malloced_memory: 140456,
  does_zap_garbage: 0,
  number_of_native_contexts: 1,
  number_of_detached_contexts: 0,
  total_global_handles_size: 24576,
  used_global_handles_size: 22432,
  external_memory: 3232012
}
```

Again the isolate got ~270M heap limit properly.
Note that it should have had bigger heap limit if the entire system
memory, i.e. 1Gi, had been passed to V8. In fact, if we run the same
script outside the cgroup, it does display larger `heap_size_limit` like
below:

```
$ ./deno run main.mjs
{
  total_heap_size: 7745536,
  total_heap_size_executable: 0,
  total_physical_size: 7090176,
  total_available_size: 546580152,
  used_heap_size: 6276752,
  heap_size_limit: 551813120,
  malloced_memory: 303200,
  peak_malloced_memory: 140456,
  does_zap_garbage: 0,
  number_of_native_contexts: 1,
  number_of_detached_contexts: 0,
  total_global_handles_size: 24576,
  used_global_handles_size: 22432,
  external_memory: 3232012
}
```

---------

Signed-off-by: Yusuke Tanaka <wing0920@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-14 00:07:59 +09:00
David Sherret
e601df6bfb
fix: allow specifying otel config in --env-file (#29240)
Alternative to https://github.com/denoland/deno/pull/28127 that does cli
flag parsing, then env file loading, then resolves config with env vars.

This also fixes several other issues related to env vars in the
--env-file not being used for certain config.

Closes https://github.com/denoland/deno/issues/27851
Closes https://github.com/denoland/deno/issues/29171
Closes https://github.com/denoland/deno/pull/28127
Closes #29256
2025-05-11 21:09:52 -04:00
snek
842a07710f
fix: terminate control sock event with newline (#29184)
these should be newline terminated
2025-05-06 14:51:40 +00:00
snek
5c6c52d132
fix: update deno_core (#29166)
for https://github.com/denoland/deno_core/pull/1111
2025-05-05 13:58:34 -05:00
snek
f47c4ea5e7
feat(unstable): notify control sock on serving (#29173)
send an event over the control socket when deno.serve is listening.
2025-05-05 17:27:17 +00:00
snek
b6d1d5931a
feat: support unconfigured runtime in serve subcommand (#29172)
Support the unconfigured runtime when using `deno serve`.
2025-05-05 16:08:10 +00:00
snek
bc1ced8260
refactor: allow lazy main module (#28929)
implement lazy(?) mode. an unconfigured jsruntime is created if
DENO_UNSTABLE_CONTROL_SOCK is present, and later passed into deno_runtime to be
configured and used.
2025-04-30 19:59:20 +00:00
Nathan Whitaker
6d0035411b
feat(clean): deno clean --except <paths>, remove all cache data except what's needed to run paths (#28424)
Closes https://github.com/denoland/deno/issues/27229.


TODO:
- [x] Tests
- [x] Make some changes to `deno_cache_dir` so we can get the paths for
the local http cache
- [x] Right now this leaves the node modules setup cache in an incorrect
state (removes the symlinks, but doesn't update the setup cache)
- [ ] ~~Handle code cache and other sqlite caches?~~
2025-04-29 22:42:17 +00:00
Laurence Rowe
bc346b1825
feat(cli): support --single-threaded v8 flag (#29066) 2025-04-29 18:40:27 -04:00
Efe
49dbe697e5
fix(compile): pass default v8 args during compile (#29084) 2025-04-29 10:13:54 -04:00
snek
f360d61d64
fix: move otel logic into otel (#29073)
cleanup
229228ae0d
2025-04-28 15:09:15 +02:00
Laurence Rowe
229228ae0d
fix(otel): only start deno_telemetry thread when needed (#29065)
Closes #29064
2025-04-27 12:57:18 -04:00
Leo Kettmeir
0134f268cb
fix: better error message for bare run in file-like case (#29055)
Fixes #28996
2025-04-26 15:54:41 +02:00
Bartek Iwańczuk
189ccffdb9
feat: Codegen feature flags (#28920)
This commit adds "deno_features" crate that contains definitions of all
unstable features in Deno.

Based on these definitions, both Rust and JS code is generated ensuring
that the two are always in sync.

In addition some of flag handling was rewritten to use the generated
definitions, instead of hand rolling these flag definitions.

---------

Co-authored-by: snek <snek@deno.com>
2025-04-25 08:33:45 +00:00
0hm☘️🏳️‍⚧️
c26b39a0aa
fix(cli): Display error on invalid OTEL_EXPORTER_OTLP_PROTOCOL value (#28796)
#28646

Edit:

Hi apologies for the delayed explanation @marvinhagemeister.

The reason the error message wasn't appearing was due to the
initialization order. The logging system was being initialized after the
telemetry system. This created a problem: if telemetry failed during its
own initialization, the logging system wasn't yet ready to capture and
report the error.

My solution was to simply move the log initialization to occur before
the telemetry initialization. This resolves the issue, ensuring any
telemetry setup errors are correctly logged.
2025-04-23 11:15:29 +02:00