helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: clang variable configuration in generated node headers

#### Description of Change

Adopts for the change in https://github.com/nodejs/node/commit/6e0a2bb54c5bbeff0e9e33e1a0c683ed980a8a0f which came in via `v20.18.0`

#### Release Notes

Notes: fix native addon compilation errors on macOS

Changed files:
filename: patches/node/.patches
patch: @@ -53,3 +53,4 @@ build_don_t_redefine_win32_lean_and_mean.patch
 build_compile_with_c_20_support.patch
 add_v8_taskpirority_to_foreground_task_runner_signature.patch
 cli_remove_deprecated_v8_flag.patch
+build_restore_clang_as_default_compiler_on_macos.patch

filename: patches/node/build_restore_clang_as_default_compiler_on_macos.patch
patch: @@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <hop2deep@gmail.com>
+Date: Fri, 11 Oct 2024 15:01:25 +0900
+Subject: build: restore clang as default compiler on macOS
+
+Refs https://github.com/nodejs/node/commit/6e0a2bb54c5bbeff0e9e33e1a0c683ed980a8a0f
+configures the value at build time which doesn't work in Electron
+as it depends on the environment in which the headers got generated from which
+cannot reflect the value per platform. It works for Node.js since
+node-gyp will use the result of `process.config` that reflects the environment
+in which the binary got built.
+
+diff --git a/common.gypi b/common.gypi
+index 2eb62610db2f0ebf68fa9a55ffba98291ecfe451..3ec08ee144b586d05c4e49c2251416734cbc02c5 100644
+--- a/common.gypi
++++ b/common.gypi
+@@ -125,6 +125,7 @@
+         'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a',
+       }],
+       ['OS=="mac"', {
++        'clang%': 1,
+         'obj_dir%': '<(PRODUCT_DIR)/obj.target',
+         'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a',
+       }],

filename: script/generate-config-gypi.py
patch: @@ -61,6 +61,10 @@ def main(target_file, target_cpu):
   v['node_module_version'] = int(args['node_module_version'])
   # Used by certain versions of node-gyp.
   v['build_v8_with_gn'] = 'false'
+  # Enable clang conditionally based on target platform
+  # in common.gypi
+  if 'clang' in v:
+    del v['clang']
 
   with open(target_file, 'w+', encoding='utf-8') as file_out:
     file_out.write(pprint.pformat(config, indent=2))
Repository: electron/electron
Pull request: fix: clang variable configuration in generated node headers

Backport of #44189

See that PR for details.


Notes: fix native addon compilation errors on macOS

Changed files:
filename: patches/node/.patches
patch: @@ -45,3 +45,4 @@ cherry-pick_src_remove_calls_to_recently_deprecated_v8_apis.patch
 test_update_v8-stats_test_for_v8_12_6.patch
 src_use_supported_api_to_get_stalled_tla_messages.patch
 build_don_t_redefine_win32_lean_and_mean.patch
+build_restore_clang_as_default_compiler_on_macos.patch

filename: patches/node/build_restore_clang_as_default_compiler_on_macos.patch
patch: @@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <hop2deep@gmail.com>
+Date: Fri, 11 Oct 2024 15:01:25 +0900
+Subject: build: restore clang as default compiler on macOS
+
+Refs https://github.com/nodejs/node/commit/6e0a2bb54c5bbeff0e9e33e1a0c683ed980a8a0f
+configures the value at build time which doesn't work in Electron
+as it depends on the environment in which the headers got generated from which
+cannot reflect the value per platform. It works for Node.js since
+node-gyp will use the result of `process.config` that reflects the environment
+in which the binary got built.
+
+diff --git a/common.gypi b/common.gypi
+index bdf1a1f33f3ea09d933757c7fee87c563cc833ab..0cd67d7d8df79e8b11b5d270aedce772ea23dcae 100644
+--- a/common.gypi
++++ b/common.gypi
+@@ -125,6 +125,7 @@
+         'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a',
+       }],
+       ['OS=="mac"', {
++        'clang%': 1,
+         'obj_dir%': '<(PRODUCT_DIR)/obj.target',
+         'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a',
+       }],

filename: script/generate-config-gypi.py
patch: @@ -61,6 +61,10 @@ def main(target_file, target_cpu):
   v['node_module_version'] = int(args['node_module_version'])
   # Used by certain versions of node-gyp.
   v['build_v8_with_gn'] = 'false'
+  # Enable clang conditionally based on target platform
+  # in common.gypi
+  if 'clang' in v:
+    del v['clang']
 
   with open(target_file, 'w+', encoding='utf-8') as file_out:
     file_out.write(pprint.pformat(config, indent=2))
