helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: Fix: createRouterAct "reject" config

Fixes a problem with the internal `createRouterAct` testing helper where the `block: "reject"` option would not error correctly, leading to potential false negatives. I think I accidentally broke this when I added the ability to provide an array of expected responses.

Changed files:
filename: test/e2e/app-dir/segment-cache/router-act.ts
patch: @@ -72,6 +72,7 @@ export function createRouterAct(
     }
 
     let expectedResponses: Array<ExpectedResponseConfig> | null
+    let forbiddenResponses: Array<ExpectedResponseConfig> | null = null
     let shouldBlockAll = false
     if (config === undefined || config === null) {
       // Default. Expect at least one request, but don't assert on the response.
@@ -101,6 +102,7 @@ export function createRouterAct(
         expectedResponses = [config]
       } else {
         expectedResponses = []
+        forbiddenResponses = [config]
       }
     } else {
       expectedResponses = []
@@ -113,6 +115,12 @@ export function createRouterAct(
         }
         if (item.block !== 'reject') {
           expectedResponses.push(item)
+        } else {
+          if (forbiddenResponses === null) {
+            forbiddenResponses = [item]
+          } else {
+            forbiddenResponses.push(item)
+          }
         }
       }
     }
@@ -288,24 +296,28 @@ ${fulfilled.body}
 `
               throw error
             }
-            if (expectedResponses !== null) {
-              let alreadyMatchedByThisResponse: string | null = null
-              for (const expectedResponse of expectedResponses) {
-                const includes = expectedResponse.includes
-                const block = expectedResponse.block
+            if (forbiddenResponses !== null) {
+              for (const forbiddenResponse of forbiddenResponses) {
+                const includes = forbiddenResponse.includes
                 if (fulfilled.body.includes(includes)) {
-                  if (block === 'reject') {
-                    error.message = `
+                  error.message = `
 Received a response containing an unexpected substring:
 
 Rejected substring: ${includes}
 
 Response:
 ${fulfilled.body}
 `
-                    throw error
-                  }
-
+                  throw error
+                }
+              }
+            }
+            if (expectedResponses !== null) {
+              let alreadyMatchedByThisResponse: string | null = null
+              for (const expectedResponse of expectedResponses) {
+                const includes = expectedResponse.includes
+                const block = expectedResponse.block
+                if (fulfilled.body.includes(includes)) {
                   // Match. Don't check yet whether the responses are received
                   // in the expected order. Instead collect all the matches and
                   // check at the end so we can include a diff in the
Repository: ggml-org/llama.cpp
Pull request: cmake : fix static linking for OpenMP on Unix-like systems

When compiling with GGML_STATIC=ON, the build process would produce a binary that was still dynamically linked to OpenMP. This defeats the purpose of a static build:

    $ cmake -B build \
            -DBUILD_SHARED_LIBS=OFF \
            -DLLAMA_CURL=OFF \
            -DGGML_CCACHE=OFF \
            -DGGML_NATIVE=OFF \
            -DGGML_STATIC=ON

    $ ldd llama-server
            linux-vdso.so.1 (0x0000e1a434e3b000)
            libgomp.so.1 => /lib/aarch64-linux-gnu/libgomp.so.1 (0x0000e1a4345a0000)
            libstdc++.so.6 => /lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000e1a434300000)
            libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000e1a434240000)
            libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000e1a434200000)
            libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000e1a434030000)
            /lib/ld-linux-aarch64.so.1 (0x0000e1a434df0000)

This commit resolves the issue by modifying `CMAKE_FIND_LIBRARY_SUFFIXES` to prioritize `.a` files, forcing CMake to link the static version of the library.


Changed files:
filename: ggml/src/CMakeLists.txt
patch: @@ -114,6 +114,9 @@ message(STATUS "GGML_SYSTEM_ARCH: ${GGML_SYSTEM_ARCH}")
 
 if (NOT MSVC)
     if (GGML_STATIC)
+        if (UNIX AND NOT APPLE)
+            set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
+        endif()
         add_link_options(-static)
         if (MINGW)
             add_link_options(-static-libgcc -static-libstdc++)
Repository: facebook/react
Pull request: [Fiber] Use a safer strategy to track the last precedence

Uses a safer strategy to track the last precedence to avoid the need to consistently remember to preprend `'p'` to the precedence value

Changed files:
filename: packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
patch: @@ -3481,10 +3481,20 @@ function onUnsuspend(this: SuspendedState) {
   }
 }
 
