helloadhavan/github_issues huggingface dataset:
Repository: nodejs/node
Pull request: build: avoid compiling with VS v17.12

Visual Studio v17.12 has a bug that produces a compilation error. Since ClangCL is now supported as a compiler for Node.js on Windows, and Clang 18.1.8, provided with VS 17.12, works fine, Only MSVC is disabled.

cc @nodejs/platform-windows @nodejs/build @huseyinacacak-janea 

Refs: https://github.com/nodejs/build/issues/3963
Refs: https://github.com/nodejs/node/pull/53863

Changed files:
filename: vcbuild.bat
patch: @@ -292,10 +292,19 @@ goto exit
 @rem Visual Studio v17.10 has a bug that causes the build to fail.
 @rem Check if the version is v17.10 and exit if it is.
 echo %VSCMD_VER% | findstr /b /c:"17.10" >nul
-if %errorlevel% neq 1  (
+if %errorlevel% neq 1 (
   echo Node.js doesn't compile with Visual Studio 17.10 Please use a different version.
   goto exit
 )
+@rem Same applies to v17.12 for MSVC.
+echo %VSCMD_VER% | findstr /b /c:"17.12" >nul
+if %errorlevel% neq 1 (
+  @rem Clang 18.1.8 Provided with VS 17.12 works fine.
+  if not defined clang_cl (
+    echo Node.js doesn't compile with Visual Studio 17.12 Please use a different version.
+    goto exit
+  )
+)
 
 @rem check if the clang-cl build is requested
 if not defined clang_cl goto clang-skip
Repository: electron/electron
Pull request: fix: restore Chromium default `Content-Disposition` header parsing

Backport of #43611

See that PR for details.


Notes: Restored Chromium default `Content-Disposition` header parsing.

Changed files:
filename: shell/browser/api/electron_api_web_request.cc
patch: @@ -19,7 +19,6 @@
 #include "gin/converter.h"
 #include "gin/dictionary.h"
 #include "gin/object_template_builder.h"
-#include "net/http/http_content_disposition.h"
 #include "shell/browser/api/electron_api_session.h"
 #include "shell/browser/api/electron_api_web_contents.h"
 #include "shell/browser/api/electron_api_web_frame_main.h"
@@ -98,22 +97,6 @@ v8::Local<v8::Value> HttpResponseHeadersToV8(
     std::string key;
     std::string value;
     while (headers->EnumerateHeaderLines(&iter, &key, &value)) {
-      // Note that Web servers not developed with nodejs allow non-utf8
-      // characters in content-disposition's filename field. Use Chromium's
-      // HttpContentDisposition class to decode the correct encoding instead of
-      // arbitrarily converting it to UTF8. It should also be noted that if the
-      // encoding is not specified, HttpContentDisposition will transcode
-      // according to the system's encoding.
-      if (base::EqualsCaseInsensitiveASCII("Content-Disposition", key) &&
-          !value.empty()) {
-        net::HttpContentDisposition header(value, std::string());
-        std::string decodedFilename =
-            header.is_attachment() ? " attachment" : " inline";
-        // The filename must be encased in double quotes for serialization
-        // to happen correctly.
-        std::string filename = "\"" + header.filename() + "\"";
-        value = decodedFilename + "; filename=" + filename;
-      }
       response_headers.EnsureList(key)->Append(value);
     }
   }

filename: spec/api-web-request-spec.ts
patch: @@ -474,7 +474,7 @@ describe('webRequest module', () => {
 
     it('does not change content-disposition header by default', async () => {
       ses.webRequest.onHeadersReceived((details, callback) => {
-        expect(details.responseHeaders!['content-disposition']).to.deep.equal([' attachment; filename="aa中aa.txt"']);
+        expect(details.responseHeaders!['content-disposition']).to.deep.equal(['attachment; filename=aa中aa.txt']);
         callback({});
       });
       const { data, headers } = await ajax(defaultURL + 'contentDisposition');
Repository: ggml-org/llama.cpp
Pull request: tools : fix invalid free()

Added a constructor to server_context that initializes server_context::batch, preventing the destructor's call to llama_batch_free() from causing an invalid free().

Ran into this when bind() failed.

<img width="397" alt="llamacpp1" src="https://github.com/user-attachments/assets/036a0353-aadb-40df-9938-175183268c75" />
<img width="421" alt="llamacpp2" src="https://github.com/user-attachments/assets/019e8192-4785-47ca-befe-5636892966ff" />


Changed files:
filename: tools/server/server.cpp
patch: @@ -1862,7 +1862,7 @@ struct server_context {
 
     llama_context_params cparams_dft;
 
-    llama_batch batch;
+    llama_batch batch {};
 
     bool clean_kv_cache = true;
     bool add_bos_token  = true;
Repository: facebook/react
Pull request: Better handle undefined Error stacks in DevTools error boundary

Resolves #23373

Changed files:
filename: packages/react-devtools-shared/src/devtools/views/ErrorBoundary/ErrorBoundary.js
patch: @@ -49,16 +49,16 @@ export default class ErrorBoundary extends Component<Props, State> {
     const errorMessage =
       typeof error === 'object' &&
       error !== null &&
-      error.hasOwnProperty('message')
+      typeof error.message === 'string'
         ? error.message
-        : String(error);
+        : null;
 
     const isTimeout = error instanceof TimeoutError;
 
     const callStack =
       typeof error === 'object' &&
       error !== null &&
-      error.hasOwnProperty('stack')
+      typeof error.stack === 'string'
         ? error.stack
             .split('\n')
             .slice(1)
Repository: huggingface/transformers
Pull request: enable 6 gemma2 cases on XPU

**2 pass**
PASSED tests/models/gemma2/test_modeling_gemma2.py::Gemma2IntegrationTest::test_export_static_cache
PASSED tests/models/gemma2/test_modeling_gemma2.py::Gemma2IntegrationTest::test_generation_beyond_sliding_window_3_eager

**1 should skip: XPU doesn't support flash-attention-2 package as of now**
SKIPPPED tests/models/gemma2/test_modeling_gemma2.py::Gemma2IntegrationTest::test_generation_beyond_sliding_window_0_flash_attention_2   

**2 flex_attention failed, already in development plan**
FAILED tests/models/gemma2/test_modeling_gemma2.py::Gemma2IntegrationTest::test_generation_beyond_sliding_window_2_flex_attention
FAILED tests/models/gemma2/test_modeling_gemma2.py::Gemma2IntegrationTest::test_model_2b_pipeline_bf16_flex_attention

**1 repetition output when out seq is long, under debug, will submit separate PR if needed**
tests/models/gemma2/test_modeling_gemma2.py::Gemma2IntegrationTest::test_generation_beyond_sliding_window_1_sdpa


Changed files:
filename: tests/models/gemma2/test_modeling_gemma2.py
patch: @@ -26,6 +26,7 @@
     require_flash_attn,
     require_read_token,
     require_torch,
+    require_torch_accelerator,
     require_torch_gpu,
     slow,
     tooslow,
@@ -155,7 +156,7 @@ def test_multi_gpu_data_parallel_forward(self):
 
 
 @slow
-@require_torch_gpu
+@require_torch_accelerator
 class Gemma2IntegrationTest(unittest.TestCase):
     input_text = ["Hello I am doing", "Hi today"]
     # This variable is used to determine which CUDA device are we using for our runners (A10 or T4)
@@ -360,6 +361,10 @@ def test_generation_beyond_sliding_window(self, attn_implementation: str):
         we need to correctly slice the attention mask in all cases (because we use a HybridCache).
         Outputs for every attention functions should be coherent and identical.
         """
+
+        if torch_device == "xpu" and attn_implementation == "flash_attention_2":
+            self.skipTest(reason="Intel XPU doesn't support falsh_attention_2 as of now.")
+
         model_id = "google/gemma-2-2b"
         EXPECTED_COMPLETIONS = [
             " the people, the food, the culture, the history, the music, the art, the architecture",
Repository: nodejs/node
Pull request: Revert "build: avoid compiling with VS v17.12"

This reverts commit 542f252d3672f586db07112fe2d844a5d1417e3a.

---

VS 17.12.2 and 17.12.3 work therefore no longer needed to stop build for 17.12.

fyi @nodejs/platform-windows @nodejs/build @StefanStojanovic 

Refs: https://github.com/nodejs/build/issues/3963
Refs: https://github.com/nodejs/node/pull/55930

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: vcbuild.bat
patch: @@ -292,19 +292,10 @@ goto exit
 @rem Visual Studio v17.10 has a bug that causes the build to fail.
 @rem Check if the version is v17.10 and exit if it is.
 echo %VSCMD_VER% | findstr /b /c:"17.10" >nul
-if %errorlevel% neq 1 (
+if %errorlevel% neq 1  (
   echo Node.js doesn't compile with Visual Studio 17.10 Please use a different version.
   goto exit
 )
-@rem Same applies to v17.12 for MSVC.
-echo %VSCMD_VER% | findstr /b /c:"17.12" >nul
-if %errorlevel% neq 1 (
-  @rem Clang 18.1.8 Provided with VS 17.12 works fine.
-  if not defined clang_cl (
-    echo Node.js doesn't compile with Visual Studio 17.12 Please use a different version.
-    goto exit
-  )
-)
 
 @rem check if the clang-cl build is requested
 if not defined clang_cl goto clang-skip
Repository: electron/electron
Pull request: fix: restore Chromium default `Content-Disposition` header parsing

#### Description of Change
Fixes #41939

#### Checklist
- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
- [ ] relevant documentation, tutorials, templates and examples are changed or added
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes
Notes: Restored Chromium default `Content-Disposition` header parsing.

Changed files:
filename: shell/browser/api/electron_api_web_request.cc
patch: @@ -21,7 +21,6 @@
 #include "gin/dictionary.h"
 #include "gin/handle.h"
 #include "gin/object_template_builder.h"
-#include "net/http/http_content_disposition.h"
 #include "shell/browser/api/electron_api_session.h"
 #include "shell/browser/api/electron_api_web_contents.h"
 #include "shell/browser/api/electron_api_web_frame_main.h"
@@ -100,22 +99,6 @@ v8::Local<v8::Value> HttpResponseHeadersToV8(
     std::string key;
     std::string value;
     while (headers->EnumerateHeaderLines(&iter, &key, &value)) {
-      // Note that Web servers not developed with nodejs allow non-utf8
-      // characters in content-disposition's filename field. Use Chromium's
-      // HttpContentDisposition class to decode the correct encoding instead of
-      // arbitrarily converting it to UTF8. It should also be noted that if the
-      // encoding is not specified, HttpContentDisposition will transcode
-      // according to the system's encoding.
-      if (base::EqualsCaseInsensitiveASCII("Content-Disposition", key) &&
-          !value.empty()) {
-        net::HttpContentDisposition header(value, std::string());
-        std::string decodedFilename =
-            header.is_attachment() ? " attachment" : " inline";
-        // The filename must be encased in double quotes for serialization
-        // to happen correctly.
-        std::string filename = "\"" + header.filename() + "\"";
-        value = decodedFilename + "; filename=" + filename;
-      }
       response_headers.EnsureList(key)->Append(value);
     }
   }

filename: spec/api-web-request-spec.ts
patch: @@ -474,7 +474,7 @@ describe('webRequest module', () => {
 
     it('does not change content-disposition header by default', async () => {
       ses.webRequest.onHeadersReceived((details, callback) => {
-        expect(details.responseHeaders!['content-disposition']).to.deep.equal([' attachment; filename="aa中aa.txt"']);
+        expect(details.responseHeaders!['content-disposition']).to.deep.equal(['attachment; filename=aa中aa.txt']);
         callback({});
       });
       const { data, headers } = await ajax(defaultURL + 'contentDisposition');
Repository: ggml-org/llama.cpp
Pull request: scripts : exit compare-llama-bench.py gracefully when there's nothing to compare

I stumbled upon this accidentally while testing JSONL (coming soon). I had used two different paths to the same model in consequent tests, causing `get_rows` not to be able to join the two results.

Changed files:
filename: scripts/compare-llama-bench.py
patch: @@ -318,7 +318,7 @@ def get_rows(properties):
 
     show = []
     # Show CPU and/or GPU by default even if the hardware for all results is the same:
-    if "n_gpu_layers" not in properties_different:
+    if rows_full and "n_gpu_layers" not in properties_different:
         ngl = int(rows_full[0][KEY_PROPERTIES.index("n_gpu_layers")])
 
         if ngl != 99 and "cpu_info" not in properties_different:
@@ -338,6 +338,10 @@ def get_rows(properties):
             pass
     rows_show = get_rows(show)
 
+if not rows_show:
+    logger.error(f"No comparable data was found between {name_baseline} and {name_compare}.\n")
+    sys.exit(1)
+
 table = []
 for row in rows_show:
     n_prompt = int(row[-5])
Repository: denoland/deno
Pull request: fix(node/inspector): Session constructor should not throw

There is no constructor code when creating an inspector `Session` instance in Node. Also get rid of some symbols which should've been private properties. This PR doesn't yet add any new implementations though as these are mostly cosmetic changes.

Changed files:
filename: ext/node/polyfills/inspector.ts
patch: @@ -1,26 +1,18 @@
 // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
 // Copyright Joyent and Node contributors. All rights reserved. MIT license.
 
-// TODO(petamoriken): enable prefer-primordials for node polyfills
-// deno-lint-ignore-file prefer-primordials
-
 import { EventEmitter } from "node:events";
 import { notImplemented } from "ext:deno_node/_utils.ts";
+import { primordials } from "ext:core/mod.js";
 
-const connectionSymbol = Symbol("connectionProperty");
-const messageCallbacksSymbol = Symbol("messageCallbacks");
-const nextIdSymbol = Symbol("nextId");
-const onMessageSymbol = Symbol("onMessage");
+const {
+  SafeMap,
+} = primordials;
 
 class Session extends EventEmitter {
-  [connectionSymbol]: null;
-  [nextIdSymbol]: number;
-  [messageCallbacksSymbol]: Map<string, (e: Error) => void>;
-
-  constructor() {
-    super();
-    notImplemented("inspector.Session.prototype.constructor");
-  }
+  #connection = null;
+  #nextId = 1;
+  #messageCallbacks = new SafeMap();
 
   /** Connects the session to the inspector back-end. */
   connect() {
@@ -33,10 +25,6 @@ class Session extends EventEmitter {
     notImplemented("inspector.Session.prototype.connectToMainThread");
   }
 
-  [onMessageSymbol](_message: string) {
-    notImplemented("inspector.Session.prototype[Symbol('onMessage')]");
-  }
-
   /** Posts a message to the inspector back-end. */
   post(
     _method: string,

filename: tests/unit_node/inspector_test.ts
patch: @@ -1,7 +1,11 @@
 // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import inspector from "node:inspector";
+import inspector, { Session } from "node:inspector";
 import { assertEquals } from "@std/assert/equals";
 
 Deno.test("[node/inspector] - importing inspector works", () => {
   assertEquals(typeof inspector.open, "function");
 });
+
+Deno.test("[node/inspector] - Session constructor should not throw", () => {
+  new Session();
+});
Repository: vercel/next.js
Pull request: Turbopack: fix unused import on mac

### What?

Fix an unused import on non-linux platforms

Closes PACK-4457

Changed files:
filename: turbopack/crates/turbo-tasks-fs/src/watcher.rs
patch: @@ -9,7 +9,7 @@ use std::{
     time::Duration,
 };
 
-use anyhow::{Context, Result};
+use anyhow::Result;
 use notify::{
     event::{MetadataKind, ModifyKind, RenameMode},
     Config, EventKind, PollWatcher, RecommendedWatcher, RecursiveMode, Watcher,
@@ -112,6 +112,7 @@ impl DiskWatcher {
         dir_path: &Path,
         root_path: &Path,
     ) -> Result<()> {
+        use anyhow::Context;
         // HACK: Rewrite NotFound io errors to PathNotFound
         // This shouldn't ever happen (notify should transform this for us), but even after
         // https://github.com/notify-rs/notify/pull/611, it seems like there's still some case where
Repository: denoland/deno
Pull request: fix(cli): support --watch when running cjs npm packages

Fixes #20549


Changed files:
filename: cli/args/mod.rs
patch: @@ -1151,8 +1151,6 @@ impl CliOptions {
               resolve_url_or_path("./$deno$stdin.ts", &cwd)
                 .map_err(AnyError::from)
             })?
-        } else if run_flags.watch.is_some() {
-          resolve_url_or_path(&run_flags.script, self.initial_cwd())?
         } else if NpmPackageReqReference::from_str(&run_flags.script).is_ok() {
           ModuleSpecifier::parse(&run_flags.script)?
         } else {

filename: cli/worker.rs
patch: @@ -280,7 +280,22 @@ impl CliMainWorker {
       /// Execute the given main module emitting load and unload events before and after execution
       /// respectively.
       pub async fn execute(&mut self) -> Result<(), AnyError> {
-        self.inner.execute_main_module_possibly_with_npm().await?;
+        if self.inner.is_main_cjs {
+          deno_node::load_cjs_module(
+            &mut self.inner.worker.js_runtime,
+            &self
+              .inner
+              .main_module
+              .to_file_path()
+              .unwrap()
+              .to_string_lossy(),
+            true,
+            self.inner.shared.options.inspect_brk,
+          )?;
+        } else {
+          self.inner.execute_main_module_possibly_with_npm().await?;
+        }
+
         self.inner.worker.dispatch_load_event()?;
         self.pending_unload = true;
 

filename: tests/integration/watcher_tests.rs
patch: @@ -3,6 +3,7 @@
 use flaky_test::flaky_test;
 use test_util as util;
 use test_util::assert_contains;
+use test_util::env_vars_for_npm_tests;
 use test_util::TempDir;
 use tokio::io::AsyncBufReadExt;
 use util::DenoChild;
@@ -707,6 +708,42 @@ async fn run_watch_no_dynamic() {
   check_alive_then_kill(child);
 }
 
+#[flaky_test(tokio)]
+async fn run_watch_npm_specifier() {
+  let _g = util::http_server();
+  let t = TempDir::new();
+
+  let file_to_watch = t.path().join("file_to_watch.txt");
+  file_to_watch.write("Hello world");
+
+  let mut child = util::deno_cmd()
+    .current_dir(t.path())
+    .envs(env_vars_for_npm_tests())
+    .arg("run")
+    .arg("--watch=file_to_watch.txt")
+    .arg("-L")
+    .arg("debug")
+    .arg("npm:@denotest/bin/cli-cjs")
+    .arg("Hello world")
+    .env("NO_COLOR", "1")
+    .piped_output()
+    .spawn()
+    .unwrap();
+  let (mut stdout_lines, mut stderr_lines) = child_lines(&mut child);
+
+  wait_contains("Hello world", &mut stdout_lines).await;
+  wait_for_watcher("file_to_watch.txt", &mut stderr_lines).await;
+
+  // Change content of the file
+  file_to_watch.write("Hello world2");
+
+  wait_contains("Restarting", &mut stderr_lines).await;
+  wait_contains("Hello world", &mut stdout_lines).await;
+  wait_for_watcher("file_to_watch.txt", &mut stderr_lines).await;
+
+  check_alive_then_kill(child);
+}
+
 // TODO(bartlomieju): this test became flaky on macOS runner; it is unclear
 // if that's because of a bug in code or the runner itself. We should reenable
 // it once we upgrade to XL runners for macOS.
Repository: nodejs/node
Pull request: Document `Buffer.concat` zero-fill behavior

`Buffer.concat` will zero-fill the tail of the destination buffer. This behavior is specified in `test/parallel/test-buffer-concat.js` but it is not yet documented in `doc/api/buffer.md`. This pull request updates the docs.

The zero-fill behavior is already implemented here.
https://github.com/duncpro/node/blob/6e59723fbf380950fa901fd33326a00346ead607/lib/buffer.js#L607-L616

There is already a test for it here.
https://github.com/duncpro/node/blob/6e59723fbf380950fa901fd33326a00346ead607/test/parallel/test-buffer-concat.js#L91-L93

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: doc/api/buffer.md
patch: @@ -1042,7 +1042,8 @@ in `list` by adding their lengths.
 
 If `totalLength` is provided, it is coerced to an unsigned integer. If the
 combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
-truncated to `totalLength`.
+truncated to `totalLength`. If the combined length of the `Buffer`s in `list` is
+less than `totalLength`, the remaining space is filled with zeros.
 
 ```mjs
 import { Buffer } from 'node:buffer';