Repository: ggml-org/llama.cpp
Pull request: Remove arcee AFM change in convert_hf_to_gguf_update.py

Accidentally added a change for a new tokenizer that wasn't necessary

@CISC 

Changed files:
filename: convert_hf_to_gguf_update.py
patch: @@ -128,7 +128,6 @@ class TOKENIZER_TYPE(IntEnum):
     {"name": "llama4",           "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E-Instruct", },
     {"name": "pixtral",          "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/mistral-community/pixtral-12b", },
     {"name": "seed-coder",       "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/ByteDance-Seed/Seed-Coder-8B-Base", },
-    {"name": "arcee",            "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/arcee-ai/AFM-4.5B", }, # TODO confirm final URL
 ]
 
 # some models are known to be broken upstream, so we will skip them as exceptions
Repository: huggingface/transformers
Pull request: In Llama4 fix wrongly inverted causal attention mask when using SDPA implementation

When preparing the causal attention mask at this point the mask comes in as a float tensor with min value as a masked value.
It is not correct to convert it to bool and treat it as a bool mask as this inverts the mask. `torch.nn.functional.scaled_dot_product_attention` expects that a bool masked value is `False`.

I suspect that the `sdpa` implementation variant may not have been thoroughly tested and that is why this error was not caught earlier.


Changed files:
filename: src/transformers/models/llama4/modeling_llama4.py
patch: @@ -730,7 +730,7 @@ def _update_causal_mask(
         # When output attentions is True, sdpa implementation's forward method calls the eager implementation's forward
         if self.config._attn_implementation == "sdpa" and chunked_attention_mask is not None:
             chunked_attention_mask = chunked_attention_mask.bool()
-            causal_mask = causal_mask.bool()
+            causal_mask = causal_mask != torch.finfo(dtype).min
             if AttentionMaskConverter._ignore_causal_mask_sdpa(
                 attention_mask,
                 inputs_embeds=input_tensor,
Repository: denoland/deno
Pull request: fix(ext/node): compute pem length (upper bound) for key exports

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


Changed files:
filename: ext/node/ops/crypto/keys.rs
patch: @@ -2024,7 +2024,9 @@ pub fn op_node_export_public_key_pem(
     _ => unreachable!("export_der would have errored"),
   };
 
-  let mut out = vec![0; 2048];
+  let pem_len = der::pem::encapsulated_len(label, LineEnding::LF, data.len())
+    .map_err(|_| type_error("very large data"))?;
+  let mut out = vec![0; pem_len];
   let mut writer = PemWriter::new(label, LineEnding::LF, &mut out)?;
   writer.write(&data)?;
   let len = writer.finish()?;
@@ -2063,7 +2065,9 @@ pub fn op_node_export_private_key_pem(
     _ => unreachable!("export_der would have errored"),
   };
 
-  let mut out = vec![0; 2048];
+  let pem_len = der::pem::encapsulated_len(label, LineEnding::LF, data.len())
+    .map_err(|_| type_error("very large data"))?;
+  let mut out = vec![0; pem_len];
   let mut writer = PemWriter::new(label, LineEnding::LF, &mut out)?;
   writer.write(&data)?;
   let len = writer.finish()?;

filename: tests/unit_node/crypto/crypto_key_test.ts
patch: @@ -656,3 +656,24 @@ z6TExWlQMjt66nV7R8cRAkzmABrG+NW3e8Zpac7Lkuv+zu0S+K7c
   assertEquals(publicKey.type, "public");
   assertEquals(publicKey.asymmetricKeyType, "rsa");
 });
+
+// https://github.com/denoland/deno/issues/26188
+Deno.test("generateKeyPair large pem", function () {
+  const passphrase = "mypassphrase";
+  const cipher = "aes-256-cbc";
+  const modulusLength = 4096;
+
+  generateKeyPairSync("rsa", {
+    modulusLength,
+    publicKeyEncoding: {
+      type: "spki",
+      format: "pem",
+    },
+    privateKeyEncoding: {
+      type: "pkcs8",
+      format: "pem",
+      cipher,
+      passphrase,
+    },
+  });
+});
Repository: huggingface/transformers
Pull request: Disable torchscript tests for AriaForConditionalGenerationModelTest


