helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: Fix: Rules of Hooks violation in AppRouter

There's some sketchy logic in AppRouter that (intentionally) violates the rules of hooks by reading an externally mutable condition. The rationalization is that it's OK to do this if the result is to infinitely suspend the component.

However, the mechanism used to infinitely suspend the component is `use(infinitePromise)` — this can lead to subtle bugs because even though `use` can be called conditionally, it relies on the assumption that its invocation is idempotent for the same props and state, i.e. you must still follow the rules of React regarding mutability and side effects.

Ideally we should refactor this block to not rely on external state at all, but in the meantime, we can switch from `use` to `throw` to suspend the component, since `throw` is lower level and isn't modeled as a hook.

Changed files:
filename: packages/next/src/client/components/app-router.tsx
patch: @@ -1,7 +1,6 @@
 'use client'
 
 import React, {
-  use,
   useEffect,
   useMemo,
   startTransition,
@@ -329,7 +328,10 @@ function Router({
     // TODO-APP: Should we listen to navigateerror here to catch failed
     // navigations somehow? And should we call window.stop() if a SPA navigation
     // should interrupt an MPA one?
-    use(unresolvedThenable)
+    // NOTE: This is intentionally using `throw` instead of `use` because we're
+    // inside an externally mutable condition (pushRef.mpaNavigation), which
+    // violates the rules of hooks.
+    throw unresolvedThenable
   }
 
   useEffect(() => {
Repository: electron/electron
Pull request: fix: remove unused id argument from TranslateToStock()

Backport of #44900

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/ui/message_box_gtk.cc
patch: @@ -102,11 +102,10 @@ class GtkMessageBox : private NativeWindowObserver {
     // Add buttons.
     GtkDialog* dialog = GTK_DIALOG(dialog_);
     if (settings.buttons.size() == 0) {
-      gtk_dialog_add_button(dialog, TranslateToStock(0, "OK"), 0);
+      gtk_dialog_add_button(dialog, TranslateToStock("OK"), 0);
     } else {
       for (size_t i = 0; i < settings.buttons.size(); ++i) {
-        gtk_dialog_add_button(dialog, TranslateToStock(i, settings.buttons[i]),
-                              i);
+        gtk_dialog_add_button(dialog, TranslateToStock(settings.buttons[i]), i);
       }
     }
     gtk_dialog_set_default_response(dialog, settings.default_id);
@@ -147,16 +146,20 @@ class GtkMessageBox : private NativeWindowObserver {
     }
   }
 
-  const char* TranslateToStock(int id, const std::string& text) {
+  static const char* TranslateToStock(const std::string& text) {
     const std::string lower = base::ToLowerASCII(text);
-    if (lower == "cancel")
+    if (lower == "cancel") {
       return gtk_util::GetCancelLabel();
-    if (lower == "no")
+    }
+    if (lower == "no") {
       return gtk_util::GetNoLabel();
-    if (lower == "ok")
+    }
+    if (lower == "ok") {
       return gtk_util::GetOkLabel();
-    if (lower == "yes")
+    }
+    if (lower == "yes") {
       return gtk_util::GetYesLabel();
+    }
     return text.c_str();
   }
Repository: ggml-org/llama.cpp
Pull request: ci : add copilot-setup-steps.yml

For creating a predictable environment for Copilot, see https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment

Changed files:
filename: .github/workflows/copilot-setup-steps.yml
patch: @@ -0,0 +1,52 @@
+name: "Copilot Setup Steps"
+
+# Automatically run the setup steps when they are changed to allow for easy validation, and
+# allow manual testing through the repository's "Actions" tab
+on:
+  workflow_dispatch:
+  push:
+    paths:
+      - .github/workflows/copilot-setup-steps.yml
+  pull_request:
+    paths:
+      - .github/workflows/copilot-setup-steps.yml
+
+jobs:
+  # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
+  copilot-setup-steps:
+    runs-on: ubuntu-latest
+
+    # Set the permissions to the lowest permissions possible needed for your steps.
+    # Copilot will be given its own token for its operations.
+    permissions:
+      # If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
+      contents: read
+
+    # You can define any steps you want, and they will run before the agent starts.
+    # If you do not check out your code, Copilot will do this for you.
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v4
+
+      - name: ccache
+        uses: hendrikmuhs/ccache-action@v1.2.16
+        with:
+          key: copilot-setup-steps
+          evict-old-files: 1d
+
+      - name: Dependencies
+        id: depends
+        run: |
+          sudo apt-get update
+          sudo apt-get install build-essential libcurl4-openssl-dev
+
+      - name: Set up Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: '3.11'
+
+      - name: Install Python dependencies
+        run: |
+          python3 -m venv .venv
+          .venv/bin/activate
+          pip install -r requirements/requirements-all.txt
Repository: nodejs/node
Pull request: doc: run license-builder

License is likely out of date. This is an automatically generated PR by the `license-builder.yml` GitHub Action, which runs `license-builder.sh` and submits a new PR or updates an existing PR.

Changed files:
filename: LICENSE
patch: @@ -366,7 +366,7 @@ The externally maintained libraries used by Node.js are:
 
     COPYRIGHT AND PERMISSION NOTICE
 
-    Copyright © 2016-2024 Unicode, Inc.
+    Copyright © 2016-2025 Unicode, Inc.
 
     NOTICE TO USER: Carefully read the following legal agreement. BY
     DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
Repository: denoland/deno
Pull request: fix(ext/crypto): fix jwk key_ops validation

Fixes https://github.com/denoland/deno/issues/26870

Changed files:
filename: ext/crypto/00_crypto.js
patch: @@ -2988,8 +2988,8 @@ function importKeyAES(
 
         if (
           !ArrayPrototypeEvery(
-            jwk.key_ops,
-            (u) => ArrayPrototypeIncludes(keyUsages, u),
+            keyUsages,
+            (u) => ArrayPrototypeIncludes(jwk.key_ops, u),
           )
         ) {
           throw new DOMException(
@@ -3163,8 +3163,8 @@ function importKeyHMAC(
 
         if (
           !ArrayPrototypeEvery(
-            jwk.key_ops,
-            (u) => ArrayPrototypeIncludes(keyUsages, u),
+            keyUsages,
+            (u) => ArrayPrototypeIncludes(jwk.key_ops, u),
           )
         ) {
           throw new DOMException(
@@ -3429,8 +3429,8 @@ function importKeyEC(
 
         if (
           !ArrayPrototypeEvery(
-            jwk.key_ops,
-            (u) => ArrayPrototypeIncludes(keyUsages, u),
+            keyUsages,
+            (u) => ArrayPrototypeIncludes(jwk.key_ops, u),
           )
         ) {
           throw new DOMException(
@@ -3843,8 +3843,8 @@ function importKeyRSA(
 
         if (
           !ArrayPrototypeEvery(
-            jwk.key_ops,
-            (u) => ArrayPrototypeIncludes(keyUsages, u),
+            keyUsages,
+            (u) => ArrayPrototypeIncludes(jwk.key_ops, u),
           )
         ) {
           throw new DOMException(

filename: tests/unit/webcrypto_test.ts
patch: @@ -2086,6 +2086,42 @@ Deno.test(async function x25519SharedSecret() {
   assertEquals(new Uint8Array(sharedSecret1), new Uint8Array(sharedSecret2));
 });
 
+// https://github.com/denoland/deno/issues/26870
+Deno.test(async function jwkKeyOpsValidation() {
+  const { privateKey } = await crypto.subtle.generateKey(
+    {
+      name: "RSASSA-PKCS1-v1_5",
+      hash: { name: "SHA-256" },
+      publicExponent: new Uint8Array([1, 0, 1]),
+      modulusLength: 2048,
+    },
+    true,
+    ["sign", "verify"],
+  );
+
+  // https://github.com/node-opcua/node-opcua-crypto/blob/a2a1b8a4d416fe176cd1a38796c4b13f938cd01c/packages/node-opcua-crypto/source/x509/_build_public_key.ts#L30-L49
+  const jwk = await crypto.subtle.exportKey("jwk", privateKey);
+  delete jwk.d;
+  delete jwk.dp;
+  delete jwk.dq;
+  delete jwk.q;
+  delete jwk.qi;
+  jwk.key_ops = [
+    "encrypt",
+    "sign",
+  ];
+
+  const publicKey = await crypto.subtle.importKey(
+    "jwk",
+    jwk,
+    { name: "RSASSA-PKCS1-v1_5", hash: { name: "SHA-256" } },
+    true,
+    [],
+  );
+
+  assert(publicKey);
+});
+
 Deno.test(async function x25519ExportJwk() {
   const keyPair = await crypto.subtle.generateKey(
     {
Repository: vercel/next.js
Pull request: [turbopack] Simplify the implementations of TaskOutput::try_from_raw_vc

Because RawVc is just a type erased version of Vc<T> we can have a single implementation.

Closes PACK-4863

Changed files:
filename: turbopack/crates/turbo-tasks-testing/src/lib.rs
patch: @@ -144,10 +144,6 @@ impl TurboTasksCallApi for VcStorage {
 }
 
 impl TurboTasksApi for VcStorage {
-    fn pin(&self) -> Arc<dyn TurboTasksApi> {
-        self.this.upgrade().unwrap()
-    }
-
     fn invalidate(&self, _task: TaskId) {
         unreachable!()
     }

filename: turbopack/crates/turbo-tasks/src/manager.rs
patch: @@ -100,8 +100,6 @@ pub trait TurboTasksCallApi: Sync + Send {
 /// This trait is needed because thread locals cannot contain an unresolved [`Backend`] type
 /// parameter.
 pub trait TurboTasksApi: TurboTasksCallApi + Sync + Send {
-    fn pin(&self) -> Arc<dyn TurboTasksApi>;
-
     fn invalidate(&self, task: TaskId);
     fn invalidate_with_reason(&self, task: TaskId, reason: StaticOrArc<dyn InvalidationReason>);
 
@@ -1222,10 +1220,6 @@ impl<B: Backend + 'static> TurboTasksCallApi for TurboTasks<B> {
 }
 
 impl<B: Backend + 'static> TurboTasksApi for TurboTasks<B> {
-    fn pin(&self) -> Arc<dyn TurboTasksApi> {
-        self.pin()
-    }
-
     #[instrument(level = Level::INFO, skip_all, name = "invalidate")]
     fn invalidate(&self, task: TaskId) {
         self.backend.invalidate_task(task, self);

filename: turbopack/crates/turbo-tasks/src/task/task_output.rs
patch: @@ -7,36 +7,30 @@ use crate::{RawVc, Vc};
 /// Trait to implement in order for a type to be accepted as a
 /// `turbo_tasks::function` return type.
 pub trait TaskOutput: Send {
-    type Return;
+    type Return: ?Sized;
 
-    fn try_from_raw_vc(raw_vc: RawVc) -> Self::Return;
+    fn try_from_raw_vc(raw_vc: RawVc) -> Vc<Self::Return> {
+        Vc {
+            node: raw_vc,
+            _t: PhantomData,
+        }
+    }
     fn try_into_raw_vc(self) -> Result<RawVc>;
 }
 
 impl<T> TaskOutput for Vc<T>
 where
     T: Send + ?Sized,
 {
-    type Return = Vc<T>;
-
-    fn try_from_raw_vc(raw_vc: RawVc) -> Self::Return {
-        Vc {
-            node: raw_vc,
-            _t: PhantomData,
-        }
-    }
+    type Return = T;
 
     fn try_into_raw_vc(self) -> Result<RawVc> {
         Ok(self.node)
     }
 }
 
 impl TaskOutput for () {
-    type Return = Vc<()>;
-
-    fn try_from_raw_vc(raw_vc: RawVc) -> Self::Return {
-        raw_vc.into()
-    }
+    type Return = ();
 
     fn try_into_raw_vc(self) -> Result<RawVc> {
         let unit = Vc::<()>::default();
@@ -50,10 +44,6 @@ where
 {
     type Return = T::Return;
 
-    fn try_from_raw_vc(raw_vc: RawVc) -> Self::Return {
-        T::try_from_raw_vc(raw_vc)
-    }
-
     fn try_into_raw_vc(self) -> Result<RawVc> {
         self?.try_into_raw_vc()
     }
Repository: huggingface/transformers
Pull request: Fix ReDOS in tokenizer digit substitution

We use possessive quantifiers with `regex` for Py < 3.11 or `re` for Py >= 3.11 to avoid huge slowdown here.

cc @Michellehbn !

Changed files:
filename: src/transformers/models/clvp/number_normalizer.py
patch: @@ -15,7 +15,14 @@
 
 """English Normalizer class for CLVP."""
 
-import re
+import sys
+
+
+if sys.version_info >= (3, 11):
+    # Atomic grouping support was only added to the core RE in Python 3.11
+    import re
+else:
+    import regex as re
 
 
 class EnglishNormalizer:
@@ -199,12 +206,12 @@ def normalize_numbers(self, text: str) -> str:
         This method is used to normalize numbers within a text such as converting the numbers to words, removing
         commas, etc.
         """
-        text = re.sub(re.compile(r"([0-9][0-9\,]+[0-9])"), self._remove_commas, text)
-        text = re.sub(re.compile(r"£([0-9\,]*[0-9]+)"), r"\1 pounds", text)
-        text = re.sub(re.compile(r"\$([0-9\.\,]*[0-9]+)"), self._expand_dollars, text)
-        text = re.sub(re.compile(r"([0-9]+\.[0-9]+)"), self._expand_decimal_point, text)
-        text = re.sub(re.compile(r"[0-9]+(st|nd|rd|th)"), self._expand_ordinal, text)
-        text = re.sub(re.compile(r"[0-9]+"), self._expand_number, text)
+        text = re.sub(r"([0-9][0-9,]+[0-9])", self._remove_commas, text)
+        text = re.sub(r"£([0-9,]*[0-9])", r"\1 pounds", text)
+        text = re.sub(r"\$([0-9.,]*[0-9])", self._expand_dollars, text)
+        text = re.sub(r"([0-9]++\.[0-9]+)", self._expand_decimal_point, text)
+        text = re.sub(r"[0-9]++(st|nd|rd|th)", self._expand_ordinal, text)
+        text = re.sub(r"[0-9]+", self._expand_number, text)
         return text
 
     def expand_abbreviations(self, text: str) -> str:
Repository: ggml-org/llama.cpp
Pull request: HIP: disable sync warp shuffel operators from clr amd_warp_sync_functions.h

We dont use these operators at all on hip and they are causing trouble with rocwmma's headers, so lets just disable them.


Changed files:
filename: ggml/src/ggml-cuda/fattn-wmma-f16.cu
patch: @@ -15,7 +15,6 @@ namespace wmma = mtmusa::wmma;
 namespace wmma = nvcuda::wmma;
 #endif // GGML_USE_MUSA
 #elif defined(GGML_HIP_ROCWMMA_FATTN) && defined(FP16_MMA_AVAILABLE)
-#undef HIP_ENABLE_WARP_SYNC_BUILTINS // conflicts with rocWMMA headers
 #include <rocwmma/rocwmma.hpp>
 namespace wmma = rocwmma;
 #endif // !defined(GGML_USE_HIP)

filename: ggml/src/ggml-cuda/vendors/hip.h
patch: @@ -1,6 +1,6 @@
 #pragma once
 
-#define HIP_ENABLE_WARP_SYNC_BUILTINS 1
+#define HIP_DISABLE_WARP_SYNC_BUILTINS 1
 #include <hip/hip_runtime.h>
 #include <hipblas/hipblas.h>
 #include <hip/hip_fp16.h>
Repository: denoland/deno
Pull request: fix(install/global): warn about not including auto-discovered config file

Very common source of confusion.

Closes #17855

Changed files:
filename: cli/tools/installer.rs
patch: @@ -409,6 +409,12 @@ async fn install_global(
     .load_and_type_check_files(&[install_flags_global.module_url.clone()])
     .await?;
 
+  if matches!(flags.config_flag, ConfigFlag::Discover)
+    && cli_options.workspace().deno_jsons().next().is_some()
+  {
+    log::warn!("{} discovered config file will be ignored in the installed command. Use the --config flag if you wish to include it.", crate::colors::yellow("Warning"));
+  }
+
   // create the install shim
   create_install_shim(http_client, &flags, install_flags_global).await
 }

filename: tests/specs/install/global/warn_config_file/__test__.jsonc
patch: @@ -0,0 +1,5 @@
+{
+  "tempDir": true,
+  "args": "install --root ./bins -g --name my-cli main.js",
+  "output": "install.out"
+}

filename: tests/specs/install/global/warn_config_file/deno.json
patch: @@ -0,0 +1,2 @@
+{
+}

filename: tests/specs/install/global/warn_config_file/install.out
patch: @@ -0,0 +1,3 @@
+Warning discovered config file will be ignored in the installed command. Use the --config flag if you wish to include it.
+✅ Successfully installed my-cli
+[WILDCARD]

filename: tests/specs/install/global/warn_config_file/main.js
patch: @@ -0,0 +1 @@
+console.log(1);
Repository: nodejs/node
Pull request: doc: update support channels

This PR updates the SUPPORT.md adding the Node.js Website Learn section and the new Discord server.

Changed files:
filename: .github/SUPPORT.md
patch: @@ -7,9 +7,10 @@ Node.js](https://github.com/nodejs/Release#release-schedule).
 When looking for support, please first search for your question in these venues:
 
 * [Node.js Website](https://nodejs.org/en/), especially the
-  [API docs](https://nodejs.org/api/)
-* [Node.js Help](https://github.com/nodejs/help)
+  [API docs](https://nodejs.org/api/) or the [Learn material](https://nodejs.org/en/learn)
+* [Node.js's GitHub Help repository](https://github.com/nodejs/help)
 * [Open or closed issues in the Node.js GitHub organization](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Anodejs+is%3Aissue)
+* [Ask for support on Node.js's Discord server](https://nodejs.org/discord)
 
 If you didn't find an answer in the resources above, try these unofficial
 resources:
@@ -19,7 +20,7 @@ resources:
 * [Node.js Slack Community](https://node-js.slack.com/)
   * To register: [nodeslackers.com](https://www.nodeslackers.com/)
 
-GitHub issues are for tracking enhancements and bugs, not general support.
+**GitHub issues are for tracking enhancements and bugs, not general support.**
 
 The open source license grants you the freedom to use Node.js. It does not
 guarantee commitments of other people's time. Please be respectful and manage
Repository: nodejs/node
Pull request: doc: remove cryptoStream API reference

This was removed in https://github.com/nodejs/node/pull/22033

Changed files:
filename: doc/api/deprecations.md
patch: @@ -940,7 +940,7 @@ changes:
 
 Type: End-of-Life
 
-The [`tls.CryptoStream`][] class was removed. Please use
+The `tls.CryptoStream` class was removed. Please use
 [`tls.TLSSocket`][] instead.
 
 ### DEP0043: `tls.SecurePair`
@@ -3994,7 +3994,6 @@ When an `args` array is passed to [`child_process.execFile`][] or [`child_proces
 [`timeout.ref()`]: timers.md#timeoutref
 [`timeout.refresh()`]: timers.md#timeoutrefresh
 [`timeout.unref()`]: timers.md#timeoutunref
-[`tls.CryptoStream`]: tls.md#class-tlscryptostream
 [`tls.SecureContext`]: tls.md#tlscreatesecurecontextoptions
 [`tls.TLSSocket`]: tls.md#class-tlstlssocket
 [`tls.checkServerIdentity()`]: tls.md#tlscheckserveridentityhostname-cert

filename: doc/api/tls.md
patch: @@ -553,29 +553,6 @@ appends a hint suggesting that if the root CA is installed locally,
 try running with the `--use-system-ca` flag to direct developers towards a
 secure solution, to prevent unsafe workarounds.
 
-## Class: `tls.CryptoStream`
-
-<!-- YAML
-added: v0.3.4
-deprecated: v0.11.3
--->
-
-> Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead.
-
-The `tls.CryptoStream` class represents a stream of encrypted data. This class
-is deprecated and should no longer be used.
-
-### `cryptoStream.bytesWritten`
-
-<!-- YAML
-added: v0.3.4
-deprecated: v0.11.3
--->
-
-The `cryptoStream.bytesWritten` property returns the total number of bytes
-written to the underlying socket _including_ the bytes required for the
-implementation of the TLS protocol.
-
 ## Class: `tls.Server`
 
 <!-- YAML
Repository: huggingface/transformers
Pull request: Skip sdpa tests if submodule does not support sdpa

The tests `test_sdpa_can_dispatch_on_flash` and `test_sdpa_can_compile_dynamic` fail if a submodule of the model being tested does not support sdpa.
An example of this is `Blip2ModelTest` (and friends) because it has the submodule `Blip2QFormerModel` which does not support sdpa.

With this PR we should now be skipping these tests after detecting that the submodule has `_supports_sdpa = False`.

This addresses several of the "hidden failing tests" described in #38820 

Changed files:
filename: tests/test_modeling_common.py
patch: @@ -3799,8 +3799,20 @@ def test_sdpa_can_dispatch_on_flash(self):
                 self.skipTest(reason="Idefics currently (transformers==4.39.1) requires an image_attention_mask input")
             if config.model_type in ["sam"]:
                 self.skipTest(reason="SAM requires an attention_mask input for relative positional embeddings")
+
             model = model_class(config)
 
+            sub_models_supporting_sdpa = [
+                module._supports_sdpa
+                for name, module in model.named_modules()
+                if isinstance(module, PreTrainedModel) and name != ""
+            ]
+            supports_sdpa_all_modules = (
+                all(sub_models_supporting_sdpa) if len(sub_models_supporting_sdpa) > 0 else model._supports_sdpa
+            )
+            if not supports_sdpa_all_modules:
+                self.skipTest(reason="This models' submodels does not support sdpa")
+
             with tempfile.TemporaryDirectory() as tmpdirname:
                 model.save_pretrained(tmpdirname)
                 model = model_class.from_pretrained(tmpdirname, torch_dtype=torch.float16, attn_implementation="sdpa")
@@ -3848,8 +3860,20 @@ def test_sdpa_can_compile_dynamic(self):
                     "Cannot compile forward without an existing cache with Hybrid, as `torch._dynamo.mark_static_address` "
                     "is a forbidden call."
                 )
+
             model = model_class(config)
 
+            sub_models_supporting_sdpa = [
+                module._supports_sdpa
+                for name, module in model.named_modules()
+                if isinstance(module, PreTrainedModel) and name != ""
+            ]
+            supports_sdpa_all_modules = (
+                all(sub_models_supporting_sdpa) if len(sub_models_supporting_sdpa) > 0 else model._supports_sdpa
+            )
+            if not supports_sdpa_all_modules:
+                self.skipTest(reason="This models' submodels does not support sdpa")
+
             with tempfile.TemporaryDirectory() as tmpdirname:
                 model.save_pretrained(tmpdirname)
                 model = model_class.from_pretrained(tmpdirname, torch_dtype=torch.float16, attn_implementation="sdpa")