+// We use a value that is type distinct from precedence to track which one is last.
+// This ensures there is no collision with user defined precedences. Normally we would
+// just track this in module scope but since the precedences are tracked per HoistableRoot
+// we need to associate it to something other than a global scope hence why we try to
+// colocate it with the map of precedences in the first place
+const LAST_PRECEDENCE = null;
+
 // This is typecast to non-null because it will always be set before read.
 // it is important that this not be used except when the stack guarantees it exists.
 // Currentlyt his is only during insertSuspendedStylesheet.
-let precedencesByRoot: Map<HoistableRoot, Map<string, Instance>> = (null: any);
+let precedencesByRoot: Map<
+  HoistableRoot,
+  Map<string | typeof LAST_PRECEDENCE, Instance>,
+> = (null: any);
 
 function insertSuspendedStylesheets(
   state: SuspendedState,
@@ -3539,27 +3549,27 @@ function insertStylesheetIntoRoot(
         // and will be hoisted by the Fizz runtime imminently.
         node.getAttribute('media') !== 'not all'
       ) {
-        precedences.set('p' + node.dataset.precedence, node);
+        precedences.set(node.dataset.precedence, node);
         last = node;
       }
     }
     if (last) {
-      precedences.set('last', last);
+      precedences.set(LAST_PRECEDENCE, last);
     }
   } else {
-    last = precedences.get('last');
+    last = precedences.get(LAST_PRECEDENCE);
   }
 
   // We only call this after we have constructed an instance so we assume it here
   const instance: HTMLLinkElement = (resource.instance: any);
   // We will always have a precedence for stylesheet instances
   const precedence: string = (instance.getAttribute('data-precedence'): any);
 
-  const prior = precedences.get('p' + precedence) || last;
+  const prior = precedences.get(precedence) || last;
   if (prior === last) {
-    precedences.set('last', instance);
+    precedences.set(LAST_PRECEDENCE, instance);
   }
-  precedences.set('p' + precedence, instance);
+  precedences.set(precedence, instance);
 
   this.count++;
   const onComplete = onUnsuspend.bind(this);
Repository: nodejs/node
Pull request: module: tidy code string concat → string templates

I'm already git blamed for these lines. The changes are code hygiene.

Changed files:
filename: lib/internal/modules/package_json_reader.js
patch: @@ -230,8 +230,7 @@ function parsePackageName(specifier, base) {
 }
 
 function getPackageJSONURL(specifier, base) {
-  const { packageName, packageSubpath, isScoped } =
-    parsePackageName(specifier, base);
+  const { packageName, packageSubpath, isScoped } = parsePackageName(specifier, base);
 
   // ResolveSelf
   const packageConfig = getPackageScopeConfig(base);
@@ -242,8 +241,7 @@ function getPackageJSONURL(specifier, base) {
     }
   }
 
