diff --git a/.envrc b/.envrc new file mode 100644 index 00000000000000..e515c41f5fbe24 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake -j auto diff --git a/.gitignore b/.gitignore index a332a06bff2df6..13b7cdfb5773ed 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .env /.cargo_home/ +/.direnv /.idea/ /.vs/ /.vscode/ diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs index 4adfcba57d8c68..a085625f6519dd 100644 --- a/ext/fetch/lib.rs +++ b/ext/fetch/lib.rs @@ -152,6 +152,7 @@ impl FetchHandler for DenoFetchHandler { type Options = Options; fn fetch( + _scope: &mut v8::HandleScope, state: &mut deno_core::OpState, method: ByteString, url: String, diff --git a/ext/fetch_base/lib.rs b/ext/fetch_base/lib.rs index b22658de1f951e..d115ccfcebc5e8 100644 --- a/ext/fetch_base/lib.rs +++ b/ext/fetch_base/lib.rs @@ -81,6 +81,7 @@ pub trait FetchHandler: 'static { type Options; fn fetch( + scope: &mut v8::HandleScope, state: &mut deno_core::OpState, method: ByteString, url: String, @@ -116,10 +117,11 @@ pub struct FetchReturn { pub cancel_handle_rid: Option, } -#[op2(reentrant, stack_trace)] +#[op2(stack_trace)] #[serde] #[allow(clippy::too_many_arguments)] pub fn op_fetch( + scope: &mut v8::HandleScope, state: &mut OpState, #[serde] method: ByteString, #[string] url: String, @@ -133,6 +135,7 @@ where FH: FetchHandler + 'static { FH::fetch( + scope, state, method, url, @@ -163,7 +166,7 @@ pub struct FetchResponse { pub error: Option<(String, String)>, } -#[op2(async, reentrant)] +#[op2(async)] #[serde] pub async fn op_fetch_send( state: Rc>, diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000000000..a6394ae197584f --- /dev/null +++ b/flake.lock @@ -0,0 +1,81 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1744624163, + "narHash": "sha256-lR5E1rusNjjPXOZA6FezVTEA0xPNAL32cc7y/T0cXOQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1a11438b83b5694ed1a4e2b950ed7c111f6fe1cf", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744599145, + "narHash": "sha256-yzaDPkJwZdUtRj/dzdOeB74yryWzpngYaD7BedqFKk8=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "fd6795d3d28f956de01a0458b6fa7baae5c793b4", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000000000..114397640c5d51 --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs: + with inputs; + flake-utils.lib.eachDefaultSystem(system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ + (import rust-overlay) + ]; + }; + rustToolchain = + let toolchain = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml)).toolchain; + in pkgs.rust-bin.fromRustupToolchain toolchain; + in + { + devShells.default = pkgs.mkShell { + buildInputs = [ + rustToolchain + pkgs.rust-analyzer + ]; + }; + } + ); +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000000000..71a377d988f19d --- /dev/null +++ b/shell.nix @@ -0,0 +1 @@ +(builtins.getFlake (toString ./.)).devShells.${builtins.currentSystem}.default