Changed files:
filename: tests/models/aria/test_modeling_aria.py
patch: @@ -180,6 +180,7 @@ class AriaForConditionalGenerationModelTest(ModelTesterMixin, GenerationTesterMi
     all_model_classes = (AriaModel, AriaForConditionalGeneration) if is_torch_available() else ()
     test_pruning = False
     test_head_masking = False
+    test_torchscript = False
     _is_composite = True
 
     def setUp(self):
Repository: vercel/next.js
Pull request: fix(next-swc): Fix react compiler usefulness detector

### What?

Fix usefulness detector for the React Compiler

### Why?

JSX was also target of the React Compiler

### How?

Closes https://github.com/vercel/next.js/issues/79385

Closes PACK-4650

Changed files:
filename: crates/next-custom-transforms/src/react_compiler.rs
patch: @@ -38,6 +38,18 @@ impl Visit for Finder {
         if self.found {
             return;
         }
+        if matches!(
+            node,
+            Expr::JSXMember(..)
+                | Expr::JSXNamespacedName(..)
+                | Expr::JSXEmpty(..)
+                | Expr::JSXElement(..)
+                | Expr::JSXFragment(..)
+        ) {
+            self.found = true;
+            return;
+        }
+
         node.visit_children_with(self);
     }
 
@@ -54,7 +66,7 @@ impl Visit for Finder {
     fn visit_fn_expr(&mut self, node: &FnExpr) {
         let old = self.is_interested;
 
-        self.is_interested = node.ident.as_ref().is_some_and(|ident| {
+        self.is_interested |= node.ident.as_ref().is_some_and(|ident| {
             ident.sym.starts_with("use") || ident.sym.starts_with(|c: char| c.is_ascii_uppercase())
         });
Repository: denoland/deno
Pull request: fix(ext/node): allow writing to tty columns

Behave similar to Node.js where modifying `stdout.columns` doesn't really resize the terminal. Ref https://github.com/nodejs/node/issues/17529

Fixes https://github.com/denoland/deno/issues/26196

Changed files:
filename: ext/node/polyfills/_process/streams.mjs
patch: @@ -66,14 +66,19 @@ export function createWritableStdioStream(writer, name, warmup = false) {
 
   // We cannot call `writer?.isTerminal()` eagerly here
   let getIsTTY = () => writer?.isTerminal();
+  const getColumns = () =>
+    stream._columns ||
+    (writer?.isTerminal() ? Deno.consoleSize?.().columns : undefined);
 
   ObjectDefineProperties(stream, {
     columns: {
       __proto__: null,
       enumerable: true,
       configurable: true,
-      get: () =>
-        writer?.isTerminal() ? Deno.consoleSize?.().columns : undefined,
+      get: () => getColumns(),
+      set: (value) => {
+        stream._columns = value;
+      },
     },
     rows: {
       __proto__: null,

filename: tests/unit_node/process_test.ts
patch: @@ -1175,3 +1175,8 @@ Deno.test("process.cpuUsage()", () => {
   assert(typeof cpuUsage.user === "number");
   assert(typeof cpuUsage.system === "number");
 });
+
+Deno.test("process.stdout.columns writable", () => {
+  process.stdout.columns = 80;
+  assertEquals(process.stdout.columns, 80);
+});
Repository: ggml-org/llama.cpp
Pull request: Allow override when adding value to ggufwriter

Discussion: #14164 

This PR use a simple way to allow overriding value when add key-value to GGUF, which has been mentioned here: https://github.com/ggml-org/llama.cpp/pull/14164#discussion_r2146579293

This can cause drastic changes in many unexpected aspects, so please review carefully

Changed files:
filename: gguf-py/gguf/gguf_writer.py
patch: @@ -271,7 +271,7 @@ def write_ti_data_to_file(self) -> None:
 
     def add_key_value(self, key: str, val: Any, vtype: GGUFValueType, sub_type: GGUFValueType | None = None) -> None:
         if any(key in kv_data for kv_data in self.kv_data):
-            raise ValueError(f'Duplicated key name {key!r}')
+            logger.warning(f'Duplicated key name {key!r}, overwriting it with new value {val!r} of type {vtype.name}')
 
         self.kv_data[0][key] = GGUFValue(value=val, type=vtype, sub_type=sub_type)
Repository: facebook/react
Pull request: Flow upgrade to 0.155

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #25414
* #25413

This version banned use of this in object functions.

Changed files:
filename: packages/react-native-renderer/src/ReactFabricHostConfig.js
patch: @@ -317,6 +317,7 @@ class ReactFabricHostComponent {
 
 // eslint-disable-next-line no-unused-expressions
 // $FlowFixMe[class-object-subtyping] found when upgrading Flow
+// $FlowFixMe[method-unbinding] found when upgrading Flow
 (ReactFabricHostComponent.prototype: $ReadOnly<{...NativeMethods, ...}>);
 
 export * from 'react-reconciler/src/ReactFiberHostConfigWithNoMutation';

filename: packages/react-native-renderer/src/ReactNativeFiberHostComponent.js
patch: @@ -128,6 +128,7 @@ class ReactNativeFiberHostComponent {
 
 // eslint-disable-next-line no-unused-expressions
 // $FlowFixMe[class-object-subtyping] found when upgrading Flow
+// $FlowFixMe[method-unbinding] found when upgrading Flow
 (ReactNativeFiberHostComponent.prototype: $ReadOnly<{...NativeMethods, ...}>);
 
 export default ReactNativeFiberHostComponent;
Repository: vercel/next.js
Pull request: Turbopack Build: Fix _error loading test

## What?

Fixes the test but also uses a better implementation that makes the request block by Playwright instead of deleting files on disk. Making it closer to the actual behavior we expect, i.e. browser fails to load the file -> hard navigation.

Closes PACK-4653

Changed files:
filename: test/integration/error-load-fail/test/index.test.js
patch: @@ -1,16 +1,8 @@
 /* eslint-env jest */
 
 import { join } from 'path'
-import fs from 'fs-extra'
 import webdriver from 'next-webdriver'
-import {
-  nextBuild,
-  nextStart,
-  findPort,
-  killApp,
-  check,
-  getPageFileFromBuildManifest,
-} from 'next-test-utils'
+import { nextBuild, nextStart, findPort, killApp, check } from 'next-test-utils'
 
 const appDir = join(__dirname, '..')
 let app
@@ -26,38 +18,16 @@ describe('Failing to load _error', () => {
         const appPort = await findPort()
         app = await nextStart(appDir, appPort)
 
-        const browser = await webdriver(appPort, '/')
-        await browser.eval(`window.beforeNavigate = true`)
-
-        await browser.elementByCss('#to-broken').moveTo()
-        await check(
-          async () => {
-            const scripts = await browser.elementsByCss('script')
-            let found = false
-
-            for (const script of scripts) {
-              const src = await script.getAttribute('src')
-              if (src.includes('broken-')) {
-                found = true
-                break
-              }
-            }
-            return found
+        const browser = await webdriver(appPort, '/', {
+          beforePageLoad(page) {
+            // Make _error route fail to load
+            page.route('**/_error*.js', (route) => {
+              route.abort('blockedbyclient')
+            })
           },
-          {
-            test(content) {
-              return content === true
-            },
-          }
-        )
-
-        const errorPageFilePath = getPageFileFromBuildManifest(
-          appDir,
-          '/_error'
-        )
-        // remove _error client bundle so that it can't be loaded
-        await fs.remove(join(appDir, '.next', errorPageFilePath))
+        })
 
+        await browser.eval(`window.beforeNavigate = true`)
         await browser.elementByCss('#to-broken').click()
 
         await check(async () => {

filename: test/turbopack-build-tests-manifest.json
patch: @@ -11639,10 +11639,10 @@
     "runtimeError": false
   },
   "test/integration/error-load-fail/test/index.test.js": {
-    "passed": [],
-    "failed": [
+    "passed": [
       "Failing to load _error production mode handles failing to load _error correctly"
     ],
+    "failed": [],
     "pending": [],
     "flakey": [],
     "runtimeError": false
Repository: facebook/react
Pull request: Flow upgrade to 0.154

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #25414
* __->__ #25413



Changed files:
filename: packages/react-native-renderer/src/ReactFabricHostConfig.js
patch: @@ -317,6 +317,7 @@ class ReactFabricHostComponent {
 
 // eslint-disable-next-line no-unused-expressions
 // $FlowFixMe[class-object-subtyping] found when upgrading Flow
+// $FlowFixMe[method-unbinding] found when upgrading Flow
 (ReactFabricHostComponent.prototype: $ReadOnly<{...NativeMethods, ...}>);
 
 export * from 'react-reconciler/src/ReactFiberHostConfigWithNoMutation';

filename: packages/react-native-renderer/src/ReactNativeFiberHostComponent.js
patch: @@ -128,6 +128,7 @@ class ReactNativeFiberHostComponent {
 
 // eslint-disable-next-line no-unused-expressions
 // $FlowFixMe[class-object-subtyping] found when upgrading Flow
+// $FlowFixMe[method-unbinding] found when upgrading Flow
 (ReactNativeFiberHostComponent.prototype: $ReadOnly<{...NativeMethods, ...}>);
 
 export default ReactNativeFiberHostComponent;
Repository: denoland/deno
Pull request: fix(ext/napi): pass user context to napi_threadsafe_fn finalizers

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


Changed files:
filename: cli/napi/node_api.rs
patch: @@ -692,7 +692,7 @@ impl Drop for TsFn {
 
     if let Some(finalizer) = self.thread_finalize_cb {
       unsafe {
-        (finalizer)(self.env as _, self.thread_finalize_data, ptr::null_mut());
+        (finalizer)(self.env as _, self.thread_finalize_data, self.context);
       }
     }
   }

filename: tests/napi/src/tsfn.rs
patch: @@ -46,6 +46,7 @@ fn create_custom_gc(env: sys::napi_env) {
     "Create async resource string in napi_register_module_v1 napi_register_module_v1"
   );
   let mut custom_gc_tsfn = ptr::null_mut();
+  let context = Box::into_raw(Box::new(0)) as *mut c_void;
   check_status_or_panic!(
     unsafe {
       sys::napi_create_threadsafe_function(
@@ -57,7 +58,7 @@ fn create_custom_gc(env: sys::napi_env) {
         1,
         ptr::null_mut(),
         Some(custom_gc_finalize),
-        ptr::null_mut(),
+        context,
         Some(custom_gc),
         &mut custom_gc_tsfn,
       )
@@ -80,8 +81,9 @@ unsafe extern "C" fn empty(
 unsafe extern "C" fn custom_gc_finalize(
   _env: sys::napi_env,
   _finalize_data: *mut c_void,
-  _finalize_hint: *mut c_void,
+  finalize_hint: *mut c_void,
 ) {
+  let _ = Box::from_raw(finalize_hint as *mut i32);
 }
 
 extern "C" fn custom_gc(
Repository: facebook/react
Pull request: Flow upgrade to 0.145

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #25410
* __->__ #25409
* #25408

Fixed a RN library definition that defined `CustomEvent` as a reference to itself.

Changed files:
filename: package.json
patch: @@ -63,7 +63,7 @@
     "eslint-plugin-react-internal": "link:./scripts/eslint-rules",
     "fbjs-scripts": "1.2.0",
     "filesize": "^6.0.1",
-    "flow-bin": "^0.143.0",
+    "flow-bin": "^0.145.0",
     "glob": "^7.1.6",
     "glob-stream": "^6.1.0",
     "google-closure-compiler": "^20200517.0.0",

filename: packages/react-native-renderer/src/ReactNativeGetListeners.js
patch: @@ -122,9 +122,6 @@ export default function getListeners(
           detail: syntheticEvent.nativeEvent,
         });
         eventInst.isTrusted = true;
-        // setSyntheticEvent is present on the React Native Event shim.
-        // It is used to forward method calls on Event to the underlying SyntheticEvent.
-        // $FlowFixMe
         eventInst.setSyntheticEvent(syntheticEvent);
 
         listenerObj.listener(eventInst, ...args);

filename: scripts/flow/config/flowconfig
patch: @@ -50,4 +50,4 @@ munge_underscores=false
 %REACT_RENDERER_FLOW_OPTIONS%
 
 [version]
-^0.143.0
+^0.145.0

filename: scripts/flow/react-native-host-hooks.js
patch: @@ -143,7 +143,18 @@ declare module 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface'
     emit: (channel: string, event: RawEventEmitterEvent) => string,
     ...
   };
-  declare export var CustomEvent: CustomEvent;
+  declare export class CustomEvent {
+    isTrusted: boolean;
+
+    constructor(
+      name: string,
+      {
+        detail: any,
+      },
+    ): void;
+
+    setSyntheticEvent(event: any): void;
+  }
 }
 
 declare module 'react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore' {

filename: yarn.lock
patch: @@ -7911,10 +7911,10 @@ flatted@^2.0.0:
   resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
   integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
 
-flow-bin@^0.143.0:
-  version "0.143.1"
-  resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.143.1.tgz#2ff825dfd85e84531b0ae780842cb1c2a9743cd2"
-  integrity sha512-6S6bgZ/pghBzEUELXkwFH/bsHT+GBMo8ftHDYs0SSJ+1e6NRdFfqxcYhaTvAK8zteSfQLZBIoec6G4WPPp4qQg==
+flow-bin@^0.145.0:
+  version "0.145.0"
+  resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.145.0.tgz#922f7c3568caaa5eb64621ec536deb56b24d1795"
+  integrity sha512-+9fi9BMxRBtSWC1x0hWggWTb8Vih+AC7wyvLAX5wR1m6u2lF2HLtixXqy2GX8bWgaynSEJR5lmPxYYC4wMI8cA==
 
 fluent-syntax@0.13.0:
   version "0.13.0"