-  let packageJSONUrl =
-    new URL('./node_modules/' + packageName + '/package.json', base);
+  let packageJSONUrl = new URL(`./node_modules/${packageName}/package.json`, base);
   let packageJSONPath = fileURLToPath(packageJSONUrl);
   let lastPath;
   do {
@@ -254,9 +252,10 @@ function getPackageJSONURL(specifier, base) {
     // Check for !stat.isDirectory()
     if (stat !== 1) {
       lastPath = packageJSONPath;
-      packageJSONUrl = new URL((isScoped ?
-        '../../../../node_modules/' : '../../../node_modules/') +
-        packageName + '/package.json', packageJSONUrl);
+      packageJSONUrl = new URL(
+        `${isScoped ? '../' : ''}../../../node_modules/${packageName}/package.json`,
+        packageJSONUrl,
+      );
       packageJSONPath = fileURLToPath(packageJSONUrl);
       continue;
     }
Repository: huggingface/transformers
Pull request: Fix ModernBERT Decoder model

# What does this PR do?

as in title


Changed files:
filename: src/transformers/models/modernbert_decoder/modeling_modernbert_decoder.py
patch: @@ -217,7 +217,7 @@ def forward(
 
 @auto_docstring
 class ModernBertDecoderPreTrainedModel(ModernBertPreTrainedModel):
-    config_class: ModernBertDecoderConfig
+    config: ModernBertDecoderConfig
     base_model_prefix = "model"
     _skip_keys_device_placement = ["past_key_values"]
     _no_split_modules = ["ModernBertDecoderLayer"]

filename: src/transformers/models/modernbert_decoder/modular_modernbert_decoder.py
patch: @@ -394,7 +394,7 @@ def forward(
 
 @auto_docstring
 class ModernBertDecoderPreTrainedModel(ModernBertPreTrainedModel):
-    config_class: ModernBertDecoderConfig
+    config: ModernBertDecoderConfig
     base_model_prefix = "model"
     _skip_keys_device_placement = ["past_key_values"]
     _no_split_modules = ["ModernBertDecoderLayer"]
Repository: denoland/deno
Pull request: fix(lsp): handle 'deno.config' setting outside of workspace

Fixes https://github.com/denoland/vscode_deno/issues/1305.

Changed files:
filename: cli/lsp/config.rs
patch: @@ -2026,7 +2026,12 @@ impl ConfigTree {
     let pkg_json_cache = PackageJsonMemCache::default();
     let workspace_cache = WorkspaceMemCache::default();
     let mut scopes = BTreeMap::new();
-    for (folder_url, ws_settings) in &settings.by_workspace_folder {
+    for (folder_url, ws_settings) in
+      settings.by_workspace_folder.iter().chain([(
+        &Arc::new(Url::parse("file:///").unwrap()),
+        &Some(settings.unscoped.clone()),
+      )])
+    {
       let mut ws_settings = ws_settings.as_ref();
       if Some(folder_url) == settings.first_folder.as_ref() {
         ws_settings = ws_settings.or(Some(&settings.unscoped));

filename: tests/integration/lsp_tests.rs
patch: @@ -798,6 +798,51 @@ fn lsp_import_map_config_file_auto_discovered_symlink() {
   client.shutdown();
 }
 
+#[test]
+#[timeout(300_000)]
+fn lsp_deno_config_setting_no_workspace() {
+  let context = TestContextBuilder::new()
+    .use_http_server()
+    .use_temp_cwd()
+    .build();
+  let temp_dir = context.temp_dir();
+  let file = temp_dir
+    .source_file("file.ts", "const foo_bar = 1;\nconsole.log(foo_bar);\n");
+  let temp_dir_for_deno_json = test_util::TempDir::new();
+  temp_dir_for_deno_json.write(
+    "deno.json",
+    json!({
+      "lint": {
+        "rules": { "include": ["camelcase"] },
+      },
+    })
+    .to_string(),
+  );
+  let mut client = context.new_lsp_command().build();
+  client.initialize(|builder| {
+    builder.set_workspace_folders(vec![]);
+    builder.set_deno_enable(true);
+    builder.set_config(temp_dir_for_deno_json.url().join("deno.json").unwrap());
+  });
+  let diagnostics = client.did_open_file(&file);
+  assert_eq!(
+    json!(diagnostics.all()),
+    json!([
+      {
+        "range": {
+          "start": { "line": 0, "character": 6 },
+          "end": { "line": 0, "character": 13 },
+        },
+        "severity": 2,
+        "code": "camelcase",
+        "source": "deno-lint",
+        "message": "Identifier 'foo_bar' is not in camel case.\nConsider renaming `foo_bar` to `fooBar`",
+      },
+    ]),
+  );
+  client.shutdown();
+}
+
 #[test]
 #[timeout(300_000)]
 fn lsp_deno_json_imports_comments_cache() {
Repository: nodejs/node
Pull request: test: fix permission fixtures lint

Refs: https://github.com/nodejs/node/pull/55797#issuecomment-2466708352

Changed files:
filename: test/fixtures/permission/main-module.js
patch: @@ -1 +1 @@
-require('./required-module');
\ No newline at end of file
+require('./required-module');

filename: test/fixtures/permission/main-module.mjs
patch: @@ -1 +1 @@
-import './required-module.mjs';
\ No newline at end of file
+import './required-module.mjs';

filename: test/fixtures/permission/required-module.js
patch: @@ -1 +1 @@
-console.log('ok');
\ No newline at end of file
+console.log('ok');

filename: test/fixtures/permission/required-module.mjs
patch: @@ -1 +1 @@
-console.log('ok');
\ No newline at end of file
+console.log('ok');
Repository: ggml-org/llama.cpp
Pull request: CUDA: fix compilation on CC 6.0

Fixes https://github.com/ggml-org/llama.cpp/issues/16081 . The problem is that the Python script I used to determine shared memory use neglected one small part and I didn't notice because the compilation only fails on trying to generate a real architecture.

Changed files:
filename: ggml/src/ggml-cuda/fattn-tile.cu
patch: @@ -35,7 +35,6 @@ static int fattn_tile_get_kq_stride_host(const int D, const int ncols, const int
         switch (D) {
             case 64:
             case 128:
-                return 128;
             case 256:
                 return ncols <= 16 ? 128 : 64;
             default:
@@ -86,7 +85,6 @@ static constexpr __device__ int fattn_tile_get_kq_stride_device(int D, int ncols
     switch (D) {
         case 64:
         case 128:
-            return 128;
         case 256:
             return ncols <= 16 ? 128 : 64;
         default:
Repository: electron/electron
Pull request: test: fix timing issue in `utilityProcess` test fixtures

Backport of #45964

See that PR for details.


Notes: none.

Changed files:
filename: spec/fixtures/api/utility-process/dns-result-order.js
patch: @@ -1,4 +1,6 @@
 const dns = require('node:dns');
 
-console.log(dns.getDefaultResultOrder());
-process.exit(0);
+const write = (writable, chunk) => new Promise((resolve) => writable.write(chunk, resolve));
+
+write(process.stdout, `${dns.getDefaultResultOrder()}\n`)
+  .then(() => process.exit(0));

filename: spec/fixtures/api/utility-process/esm.mjs
patch: @@ -1,2 +1,4 @@
-console.log(import.meta.url);
-process.exit(0);
+const write = (writable, chunk) => new Promise((resolve) => writable.write(chunk, resolve));
+
+write(process.stdout, `${import.meta.url}\n`)
+  .then(() => process.exit(0));
Repository: denoland/deno
Pull request: fix(lsp): don't cache jsxImportSource on lockfile-only changes


Changed files:
filename: cli/lsp/language_server.rs
patch: @@ -1150,6 +1150,10 @@ impl Inner {
       .send_did_refresh_deno_configuration_tree_notification(
         self.config.tree.to_did_refresh_params(),
       );
+  }
+
+  #[cfg_attr(feature = "lsp-tracing", tracing::instrument(skip_all))]
+  fn dispatch_cache_jsx_import_sources(&self) {
     for config_file in self.config.tree.config_files() {
       (|| {
         let compiler_options = config_file.to_compiler_options().ok()??.options;
@@ -1603,6 +1607,7 @@ impl Inner {
     self.update_global_cache().await;
     self.refresh_workspace_files();
     self.refresh_config_tree().await;
+    self.dispatch_cache_jsx_import_sources();
     self.update_cache();
     self.refresh_resolver().await;
     self.refresh_documents_config().await;
@@ -1630,10 +1635,12 @@ impl Inner {
       .any(|(s, _)| self.config.tree.is_watched_file(s))
     {
       let mut deno_config_changes = IndexSet::with_capacity(changes.len());
+      let mut changed_deno_json = false;
       deno_config_changes.extend(changes.iter().filter_map(|(s, e)| {
         self.config.tree.watched_file_type(s).and_then(|t| {
           let configuration_type = match t.1 {
             ConfigWatchedFileType::DenoJson => {
+              changed_deno_json = true;
               lsp_custom::DenoConfigurationType::DenoJson
             }
             ConfigWatchedFileType::PackageJson => {
@@ -1654,6 +1661,11 @@ impl Inner {
       self.workspace_files_hash = 0;
       self.refresh_workspace_files();
       self.refresh_config_tree().await;
+      // Don't cache anything if only a lockfile has changed, or it can
+      // retrigger this notification and cause an infinite loop.
+      if changed_deno_json {
+        self.dispatch_cache_jsx_import_sources();
+      }
       self.update_cache();
       self.refresh_resolver().await;
       self.refresh_documents_config().await;
@@ -4467,6 +4479,7 @@ impl Inner {
     self.update_global_cache().await;
     self.refresh_workspace_files();
     self.refresh_config_tree().await;
+    self.dispatch_cache_jsx_import_sources();
     self.update_cache();
     self.refresh_resolver().await;
     self.refresh_documents_config().await;
@@ -4686,6 +4699,7 @@ impl Inner {
   async fn post_did_change_workspace_folders(&mut self) {
     self.refresh_workspace_files();
     self.refresh_config_tree().await;
+    self.dispatch_cache_jsx_import_sources();
     self.refresh_resolver().await;
     self.refresh_documents_config().await;
     self.diagnostics_server.invalidate_all();
Repository: huggingface/transformers
Pull request: make fixup

# What does this PR do?

(see title)

Changed files:
filename: src/transformers/modeling_flash_attention_utils.py
patch: @@ -393,7 +393,9 @@ def _flash_attention_forward(
     query_states, key_states, value_states = fa_peft_integration_check(
         query_states, key_states, value_states, target_dtype
     )
-    use_mask = position_ids is not None or all(k is not None for k in [cu_seq_lens_q, cu_seq_lens_k, max_length_q, max_length_k])
+    use_mask = position_ids is not None or all(
+        k is not None for k in [cu_seq_lens_q, cu_seq_lens_k, max_length_q, max_length_k]
+    )
     if attention_mask is not None:
         q, k, v, idx, (cu_q, cu_k), (mq, mk) = _upad_input(
             query_states, key_states, value_states, attention_mask, query_length, unpad_fn
Repository: nodejs/node
Pull request: typings: fix `ModulesBinding` types

Refs: https://github.com/nodejs/node/pull/55412/files#r1817708918
<!--
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: typings/internalBinding/modules.d.ts
patch: @@ -9,7 +9,7 @@ export type PackageConfig = {
 export type DeserializedPackageConfig = {
   data: PackageConfig,
   exists: boolean,
-  path: URL['pathname'],
+  path: string,
 }
 export type SerializedPackageConfig = [
   PackageConfig['name'],
@@ -22,9 +22,10 @@ export type SerializedPackageConfig = [
 
 export interface ModulesBinding {
   readPackageJSON(path: string): SerializedPackageConfig | undefined;
-  getNearestParentPackageJSON(path: string): SerializedPackageConfig | undefined
-  getNearestRawParentPackageJSON(origin: URL['pathname']): [ReturnType<JSON['stringify']>, DeserializedPackageConfig['path']] | undefined
   getNearestParentPackageJSONType(path: string): PackageConfig['type']
+  getNearestParentPackageJSON(path: string): SerializedPackageConfig | undefined
   getPackageScopeConfig(path: string): SerializedPackageConfig | undefined
-  getPackageJSONScripts(): string | undefined
+  enableCompileCache(path?: string): { status: number, message?: string, directory?: string }
+  getCompileCacheDir(): string | undefined
+  flushCompileCache(keepDeserializedCache?: boolean): void
 }
Repository: denoland/deno
Pull request: feat: support unconfigured runtime in serve subcommand

Support the unconfigured runtime when using `deno serve`.

Changed files:
filename: cli/main.rs
patch: @@ -292,7 +292,7 @@ async fn run_subcommand(
       }
     }),
     DenoSubcommand::Serve(serve_flags) => spawn_subcommand(async move {
-      tools::serve::serve(flags, serve_flags).await
+      tools::serve::serve(flags, serve_flags, unconfigured_runtime, roots).await
     }),
     DenoSubcommand::Task(task_flags) => spawn_subcommand(async {
       tools::task::execute_script(flags, task_flags).await

filename: cli/tools/serve.rs
patch: @@ -7,6 +7,8 @@ use deno_core::error::AnyError;
 use deno_core::futures::FutureExt;
 use deno_core::futures::TryFutureExt;
 use deno_core::ModuleSpecifier;
+use deno_lib::worker::LibWorkerFactoryRoots;
+use deno_runtime::UnconfiguredRuntime;
 
 use super::run::check_permission_before_script;
 use super::run::maybe_npm_install;
@@ -20,6 +22,8 @@ use crate::worker::CliMainWorkerFactory;
 pub async fn serve(
   flags: Arc<Flags>,
   serve_flags: ServeFlags,
+  unconfigured_runtime: Option<UnconfiguredRuntime>,
+  roots: LibWorkerFactoryRoots,
 ) -> Result<i32, AnyError> {
   check_permission_before_script(&flags);
 
@@ -45,8 +49,11 @@ pub async fn serve(
 
   maybe_npm_install(&factory).await?;
 
-  let worker_factory =
-    Arc::new(factory.create_cli_main_worker_factory().await?);
+  let worker_factory = Arc::new(
+    factory
+      .create_cli_main_worker_factory_with_roots(roots)
+      .await?,
+  );
 
   if serve_flags.open_site {
     let url = resolve_serve_url(serve_flags.host, serve_flags.port);
@@ -62,6 +69,7 @@ pub async fn serve(
     main_module.clone(),
     serve_flags.worker_count,
     hmr,
+    unconfigured_runtime,
   )
   .await
 }
@@ -71,14 +79,16 @@ async fn do_serve(
   main_module: ModuleSpecifier,
   worker_count: Option<usize>,
   hmr: bool,
+  unconfigured_runtime: Option<UnconfiguredRuntime>,
 ) -> Result<i32, AnyError> {
   let mut worker = worker_factory
-    .create_main_worker(
+    .create_main_worker_with_unconfigured_runtime(
       deno_runtime::WorkerExecutionMode::Serve {
         is_main: true,
         worker_count,
       },
       main_module.clone(),
+      unconfigured_runtime,
     )
     .await?;
   let worker_count = match worker_count {
@@ -176,7 +186,7 @@ async fn serve_with_watch(
         let worker_factory =
           Arc::new(factory.create_cli_main_worker_factory().await?);
 
-        do_serve(worker_factory, main_module.clone(), worker_count, hmr)
+        do_serve(worker_factory, main_module.clone(), worker_count, hmr, None)
           .await?;
 
         Ok(())