helloadhavan/github_issues huggingface dataset:
Repository: nodejs/node
Pull request: fs: only show deprecation warning when error code matches

The deprecation is only for invalid types, it could be confusing the warning show up for an unrelated error.

Refs: https://github.com/nodejs/node/pull/55753
<!--
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: lib/fs.js
patch: @@ -278,8 +278,8 @@ let showExistsDeprecation = true;
 function existsSync(path) {
   try {
     path = getValidatedPath(path);
-  } catch {
-    if (showExistsDeprecation) {
+  } catch (err) {
+    if (showExistsDeprecation && err?.code === 'ERR_INVALID_ARG_TYPE') {
       process.emitWarning(
         'Passing invalid argument types to fs.existsSync is deprecated', 'DeprecationWarning', 'DEP0187',
       );
Repository: nodejs/node
Pull request: test: swap assert.strictEqual() parameters

The `actual` and the `expected` parameters are respectively the first and the second.

<!--
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: test/parallel/test-buffer-bigint64.js
patch: @@ -9,23 +9,23 @@ const buf = Buffer.allocUnsafe(9);
   let val = 123456789n;
   buf[`writeBigInt64${endianness}`](val, 0);
   let rtn = buf[`readBigInt64${endianness}`](0);
-  assert.strictEqual(val, rtn);
+  assert.strictEqual(rtn, val);
 
   // Should allow INT64_MAX to be written and read
   val = 0x7fffffffffffffffn;
   buf[`writeBigInt64${endianness}`](val, 0);
   rtn = buf[`readBigInt64${endianness}`](0);
-  assert.strictEqual(val, rtn);
+  assert.strictEqual(rtn, val);
 
   // Should read and write a negative signed 64-bit integer
   val = -123456789n;
   buf[`writeBigInt64${endianness}`](val, 0);
-  assert.strictEqual(val, buf[`readBigInt64${endianness}`](0));
+  assert.strictEqual(buf[`readBigInt64${endianness}`](0), val);
 
   // Should read and write an unsigned 64-bit integer
   val = 123456789n;
   buf[`writeBigUInt64${endianness}`](val, 0);
-  assert.strictEqual(val, buf[`readBigUInt64${endianness}`](0));
+  assert.strictEqual(buf[`readBigUInt64${endianness}`](0), val);
 
   assert.strictEqual(buf[`writeBigUInt64${endianness}`](val, 0), 8);
   assert.strictEqual(buf[`writeBigInt64${endianness}`](val, 0), 8);
Repository: vercel/next.js
Pull request: Use relative sources in `require()` instead of `next/dist/` if possible

Makes it easier to get types for those previously untyped `require` calls.

Changed files:
filename: packages/next/src/build/webpack/loaders/lightningcss-loader/src/loader.ts
patch: @@ -305,7 +305,8 @@ export async function LightningCssLoader(
       ),
     })
   }
-  const { loadBindings } = require('next/dist/build/swc')
+  const { loadBindings } =
+    require('../../../../../build/swc') as typeof import('../../../../../build/swc')
 
   const transform =
     implementation?.transformCss ??

filename: packages/next/src/build/webpack/loaders/lightningcss-loader/src/minify.ts
patch: @@ -66,7 +66,8 @@ export class LightningCssMinifyPlugin {
     } = compilation.compiler
 
     if (!this.transform) {
-      const { loadBindings } = require('next/dist/build/swc')
+      const { loadBindings } =
+        require('../../../../../build/swc') as typeof import('../../../../../build/swc')
       this.transform = (await loadBindings()).css.lightning.transform
     }
 

filename: packages/next/src/server/config.ts
patch: @@ -1370,7 +1370,8 @@ export default async function loadConfig(
     }
 
     if (userConfig.experimental?.useLightningcss) {
-      const { loadBindings } = require('next/dist/build/swc')
+      const { loadBindings } =
+        require('../build/swc') as typeof import('../build/swc')
       const isLightningSupported = (await loadBindings())?.css?.lightning
 
       if (!isLightningSupported) {
Repository: ggml-org/llama.cpp
Pull request: convert : only check for tokenizer folder if we need it

This should fix the issues with `chkhsh` removals on dowmload failures.

Changed files:
filename: convert_hf_to_gguf_update.py
patch: @@ -240,11 +240,6 @@ def get_existing_models(convert_py):
     if tokt == TOKENIZER_TYPE.SPM or tokt == TOKENIZER_TYPE.UGM:
         continue
 
-    # Skip if the tokenizer folder does not exist or there are other download issues previously
-    if not os.path.exists(f"models/tokenizers/{name}"):
-        logger.warning(f"Directory for tokenizer {name} not found. Skipping...")
-        continue
-
     # create the tokenizer
     if chkhsh is not None:
         # if the model has a pre-computed hash, use it
@@ -254,6 +249,12 @@ def get_existing_models(convert_py):
         chkhsh = existing_models[name]
     else:
         # otherwise, compute the hash of the tokenizer
+
+        # Skip if the tokenizer folder does not exist or there are other download issues previously
+        if not os.path.exists(f"models/tokenizers/{name}"):
+            logger.warning(f"Directory for tokenizer {name} not found. Skipping...")
+            continue
+
         try:
             logger.info(f"Loading tokenizer from {f'models/tokenizers/{name}'}...")
             if name == "t5":
Repository: huggingface/transformers
Pull request: Fix hqq issue

# What does this PR do?

This PR fixes an issue that appeared in the latest release of hqq. As linear_layer=None, we should set del_orig=False. Otherwise, it will consider that linear_layer is actually a layer, triggering an error. 

PR in question https://github.com/mobiusml/hqq/commit/a566c78961ea408c747ad2a9bd4f3a9235ff3b70

Changed files:
filename: src/transformers/quantizers/quantizer_hqq.py
patch: @@ -135,7 +135,11 @@ def _find_hqq_quantizable_layers(model, layers):
 
             # Append new expected layers based on _ref_keys
             _ref_keys = HQQLinear(
-                linear_layer=None, quant_config=None, compute_dtype=torch.float16, device="cpu"
+                linear_layer=None,
+                quant_config=None,
+                compute_dtype=torch.float16,
+                device="cpu",
+                del_orig=False,
             ).state_dict_keys() - {"bias"}
 
             # Clean-up
@@ -224,6 +228,7 @@ def create_quantized_param(
                     quant_config=None,
                     compute_dtype=self.torch_dtype,
                     device=target_device,
+                    del_orig=False,
                 )
 
             hqq_layer.load_state_dict(module_state_dict)
Repository: nodejs/node
Pull request: test: assert write return values in buffer-bigint64

https://nodejs.org/api/buffer.html#bufwritebigint64bevalue-offset

> Returns: [<integer>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) `offset` plus the number of bytes written.

add more cases that assert this

discovered by https://github.com/oven-sh/bun/issues/17694

Changed files:
filename: test/parallel/test-buffer-bigint64.js
patch: @@ -2,7 +2,7 @@
 require('../common');
 const assert = require('assert');
 
-const buf = Buffer.allocUnsafe(8);
+const buf = Buffer.allocUnsafe(9);
 
 ['LE', 'BE'].forEach(function(endianness) {
   // Should allow simple BigInts to be written and read
@@ -27,6 +27,11 @@ const buf = Buffer.allocUnsafe(8);
   buf[`writeBigUInt64${endianness}`](val, 0);
   assert.strictEqual(val, buf[`readBigUInt64${endianness}`](0));
 
+  assert.strictEqual(buf[`writeBigUInt64${endianness}`](val, 0), 8);
+  assert.strictEqual(buf[`writeBigInt64${endianness}`](val, 0), 8);
+  assert.strictEqual(buf[`writeBigUInt64${endianness}`](val, 1), 9);
+  assert.strictEqual(buf[`writeBigInt64${endianness}`](val, 1), 9);
+
   // Should throw a RangeError upon INT64_MAX+1 being written
   assert.throws(function() {
     const val = 0x8000000000000000n;
Repository: nodejs/node
Pull request: doc: `modules.md`: fix `distance` definition

It's somewhat esoteric at best to define distance in terms of squared length!

Changed files:
filename: doc/api/modules.md
patch: @@ -217,7 +217,7 @@ With the following ES Modules:
 
 ```mjs
 // distance.mjs
-export function distance(a, b) { return (b.x - a.x) ** 2 + (b.y - a.y) ** 2; }
+export function distance(a, b) { return Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2); }
 ```
 
 ```mjs
@@ -269,7 +269,7 @@ export default class Point {
 
 // `distance` is lost to CommonJS consumers of this module, unless it's
 // added to `Point` as a static property.
-export function distance(a, b) { return (b.x - a.x) ** 2 + (b.y - a.y) ** 2; }
+export function distance(a, b) { return Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2); }
 export { Point as 'module.exports' }
 ```
 
@@ -293,7 +293,7 @@ named exports attached to it as properties. For example with the example above,
 <!-- eslint-disable @stylistic/js/semi -->
 
 ```mjs
-export function distance(a, b) { return (b.x - a.x) ** 2 + (b.y - a.y) ** 2; }
+export function distance(a, b) { return Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2); }
 
 export default class Point {
   constructor(x, y) { this.x = x; this.y = y; }
Repository: ggml-org/llama.cpp
Pull request: llama: add LLAMA_API to deprecated llama_kv_self_seq_div

Add LLAMA_API to fix the run-time error with llama-cpp-python in Windows env: 
attributeError: function 'llama_kv_self_seq_div' not found. Did you mean: 'llama_kv_self_seq_add'?

Although llama_kv_self_seq_div() has been marked deprecated but it is necessary to export it to make llama-cpp-python happy.

Observed software version:
OS: windows
compiler: MSVC
llama-cpp-python: tag: v0.3.12-cu124
llama.cpp: tag: b5833

*Make sure to read the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md) before submitting a PR*


Changed files:
filename: include/llama.h
patch: @@ -725,7 +725,7 @@ extern "C" {
     //   - lazily on next llama_decode()
     // p0 < 0 : [0,  p1]
     // p1 < 0 : [p0, inf)
-    DEPRECATED(void llama_kv_self_seq_div(
+    DEPRECATED(LLAMA_API void llama_kv_self_seq_div(
             struct llama_context * ctx,
                     llama_seq_id   seq_id,
                        llama_pos   p0,
Repository: electron/electron
Pull request: build: remove unused lint package

Backport of #44525

See that PR for details.


Notes: none <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->


Changed files:
filename: package.json
patch: @@ -39,7 +39,6 @@
     "folder-hash": "^2.1.1",
     "got": "^11.8.5",
     "husky": "^8.0.1",
-    "lint": "^1.1.2",
     "lint-staged": "^10.2.11",
     "markdownlint-cli2": "^0.13.0",
     "minimist": "^1.2.8",

filename: yarn.lock
patch: @@ -4110,11 +4110,6 @@ lint-staged@^10.2.11:
     string-argv "0.3.1"
     stringify-object "^3.3.0"
 
-lint@^1.1.2:
-  version "1.1.2"
-  resolved "https://registry.yarnpkg.com/lint/-/lint-1.1.2.tgz#35ed064f322547c331358d899868664968ba371f"
-  integrity sha1-Ne0GTzIlR8MxNY2JmGhmSWi6Nx8=
-
 listr2@^2.1.0:
   version "2.2.0"
   resolved "https://registry.yarnpkg.com/listr2/-/listr2-2.2.0.tgz#cb88631258abc578c7fb64e590fe5742f28e4aac"
Repository: vercel/next.js
Pull request: [dev-tools] add restart dev server button on dev-tools indicator preferences

Add options from https://github.com/vercel/next.js/pull/80060 to the preferences tab as well for DX.

**Restart Dev Server**

https://github.com/user-attachments/assets/689441b4-46aa-418a-80e4-66ce495695cb

**Reset Bundler Cache**

https://github.com/user-attachments/assets/911224c6-b923-48ac-844d-52132b05ef3f

Closes NEXT-4478

Changed files:
filename: packages/next/src/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/dev-tools-info/user-preferences.tsx
patch: @@ -66,6 +66,21 @@ export function UserPreferences({
     setScale(value)
   }
 
+  function handleRestartDevServer() {
+    let endpoint = '/__nextjs_restart_dev'
+
+    if (process.env.__NEXT_TURBOPACK_PERSISTENT_CACHE) {
+      endpoint = '/__nextjs_restart_dev?invalidatePersistentCache'
+    }
+
+    fetch(endpoint, {
+      method: 'POST',
+    }).then(() => {
+      // TODO: poll server status and reload when the server is back up.
+      // https://github.com/vercel/next.js/pull/80005
+    })
+  }
+
   return (
     <DevToolsInfo title="Preferences" {...props}>
       <div className="preferences-container">
@@ -165,6 +180,52 @@ export function UserPreferences({
           </div>
         </div>
       </div>
+      <h1 className="dev-tools-info-title">Development Server</h1>
+      <div className="preferences-container">
+        <div className="preference-section">
+          <div className="preference-header">
+            <label id="restart-dev-server">Restart Dev Server</label>
+            <p className="preference-description">
+              Restart the dev server to rebuild your application.
+            </p>
+          </div>
+          <div className="preference-control">
+            <button
+              aria-describedby="restart-dev-server"
+              name="restart-dev-server"
+              data-restart-dev-server
+              className="action-button"
+              onClick={handleRestartDevServer}
+            >
+              <span>Restart</span>
+            </button>
+          </div>
+        </div>
+      </div>
+      {process.env.__NEXT_TURBOPACK_PERSISTENT_CACHE ? (
+        <div className="preferences-container">
+          <div className="preference-section">
+            <div className="preference-header">
+              <label id="reset-bundler-cache">Reset Bundler Cache</label>
+              <p className="preference-description">
+                Reset the bundler cache to rebuild your application without
+                cache.
+              </p>
+            </div>
+            <div className="preference-control">
+              <button
+                aria-describedby="reset-bundler-cache"
+                name="reset-bundler-cache"
+                data-reset-bundler-cache
+                className="action-button"
+                onClick={handleRestartDevServer}
+              >
+                <span>Reset Cache</span>
+              </button>
+            </div>
+          </div>
+        </div>
+      ) : null}
     </DevToolsInfo>
   )
 }
Repository: ggml-org/llama.cpp
Pull request: model : fix hunyuan moe chat template

Fix https://github.com/ggml-org/llama.cpp/issues/14415

Changed files:
filename: src/llama-chat.cpp
patch: @@ -680,9 +680,6 @@ int32_t llm_chat_apply_template(
                 ss << "
" << message->content << "
";
             }
         }
-        if (add_ass) {
-            ss << "
";
-        }
     } else {
         // template not supported
         return -1;
Repository: nodejs/node
Pull request: build,win: disable node pch with ccache

This is a continuation of the [previously landed PR](https://github.com/nodejs/node/pull/56847) disabling V8 pch when using ClangCL and ccache. The issue here is similar, only not visible in each build (as some V8 files are generated during the build phase).

I've disabled the ClangCL compilation in the CI until this lands as it can block valid PRs from landing. For more details check any failed build [here](https://ci.nodejs.org/job/node-compile-windows/nodes=win-vs2022_clang/). What you'll find there is that either embedtest.pch or libnode.pch is causing issue, and this change will resolve that.

cc @joyeecheung @nodejs/platform-windows 

P.S. I'd also like to use fast-tracking here so that I can reenable the ClangCL compilation in the CI ASAP.

Changed files:
filename: node.gypi
patch: @@ -69,12 +69,16 @@
         'NODE_PLATFORM="win32"',
         '_UNICODE=1',
       ],
-      'msvs_precompiled_header': 'tools/msvs/pch/node_pch.h',
-      'msvs_precompiled_source': 'tools/msvs/pch/node_pch.cc',
-      'sources': [
-        '<(_msvs_precompiled_header)',
-        '<(_msvs_precompiled_source)',
-      ],
+      'conditions': [
+          ['clang != 1 or use_ccache_win != 1', {
+            'msvs_precompiled_header': 'tools/msvs/pch/node_pch.h',
+            'msvs_precompiled_source': 'tools/msvs/pch/node_pch.cc',
+            'sources': [
+              '<(_msvs_precompiled_header)',
+              '<(_msvs_precompiled_source)',
+            ],
+          }]
+      ]
     }, { # POSIX
       'defines': [ '__POSIX__' ],
     }],
Repository: denoland/deno
Pull request: fix(node/crypto): support promisify on generateKeyPair

Calling `promisify(generateKeyPair)` didn't work as expected. It requires a custom promisify implementation.

This was easy to fix thanks to the excellent debugging investigation in https://github.com/denoland/deno/issues/26910

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

Changed files:
filename: ext/node/polyfills/internal/crypto/keygen.ts
patch: @@ -30,6 +30,7 @@ import {
 import { Buffer } from "node:buffer";
 import { KeyFormat, KeyType } from "ext:deno_node/internal/crypto/types.ts";
 import process from "node:process";
+import { promisify } from "node:util";
 
 import {
   op_node_generate_dh_group_key,
@@ -570,7 +571,15 @@ export function generateKeyPair(
     privateKey: any,
   ) => void,
 ) {
-  createJob(kAsync, type, options).then((pair) => {
+  _generateKeyPair(type, options)
+    .then(
+      (res) => callback(null, res.publicKey, res.privateKey),
+      (err) => callback(err, null, null),
+    );
+}
+
+function _generateKeyPair(type: string, options: unknown) {
+  return createJob(kAsync, type, options).then((pair) => {
     const privateKeyHandle = op_node_get_private_key_from_pair(pair);
     const publicKeyHandle = op_node_get_public_key_from_pair(pair);
 
@@ -589,12 +598,15 @@ export function generateKeyPair(
       }
     }
 
-    callback(null, publicKey, privateKey);
-  }).catch((err) => {
-    callback(err, null, null);
+    return { publicKey, privateKey };
   });
 }
 
+Object.defineProperty(generateKeyPair, promisify.custom, {
+  enumerable: false,
+  value: _generateKeyPair,
+});
+
 export interface KeyPairKeyObjectResult {
   publicKey: KeyObject;
   privateKey: KeyObject;

filename: tests/unit_node/crypto/crypto_key_test.ts
patch: @@ -677,3 +677,26 @@ Deno.test("generateKeyPair large pem", function () {
     },
   });
 });
+
+Deno.test("generateKeyPair promisify", async () => {
+  const passphrase = "mypassphrase";
+  const cipher = "aes-256-cbc";
+  const modulusLength = 4096;
+
+  const { privateKey, publicKey } = await promisify(generateKeyPair)("rsa", {
+    modulusLength,
+    publicKeyEncoding: {
+      type: "spki",
+      format: "pem",
+    },
+    privateKeyEncoding: {
+      type: "pkcs8",
+      format: "pem",
+      cipher,
+      passphrase,
+    },
+  });
+
+  assert(publicKey.startsWith("-----BEGIN PUBLIC KEY-----"));
+  assert(privateKey.startsWith("-----BEGIN PRIVATE KEY-----"));
+});
Repository: facebook/react
Pull request: [react-www] remove forked bundle

The `enableNewReconciler` was gone with 420f0b7fa1fcc609fc7b438c4599d0f76fab4bc0, this removes the bundle config.


Changed files:
filename: dangerfile.js
patch: @@ -46,7 +46,6 @@ const CRITICAL_ARTIFACT_PATHS = new Set([
   'oss-experimental/react-dom/cjs/react-dom.production.min.js',
   'facebook-www/ReactDOM-prod.classic.js',
   'facebook-www/ReactDOM-prod.modern.js',
-  'facebook-www/ReactDOMForked-prod.classic.js',
 ]);
 
 const kilobyteFormatter = new Intl.NumberFormat('en', {

filename: scripts/rollup/bundles.js
patch: @@ -163,17 +163,6 @@ const bundles = [
     externals: ['react'],
   },
 
-  /******* React DOM - www - Uses forked reconciler *******/
-  {
-    moduleType: RENDERER,
-    bundleTypes: [FB_WWW_DEV, FB_WWW_PROD, FB_WWW_PROFILING],
-    entry: 'react-dom',
-    global: 'ReactDOMForked',
-    minifyWithProdErrorCodes: true,
-    wrapWithModuleBoundaries: true,
-    externals: ['react'],
-  },
-
   /******* Test Utils *******/
   {
     moduleType: RENDERER_UTILS,