helloadhavan/github_issues huggingface dataset:
Repository: nodejs/node
Pull request: fs: cache ReadFileContext after lazy loading

Not sure why it's `require`d at every call, I think we can cache it after the lazy load

All tests pass on my end

Changed files:
filename: lib/fs.js
patch: @@ -164,6 +164,7 @@ let ReadStream;
 let WriteStream;
 let rimraf;
 let kResistStopPropagation;
+let ReadFileContext;
 
 // These have to be separate because of how graceful-fs happens to do it's
 // monkeypatching.
@@ -365,7 +366,7 @@ function readFile(path, options, callback) {
   callback ||= options;
   validateFunction(callback, 'cb');
   options = getOptions(options, { flag: 'r' });
-  const ReadFileContext = require('internal/fs/read/context');
+  ReadFileContext ??= require('internal/fs/read/context');
   const context = new ReadFileContext(callback, options.encoding);
   context.isUserFd = isFd(path); // File descriptor ownership
Repository: vercel/next.js
Pull request: Turbopack: Include Next.js version in panic handler report

This includes the Next.js version in the report url generated on panic.

Test Plan: Add a panic to `analyse_ecmacscript_module`, verified the discussion body it generates includes the version from the next package’s `package.json`.


Closes PACK-4388

Changed files:
filename: crates/napi/build.rs
patch: @@ -1,11 +1,32 @@
-use std::{env, process::Command, str};
+use std::{env, fs, path::Path, process::Command, str};
+
+use serde_json::Value;
 
 extern crate napi_build;
 
 fn main() -> anyhow::Result<()> {
     println!("cargo:rerun-if-env-changed=CI");
     let is_ci = env::var("CI").is_ok_and(|value| !value.is_empty());
 
+    let nextjs_version = {
+        let package_json_path = Path::new(env!("CARGO_MANIFEST_DIR"))
+            .join("../..")
+            .join("packages/next/package.json");
+
+        println!("cargo:rerun-if-changed={}", package_json_path.display());
+
+        let package_json_content = fs::read_to_string(&package_json_path)?;
+        let package_json: Value = serde_json::from_str(&package_json_content)?;
+
+        package_json["version"]
+            .as_str()
+            .expect("Expected a Next.js `version` string in its package.json")
+            .to_string()
+    };
+
+    // Make the Next.js version available as a build-time environment variable
+    println!("cargo:rustc-env=NEXTJS_VERSION={}", nextjs_version);
+
     // Generates, stores build-time information as static values.
     // There are some places relying on correct values for this (i.e telemetry),
     // So failing build if this fails.

filename: crates/napi/src/util.rs
patch: @@ -131,7 +131,11 @@ pub fn log_internal_error_and_inform(internal_error: &anyhow::Error) {
         "Turbopack Error: {}",
         internal_error_str.lines().next().unwrap_or("Unknown")
     );
-    let version_str = format!("Turbopack version: `{}`", env!("VERGEN_GIT_DESCRIBE"));
+    let version_str = format!(
+        "Turbopack version: `{}`\nNext.js version: `{}`",
+        env!("VERGEN_GIT_DESCRIBE"),
+        env!("NEXTJS_VERSION")
+    );
     let new_discussion_url = if supports_hyperlinks::supports_hyperlinks() {
         "clicking here.".hyperlink(
             format!(
Repository: electron/electron
Pull request: fix: Launch apps with XDG_ACTIVATION_TOKEN in ozone/wayland

Backport of #43480

See that PR for details.


Notes: Fixed other apps not being focused when launched from electron ozone/wayland


Changed files:
filename: shell/common/platform_util_linux.cc
patch: @@ -23,6 +23,7 @@
 #include "base/posix/eintr_wrapper.h"
 #include "base/process/kill.h"
 #include "base/process/launch.h"
+#include "base/run_loop.h"
 #include "base/strings/escape.h"
 #include "base/strings/string_util.h"
 #include "base/threading/thread_restrictions.h"
@@ -270,8 +271,21 @@ std::string GetErrorDescription(int error_code) {
 bool XDGUtil(const std::vector<std::string>& argv,
              const base::FilePath& working_directory,
              const bool wait_for_exit,
+             const bool focus_launched_process,
              platform_util::OpenCallback callback) {
   base::LaunchOptions options;
+  if (focus_launched_process) {
+    base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed);
+    base::RepeatingClosure quit_loop = run_loop.QuitClosure();
+    base::nix::CreateLaunchOptionsWithXdgActivation(base::BindOnce(
+        [](base::RepeatingClosure quit_loop, base::LaunchOptions* options_out,
+           base::LaunchOptions options) {
+          *options_out = std::move(options);
+          std::move(quit_loop).Run();
+        },
+        std::move(quit_loop), &options));
+    run_loop.Run();
+  }
   options.current_directory = working_directory;
   options.allow_new_privs = true;
   // xdg-open can fall back on mailcap which eventually might plumb through
@@ -303,11 +317,12 @@ bool XDGOpen(const base::FilePath& working_directory,
              const bool wait_for_exit,
              platform_util::OpenCallback callback) {
   return XDGUtil({"xdg-open", path}, working_directory, wait_for_exit,
-                 std::move(callback));
+                 /*focus_launched_process=*/true, std::move(callback));
 }
 
 bool XDGEmail(const std::string& email, const bool wait_for_exit) {
   return XDGUtil({"xdg-email", email}, base::FilePath(), wait_for_exit,
+                 /*focus_launched_process=*/true,
                  platform_util::OpenCallback());
 }
 
@@ -376,7 +391,8 @@ bool MoveItemToTrash(const base::FilePath& full_path, bool delete_on_fail) {
     argv = {"gio", "trash", filename};
   }
 
-  return XDGUtil(argv, base::FilePath(), true, platform_util::OpenCallback());
+  return XDGUtil(argv, base::FilePath(), true, /*focus_launched_process=*/false,
+                 platform_util::OpenCallback());
 }
 
 namespace internal {
Repository: facebook/react
Pull request: Don't override use-sync-external-store peerDeps

Usually the build script updates transitive React dependencies so that they refer to the corresponding release version.

For use-sync-external-store, though, we also want to support older versions of React, too. So the normal behavior of the build script isn't sufficient.

For now, to unblock, I hardcoded a special case, but we should consider a better way to handle this in the future.

Changed files:
filename: packages/use-sync-external-store/package.json
patch: @@ -20,6 +20,6 @@
   ],
   "license": "MIT",
   "peerDependencies": {
-    "react": "^16.8.0 || ^17.0.0"
+    "react": "^16.8.0 || ^17.0.0 || ^18.0.0-rc"
   }
 }

filename: scripts/release/publish-commands/parse-params.js
patch: @@ -45,6 +45,7 @@ module.exports = () => {
       case 'experimental':
       case 'alpha':
       case 'beta':
+      case 'rc':
       case 'untagged':
         break;
       default:

filename: scripts/rollup/build-all-release-channels.js
patch: @@ -243,6 +243,13 @@ function updatePackageVersions(
         }
       }
       if (packageInfo.peerDependencies) {
+        if (!pinToExactVersion && moduleName === 'use-sync-external-store') {
+          // use-sync-external-store supports older versions of React, too, so
+          // we don't override to the latest version. We should figure out some
+          // better way to handle this.
+          // TODO: Remove this special case.
+          continue;
+        }
         for (const dep of Object.keys(packageInfo.peerDependencies)) {
           const depVersion = versionsMap.get(dep);
           if (depVersion !== undefined) {
Repository: huggingface/transformers
Pull request: Fix require_read_token

# What does this PR do?

Add require_read_token to functions instead of classes

Changed files:
filename: src/transformers/models/donut/modeling_donut_swin.py
patch: @@ -156,7 +156,7 @@ class DonutSwinImageClassifierOutput(ModelOutput):
     """
 
     loss: Optional[torch.FloatTensor] = None
-    logits: torch.FloatTensor = None
+    logits: Optional[torch.FloatTensor] = None
     hidden_states: Optional[Tuple[torch.FloatTensor, ...]] = None
     attentions: Optional[Tuple[torch.FloatTensor, ...]] = None
     reshaped_hidden_states: Optional[Tuple[torch.FloatTensor, ...]] = None

filename: tests/quantization/quark_integration/test_quark.py
patch: @@ -57,7 +57,6 @@ class QuarkTest(unittest.TestCase):
     EXPECTED_RELATIVE_DIFFERENCE = 1.66
     device_map = None
 
-    @require_read_token
     @classmethod
     def setUpClass(cls):
         """
@@ -76,15 +75,17 @@ def setUpClass(cls):
             device_map=cls.device_map,
         )
 
+    @require_read_token
     def test_memory_footprint(self):
         mem_quantized = self.quantized_model.get_memory_footprint()
 
         self.assertTrue(self.mem_fp16 / mem_quantized > self.EXPECTED_RELATIVE_DIFFERENCE)
 
+    @require_read_token
     def test_device_and_dtype_assignment(self):
         r"""
         Test whether trying to cast (or assigning a device to) a model after quantization will throw an error.
-        Checks also if other models are casted correctly.
+        Checks also if other models are casted correctly .
         """
         # This should work
         if self.device_map is None:
@@ -94,6 +95,7 @@ def test_device_and_dtype_assignment(self):
             # Tries with a `dtype``
             self.quantized_model.to(torch.float16)
 
+    @require_read_token
     def test_original_dtype(self):
         r"""
         A simple test to check if the model succesfully stores the original dtype
@@ -104,6 +106,7 @@ def test_original_dtype(self):
 
         self.assertTrue(isinstance(self.quantized_model.model.layers[0].mlp.gate_proj, QParamsLinear))
 
+    @require_read_token
     def check_inference_correctness(self, model):
         r"""
         Test the generation quality of the quantized model and see that we are matching the expected output.
@@ -127,6 +130,7 @@ def check_inference_correctness(self, model):
         # Get the generation
         self.assertIn(self.tokenizer.decode(output_sequences[0], skip_special_tokens=True), self.EXPECTED_OUTPUTS)
 
+    @require_read_token
     def test_generate_quality(self):
         """
         Simple test to check the quality of the model by comparing the generated tokens with the expected tokens
Repository: denoland/deno
Pull request: fix(ext/node): read correct CPU usage stats on Linux

Fixes issue #24731.

<img width="554" alt="deno_fixed" src="https://github.com/user-attachments/assets/691f2f89-d979-4ca5-be9a-cf51446cd9b2">

The total CPU usage row is ignored and info from `cpu0` and `cpu1` is correctly read.

Changed files:
filename: ext/node/ops/os/cpus.rs
patch: @@ -246,12 +246,13 @@ pub fn cpu_info() -> Option<Vec<CpuInfo>> {
   let reader = std::io::BufReader::new(fp);
 
   let mut count = 0;
-  for (i, line) in reader.lines().enumerate() {
+  // Skip the first line which tracks total CPU time across all cores
+  for (i, line) in reader.lines().skip(1).enumerate() {
     let line = line.ok()?;
     if !line.starts_with("cpu") {
       break;
     }
-    count = i;
+    count = i + 1;
     let mut fields = line.split_whitespace();
     fields.next()?;
     let user = fields.next()?.parse::<u64>().ok()?;
Repository: ggml-org/llama.cpp
Pull request: ggml-cpu: enable z17 compile detection

This pull request is in preparation for our IBM z17 Mainframe launch happening in May. It enables the z17 compilation via GCC 15.1.0.

Please note that z17 compilation requires GCC version 15.1.0 and above.

Changed files:
filename: ggml/src/ggml-cpu/CMakeLists.txt
patch: @@ -352,10 +352,14 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
         # TODO: Separation to determine activation of VX/VXE/VXE2
         if (${S390X_M} MATCHES "8561|8562")
             message(STATUS "z15 target")
-            list(APPEND ARCH_FLAGS -march=z15 -mtune=z15)
+            list(APPEND ARCH_FLAGS -march=z15)
         elseif (${S390X_M} MATCHES "3931")
             message(STATUS "z16 target")
-            list(APPEND ARCH_FLAGS -march=z16 -mtune=z16)
+            list(APPEND ARCH_FLAGS -march=z16)
+        elseif (${S390X_M} MATCHES "9175|9176")
+            # NOTE: Only available from GCC 15.1.0 onwards. Any z17 machine with compile issues must first verify their GCC version.
+            message(STATUS "z17 target")
+            list(APPEND ARCH_FLAGS -march=z17)
         else()
             message(STATUS "Unknown target")
             message(WARNING "Unknown target. If you are compiling for z14 and earlier, you might have to add -DGGML_VXE=OFF.")
Repository: electron/electron
Pull request: build: fix telemetry error when using autoninja

Backport of #43563

See that PR for details.


Notes: <!-- 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 -->none


Changed files:
filename: appveyor-woa.yml
patch: @@ -95,6 +95,8 @@ for:
       - git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
       - ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
       - depot_tools\bootstrap\win_tools.bat
+      - ps: |
+          Set-Content -Path $pwd\depot_tools\build_telemetry.cfg -Value '{"user": "info@electronjs.org", "status": "opt-out", "countdown": 10, "version": 1}'
       - ps: $env:PATH="$pwd\depot_tools;$env:PATH"
       - ps: >-
           if (Test-Path -Path "$pwd\src\electron") {

filename: appveyor.yml
patch: @@ -93,6 +93,8 @@ for:
       - git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
       - ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
       - depot_tools\bootstrap\win_tools.bat
+      - ps: |
+          Set-Content -Path $pwd\depot_tools\build_telemetry.cfg -Value '{"user": "info@electronjs.org", "status": "opt-out", "countdown": 10, "version": 1}'
       - ps: $env:PATH="$pwd\depot_tools;$env:PATH"
       - ps: >-
           if (Test-Path -Path "$pwd\src\electron") {
Repository: electron/electron
Pull request: build: fix telemetry error when using autoninja

#### Description of Change
autoninja has been throwing an error in Windows builds:
```
 ERROR:root:Expecting value: line 1 column 1 (char 0)
```
eg see https://ci.appveyor.com/project/electron-bot/electron-x64-release/builds/50534902/job/m4hntgux7tc9xdva#L59117

It turns out that https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5669094 caused this error and we can work around it by creating a file called `build_telemetry.cfg` in the depot_tools directory.

This change is not needed for GHA as the error doesn't surface there, probably due to the fact that builds there run through `e build` instead of calling autoninja directly.
<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.

Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
-->

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [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: <!-- 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 -->none


Changed files:
filename: appveyor-woa.yml
patch: @@ -95,6 +95,8 @@ for:
       - git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
       - ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
       - depot_tools\bootstrap\win_tools.bat
+      - ps: |
+          Set-Content -Path $pwd\depot_tools\build_telemetry.cfg -Value '{"user": "info@electronjs.org", "status": "opt-out", "countdown": 10, "version": 1}'
       - ps: $env:PATH="$pwd\depot_tools;$env:PATH"
       - ps: >-
           if (Test-Path -Path "$pwd\src\electron") {

filename: appveyor.yml
patch: @@ -93,6 +93,8 @@ for:
       - git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
       - ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
       - depot_tools\bootstrap\win_tools.bat
+      - ps: |
+          Set-Content -Path $pwd\depot_tools\build_telemetry.cfg -Value '{"user": "info@electronjs.org", "status": "opt-out", "countdown": 10, "version": 1}'
       - ps: $env:PATH="$pwd\depot_tools;$env:PATH"
       - ps: >-
           if (Test-Path -Path "$pwd\src\electron") {
Repository: denoland/deno
Pull request: fix: upgrade deno_core to 0.298.0

Fixes percent-encoded filenames in stack traces:
- https://github.com/denoland/deno_core/pull/759

Closes #18983

Changed files:
filename: Cargo.lock
patch: @@ -1342,9 +1342,9 @@ dependencies = [
 
 [[package]]
 name = "deno_core"
-version = "0.297.0"
+version = "0.298.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9f288b405f91af8ea45dc74ce4391fc5f390531947e9fc8630fb0206d3f2c93"
+checksum = "54fb4db0174c7130b3a8a90ed6aefb3b42a8acd6b75ea9a5a0c7c4d02993cd61"
 dependencies = [
  "anyhow",
  "bincode",
@@ -1359,6 +1359,7 @@ dependencies = [
  "libc",
  "memoffset 0.9.1",
  "parking_lot 0.12.3",
+ "percent-encoding",
  "pin-project",
  "serde",
  "serde_json",
@@ -1822,9 +1823,9 @@ dependencies = [
 
 [[package]]
 name = "deno_ops"
-version = "0.173.0"
+version = "0.174.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46c1e18b32543405cde22a2b04b4d108c2f129cc2d34db0872d4a5bb378b43af"
+checksum = "cdacbea7e6c459f0bcb48cdb0c7ce8ca6ece53645385fe98cf38e7242b2c5809"
 dependencies = [
  "proc-macro-rules",
  "proc-macro2",
@@ -5939,9 +5940,9 @@ dependencies = [
 
 [[package]]
 name = "serde_v8"
-version = "0.206.0"
+version = "0.207.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "517f37bd74d2287bd9b5197f7dff77d1f1f960a7a1f6557b55dc39423e0372a8"
+checksum = "a442f2e04f8367eb99982beb6733fb88df666da9379f937552d67ca060de6e80"
 dependencies = [
  "num-bigint",
  "serde",
@@ -7559,9 +7560,9 @@ dependencies = [
 
 [[package]]
 name = "v8"
-version = "0.98.2"
+version = "0.99.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9b8009c63eec162cbcc41aa4db66b81974f641d32a35b1a3198ec2ce4712d6b"
+checksum = "fa3fc0608a78f0c7d4ec88025759cb78c90a29984b48540060355a626ae329c1"
 dependencies = [
  "bindgen",
  "bitflags 2.5.0",

filename: Cargo.toml
patch: @@ -44,7 +44,7 @@ repository = "https://github.com/denoland/deno"
 
 [workspace.dependencies]
 deno_ast = { version = "=0.40.0", features = ["transpiling"] }
-deno_core = { version = "0.297.0" }
+deno_core = { version = "0.298.0" }
 
 deno_bench_util = { version = "0.156.0", path = "./bench_util" }
 deno_lockfile = "0.20.0"

filename: tests/integration/test_tests.rs
patch: @@ -93,7 +93,7 @@ test 0 => ./fail_with_contain_unicode_filename🦕.ts:[WILDCARD]
 error: Error
   throw new Error();
         ^
-    at [WILDCARD]/fail_with_contain_unicode_filename%F0%9F%A6%95.ts:[WILDCARD]
+    at [WILDCARD]/fail_with_contain_unicode_filename🦕.ts:[WILDCARD]
 
  FAILURES
Repository: nodejs/node
Pull request: Remove unused import from sample code

The `node:path` module is referenced in a code snippet that doesn't actually use it.

<!--
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/async_context.md
patch: @@ -626,7 +626,6 @@ a Worker pool around it could use the following structure:
 ```mjs
 import { AsyncResource } from 'node:async_hooks';
 import { EventEmitter } from 'node:events';
-import path from 'node:path';
 import { Worker } from 'node:worker_threads';
 
 const kTaskInfo = Symbol('kTaskInfo');
Repository: facebook/react
Pull request: [DevTools] Emit new event when DevTools connects in standalone app

## Summary

Our internal Flipper integration could benefit from emitting this event to improve the UX when switching between DevTools versions


## How did you test this change?

- yarn flow
- yarn test
- yarn test-build-devtools
- ran standalone app and verified new listener event

![image](https://user-images.githubusercontent.com/1271509/144309740-1f9eba65-4953-4bee-9980-8132eb1ac72d.png)



Changed files:
filename: packages/react-devtools-core/src/standalone.js
patch: @@ -41,13 +41,17 @@ import type {InspectedElement} from 'react-devtools-shared/src/devtools/views/Co
 
 installHook(window);
 
-export type StatusListener = (message: string) => void;
+export type StatusTypes = 'server-connected' | 'devtools-connected' | 'error';
+export type StatusListener = (message: string, status: StatusTypes) => void;
 export type OnDisconnectedCallback = () => void;
 
 let node: HTMLElement = ((null: any): HTMLElement);
 let nodeWaitingToConnectHTML: string = '';
 let projectRoots: Array<string> = [];
-let statusListener: StatusListener = (message: string) => {};
+let statusListener: StatusListener = (
+  message: string,
+  status?: StatusTypes,
+) => {};
 let disconnectedCallback: OnDisconnectedCallback = () => {};
 
 // TODO (Webpack 5) Hopefully we can remove this prop after the Webpack 5 migration.
@@ -260,6 +264,7 @@ function initialize(socket: WebSocket) {
   });
 
   log('Connected');
+  statusListener('DevTools initialized.', 'devtools-connected');
   reload();
 }
 
@@ -372,12 +377,15 @@ function startServer(
 
   httpServer.on('error', event => {
     onError(event);
-    statusListener('Failed to start the server.');
+    statusListener('Failed to start the server.', 'error');
     startServerTimeoutID = setTimeout(() => startServer(port), 1000);
   });
 
   httpServer.listen(port, () => {
-    statusListener('The server is listening on the port ' + port + '.');
+    statusListener(
+      'The server is listening on the port ' + port + '.',
+      'server-connected',
+    );
   });
 
   return {