helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: Use XDG_ACTIVATION_TOKEN in wayland when launched by other app

Backport of #43481

See that PR for details.


Notes: Fixed electron app in ozone/wayland not being focused when launched from another app


Changed files:
filename: shell/app/electron_main_delegate.cc
patch: @@ -408,6 +408,11 @@ std::optional<int> ElectronMainDelegate::PreBrowserMain() {
   content::InitializeMojoCore();
 #if BUILDFLAG(IS_MAC)
   RegisterAtomCrApp();
+#endif
+#if BUILDFLAG(IS_LINUX)
+  // Set the global activation token sent as an environment variable.
+  auto env = base::Environment::Create();
+  base::nix::ExtractXdgActivationTokenFromEnv(*env);
 #endif
   return std::nullopt;
 }

filename: shell/browser/api/electron_api_app.cc
patch: @@ -92,6 +92,11 @@
 #include "shell/browser/ui/cocoa/electron_bundle_mover.h"
 #endif
 
+#if BUILDFLAG(IS_LINUX)
+#include "base/nix/scoped_xdg_activation_token_injector.h"
+#include "base/nix/xdg_util.h"
+#endif
+
 using electron::Browser;
 
 namespace gin {
@@ -411,6 +416,12 @@ bool NotificationCallbackWrapper(
     base::CommandLine cmd,
     const base::FilePath& cwd,
     const std::vector<uint8_t> additional_data) {
+#if BUILDFLAG(IS_LINUX)
+  // Set the global activation token sent as a command line switch by another
+  // electron app instance. This also removes the switch after use to prevent
+  // any side effects of leaving it in the command line after this point.
+  base::nix::ExtractXdgActivationTokenFromCmdLine(cmd);
+#endif
   // Make sure the callback is called after app gets ready.
   if (Browser::Get()->is_ready()) {
     callback.Run(std::move(cmd), cwd, std::move(additional_data));
@@ -1022,6 +1033,15 @@ bool App::RequestSingleInstanceLock(gin::Arguments* args) {
       base::BindRepeating(NotificationCallbackWrapper, cb));
 #endif
 
+#if BUILDFLAG(IS_LINUX)
+  // Read the xdg-activation token and set it in the command line for the
+  // duration of the notification in order to ensure this is propagated to an
+  // already running electron app instance if it exists.
+  // The activation token received from the launching app is used later when
+  // activating the existing electron app instance window.
+  base::nix::ScopedXdgActivationTokenInjector activation_token_injector(
+      *base::CommandLine::ForCurrentProcess(), *base::Environment::Create());
+#endif
   switch (process_singleton_->NotifyOtherProcessOrCreate()) {
     case ProcessSingleton::NotifyResult::PROCESS_NONE:
       if (content::BrowserThread::IsThreadInitialized(
Repository: vercel/next.js
Pull request: Turbopack: fix duplicate module from internal ref

A module that was referenced using a `ReferenceType::Internal` and some other non-internal reference type would lead to a duplicated module, because the internal reference always got its own module.


There are various places where we could do the check I added, but this is one of the sources:

https://github.com/vercel/next.js/blob/4509bf240a3327be168ae0035bd578752676b3ec/turbopack/crates/turbopack/src/lib.rs#L501-L504

The bug occured because of these two factors:

- `Option<Vc<Vec<...>>` is just bad at uniquely modelling state (because `None` and `Some(vec![])` really are the same thing but not according to turbo-tasks).

- And then having different two `new` constructors that aren't completely disjoint (with the None vs empty vector case above).

Closes PACK-4369

Changed files:
filename: turbopack/crates/turbopack-ecmascript/src/lib.rs
patch: @@ -503,25 +503,36 @@ impl EcmascriptModuleAsset {
     }
 
     #[turbo_tasks::function]
-    pub fn new_with_inner_assets(
+    pub async fn new_with_inner_assets(
         source: ResolvedVc<Box<dyn Source>>,
         asset_context: ResolvedVc<Box<dyn AssetContext>>,
         ty: Value<EcmascriptModuleAssetType>,
         transforms: ResolvedVc<EcmascriptInputTransforms>,
         options: ResolvedVc<EcmascriptOptions>,
         compile_time_info: ResolvedVc<CompileTimeInfo>,
         inner_assets: ResolvedVc<InnerAssets>,
-    ) -> Vc<Self> {
-        Self::cell(EcmascriptModuleAsset {
-            source,
-            asset_context,
-            ty: ty.into_value(),
-            transforms,
-            options,
-            compile_time_info,
-            inner_assets: Some(inner_assets),
-            last_successful_parse: Default::default(),
-        })
+    ) -> Result<Vc<Self>> {
+        if inner_assets.await?.is_empty() {
+            Ok(Self::new(
+                *source,
+                *asset_context,
+                ty,
+                *transforms,
+                *options,
+                *compile_time_info,
+            ))
+        } else {
+            Ok(Self::cell(EcmascriptModuleAsset {
+                source,
+                asset_context,
+                ty: ty.into_value(),
+                transforms,
+                options,
+                compile_time_info,
+                inner_assets: Some(inner_assets),
+                last_successful_parse: Default::default(),
+            }))
+        }
     }
 
     #[turbo_tasks::function]
Repository: denoland/deno
Pull request: fix(publish): show dirty files on dirty check failure

```
Checking for slow types in the public API...

Uncommitted changes:

?? deno.json
?? main.ts

error: Aborting due to uncommitted changes. Check in source code or run with --allow-dirty
```

Changed files:
filename: cli/tools/registry/mod.rs
patch: @@ -143,9 +143,13 @@ pub async fn publish(
     .ok()
     .is_none()
     && !publish_flags.allow_dirty
-    && check_if_git_repo_dirty(cli_options.initial_cwd()).await
   {
-    bail!("Aborting due to uncommitted changes. Check in source code or run with --allow-dirty");
+    if let Some(dirty_text) =
+      check_if_git_repo_dirty(cli_options.initial_cwd()).await
+    {
+      log::error!("\nUncommitted changes:\n\n{}\n", dirty_text);
+      bail!("Aborting due to uncommitted changes. Check in source code or run with --allow-dirty");
+    }
   }
 
   if publish_flags.dry_run {
@@ -306,7 +310,10 @@ impl PublishPreparer {
     } else if std::env::var("DENO_INTERNAL_FAST_CHECK_OVERWRITE").as_deref()
       == Ok("1")
     {
-      if check_if_git_repo_dirty(self.cli_options.initial_cwd()).await {
+      if check_if_git_repo_dirty(self.cli_options.initial_cwd())
+        .await
+        .is_some()
+      {
         bail!("When using DENO_INTERNAL_FAST_CHECK_OVERWRITE, the git repo must be in a clean state.");
       }
 
@@ -1130,10 +1137,10 @@ fn verify_version_manifest(
   Ok(())
 }
 
-async fn check_if_git_repo_dirty(cwd: &Path) -> bool {
+async fn check_if_git_repo_dirty(cwd: &Path) -> Option<String> {
   let bin_name = if cfg!(windows) { "git.exe" } else { "git" };
 
-  // Check if git exists
+  //  Check if git exists
   let git_exists = Command::new(bin_name)
     .arg("--version")
     .stderr(Stdio::null())
@@ -1143,7 +1150,7 @@ async fn check_if_git_repo_dirty(cwd: &Path) -> bool {
     .map_or(false, |status| status.success());
 
   if !git_exists {
-    return false; // Git is not installed
+    return None; // Git is not installed
   }
 
   // Check if there are uncommitted changes
@@ -1155,7 +1162,12 @@ async fn check_if_git_repo_dirty(cwd: &Path) -> bool {
     .expect("Failed to execute command");
 
   let output_str = String::from_utf8_lossy(&output.stdout);
-  !output_str.trim().is_empty()
+  let text = output_str.trim();
+  if text.is_empty() {
+    None
+  } else {
+    Some(text.to_string())
+  }
 }
 
 #[allow(clippy::print_stderr)]

filename: tests/integration/publish_tests.rs
patch: @@ -413,8 +413,16 @@ fn allow_dirty() {
     .arg("sadfasdf")
     .run();
   output.assert_exit_code(1);
-  let output = output.combined_output();
-  assert_contains!(output, "Aborting due to uncommitted changes. Check in source code or run with --allow-dirty");
+  output.assert_matches_text(r#"Check [WILDLINE]
+Checking for slow types in the public API...
+
+Uncommitted changes:
+
+?? deno.json
+?? main.ts
+
+error: Aborting due to uncommitted changes. Check in source code or run with --allow-dirty
+"#);
 
   let output = context
     .new_command()
Repository: ggml-org/llama.cpp
Pull request: rpc : do not wait for response when sending RPC_CMD_SET_TENSOR

RPC_CMD_SET_TENSOR always returns an empty response and we send this 4 times per token. We can improve TG speed if we don't wait for this empty response.

The performance impact of this change depends on the network latency.


Changed files:
filename: ggml/include/ggml-rpc.h
patch: @@ -7,7 +7,7 @@
 extern "C" {
 #endif
 
-#define RPC_PROTO_MAJOR_VERSION    1
+#define RPC_PROTO_MAJOR_VERSION    2
 #define RPC_PROTO_MINOR_VERSION    0
 #define RPC_PROTO_PATCH_VERSION    0
 #define GGML_RPC_MAX_SERVERS       16

filename: ggml/src/ggml-rpc/ggml-rpc.cpp
patch: @@ -378,8 +378,8 @@ static bool parse_endpoint(const std::string & endpoint, std::string & host, int
 }
 
 // RPC request : | rpc_cmd (1 byte) | request_size (8 bytes) | request_data (request_size bytes) |
-// RPC response: | response_size (8 bytes) | response_data (response_size bytes) |
-static bool send_rpc_cmd(const std::shared_ptr<socket_t> & sock, enum rpc_cmd cmd, const void * input, size_t input_size, void * output, size_t output_size) {
+// No response
+static bool send_rpc_cmd(const std::shared_ptr<socket_t> & sock, enum rpc_cmd cmd, const void * input, size_t input_size) {
     uint8_t cmd_byte = cmd;
     if (!send_data(sock->fd, &cmd_byte, sizeof(cmd_byte))) {
         return false;
@@ -390,6 +390,15 @@ static bool send_rpc_cmd(const std::shared_ptr<socket_t> & sock, enum rpc_cmd cm
     if (!send_data(sock->fd, input, input_size)) {
         return false;
     }
+    return true;
+}
+
+// RPC request : | rpc_cmd (1 byte) | request_size (8 bytes) | request_data (request_size bytes) |
+// RPC response: | response_size (8 bytes) | response_data (response_size bytes) |
+static bool send_rpc_cmd(const std::shared_ptr<socket_t> & sock, enum rpc_cmd cmd, const void * input, size_t input_size, void * output, size_t output_size) {
+    if (!send_rpc_cmd(sock, cmd, input, input_size)) {
+        return false;
+    }
     // TODO: currently the output_size is always known, do we need support for commands with variable output size?
     // even if we do, we can skip sending output_size from the server for commands with known output size
     uint64_t out_size;
@@ -555,7 +564,7 @@ static void ggml_backend_rpc_buffer_set_tensor(ggml_backend_buffer_t buffer, ggm
     memcpy(input.data(), &rpc_tensor, sizeof(rpc_tensor));
     memcpy(input.data() + sizeof(rpc_tensor), &offset, sizeof(offset));
     memcpy(input.data() + sizeof(rpc_tensor) + sizeof(offset), data, size);
-    bool status = send_rpc_cmd(ctx->sock, RPC_CMD_SET_TENSOR, input.data(), input.size(), nullptr, 0);
+    bool status = send_rpc_cmd(ctx->sock, RPC_CMD_SET_TENSOR, input.data(), input.size());
     GGML_ASSERT(status);
 }
 
@@ -1428,9 +1437,6 @@ static void rpc_serve_client(ggml_backend_t backend, const char * cache_dir,
                 if (!server.set_tensor(input)) {
                     return;
                 }
-                if (!send_msg(sockfd, nullptr, 0)) {
-                    return;
-                }
                 break;
             }
             case RPC_CMD_SET_TENSOR_HASH: {
Repository: huggingface/transformers
Pull request: fix deepspeed job

# What does this PR do?

Wrong `working_directory` and got 

> OCI runtime exec failed: exec failed: unable to start container process: chdir to cwd ("/transformers") set in config.json failed: no such file or directory: unknown

Also install some packages at specific versions.

The pytest command is running with these changes

https://github.com/huggingface/transformers/actions/runs/14269422275/job/39998982497

I will leave you people to update the deepspeed docker image however: it's quite old.

Changed files:
filename: .github/workflows/self-scheduled.yml
patch: @@ -336,6 +336,10 @@ jobs:
         working-directory: ${{ inputs.working-directory-prefix }}/transformers
         run: git fetch && git checkout ${{ github.sha }}
 
+      # TODO: update the docker image instead
+      - name: Reinstall some packages with specific versions
+        run: python3 -m pip install numpy==1.24.3 numba==0.61.0 scipy==1.12.0 scikit-learn==1.6.1
+
       - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
         working-directory: ${{ inputs.working-directory-prefix }}/transformers
         run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
@@ -382,7 +386,7 @@ jobs:
         run: pip freeze
 
       - name: Set `machine_type` for report and artifact names
-        working-directory: /transformers
+        working-directory: ${{ inputs.working-directory-prefix }}/transformers
         shell: bash
         run: |
           echo "${{ matrix.machine_type }}"
Repository: facebook/react
Pull request: fix : grammatical typo for test description

<!--
  Thanks for submitting a pull request!
  We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory.

  Before submitting a pull request, please make sure the following is done:

  1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`.
  2. Run `yarn` in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
  5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
  6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect".
  7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
  8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

  Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

<!--
 Explain the **motivation** for making this change. What existing problem does the pull request solve?
-->

## How did you test this change?

<!--
  Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface.
  How exactly did you verify that your PR solves the issue you wanted to solve?
  If you leave this empty, your PR will very likely be closed.
-->


Changed files:
filename: packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js
patch: @@ -1184,7 +1184,7 @@ describe('ReactHooksWithNoopRenderer', () => {
         ]);
       });
 
-      // This update is exists to test an internal implementation detail:
+      // This update exists to test an internal implementation detail:
       // Effects without updating dependencies lose their layout/passive tag during an update.
       act(() => {
         ReactNoop.render(<Child bar={1} foo={2} />, () =>
Repository: vercel/next.js
Pull request: Fix externals doc validation

This moves the `validate-externals-doc` job to the `lint` step so it's not skipped for docs only changes. 

x-ref: https://github.com/vercel/next.js/actions/runs/14475138181/job/40601279813

Changed files:
filename: .github/workflows/build_and_test.yml
patch: @@ -100,7 +100,7 @@ jobs:
     needs: ['build-next']
     uses: ./.github/workflows/build_reusable.yml
     with:
-      afterBuild: pnpm lint-no-typescript && pnpm check-examples
+      afterBuild: pnpm lint-no-typescript && pnpm check-examples && pnpm validate-externals-doc
       stepName: 'lint'
     secrets: inherit
 

filename: package.json
patch: @@ -42,7 +42,7 @@
     "lint-eslint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint . --ext js,jsx,mjs,ts,tsx,mts,mdx --config .eslintrc.json --no-eslintrc",
     "lint-ast-grep": "ast-grep scan",
     "lint-no-typescript": "run-p prettier-check lint-eslint lint-language",
-    "types-and-precompiled": "run-p lint-typescript check-precompiled validate-externals-doc check-compiler-fixtures types:test-lib",
+    "types-and-precompiled": "run-p lint-typescript check-precompiled check-compiler-fixtures types:test-lib",
     "check-compiler-fixtures": "find crates/next-custom-transforms/tests/fixture -type f -name 'tsconfig.json' -exec /bin/sh -c 'echo \"project: $1\"; pnpm tsc --noEmit --project \"$1\"' -- {} \\;",
     "validate-externals-doc": "node ./scripts/validate-externals-doc.js",
     "lint": "run-p test-types lint-typescript prettier-check lint-eslint lint-ast-grep lint-language",

filename: scripts/validate-externals-doc.js
patch: @@ -58,7 +58,7 @@ const appRouterValid = validate(
   `docs/01-app/05-api-reference/05-config/01-next-config-js/serverExternalPackages.mdx`
 )
 const pagesRouterValid = validate(
-  `docs/02-pages/03-api-reference/04-config/01-next-config-js/serverExternalPackages.mdx`
+  `docs/02-pages/04-api-reference/04-config/01-next-config-js/serverExternalPackages.mdx`
 )
 
 if (appRouterValid && pagesRouterValid) {
Repository: denoland/deno
Pull request: fix(cli/init): broken link in deno init sample template

This commit fixes the broken link in the sample template provided by the deno init command.


Changed files:
filename: cli/tools/init/mod.rs
patch: @@ -68,7 +68,7 @@ Deno.test(function addTest() {
   return a + b;
 }
 
-// Learn more at https://deno.land/manual/examples/module_metadata#concepts
+// Learn more at https://docs.deno.com/runtime/manual/examples/module_metadata#concepts
 if (import.meta.main) {
   console.log("Add 2 + 3 =", add(2, 3));
 }
Repository: denoland/deno
Pull request: fix: include already seen deps in lockfile dep tracking

Tests in https://github.com/denoland/deno_graph/pull/504

Closes #24536

Changed files:
filename: Cargo.lock
patch: @@ -1515,9 +1515,9 @@ dependencies = [
 
 [[package]]
 name = "deno_graph"
-version = "0.80.0"
+version = "0.80.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1ec763fcd824d63cc056f153ba7fbf6254b515c347ec8b7d1a21515742547bb"
+checksum = "a71a3f1575d0309ac18ca2e7af88d64c15acd2c55d06fef0fbdfd7c69cecb09d"
 dependencies = [
  "anyhow",
  "async-trait",

filename: cli/Cargo.toml
patch: @@ -69,7 +69,7 @@ deno_config = { workspace = true, features = ["workspace"] }
 deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
 deno_doc = { version = "=0.142.0", features = ["html", "syntect"] }
 deno_emit = "=0.43.1"
-deno_graph = { version = "=0.80.0", features = ["tokio_executor"] }
+deno_graph = { version = "=0.80.1", features = ["tokio_executor"] }
 deno_lint = { version = "=0.60.1", features = ["docs"] }
 deno_lockfile.workspace = true
 deno_npm = "=0.21.4"
Repository: facebook/react
Pull request: fix typos in markdown files

<!--
  Thanks for submitting a pull request!
  We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory.

  Before submitting a pull request, please make sure the following is done:

  1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`.
  2. Run `yarn` in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
  5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
  6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect".
  7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
  8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

  Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

Fixed typos

## How did you test this change?

Just fixed some of the typos in markdown files.

Changed files:
filename: packages/react-devtools-inline/README.md
patch: @@ -66,7 +66,7 @@ const DevTools = initialize(contentWindow);
 
 ### Supporting named hooks
 
-DevTools can display hook "names" for an inspected component, although determining the "names" requires loading the source (and source-maps), parsing the code, and infering the names based on which variables hook values get assigned to. Because the code for this is non-trivial, it's lazy-loaded only if the feature is enabled.
+DevTools can display hook "names" for an inspected component, although determining the "names" requires loading the source (and source-maps), parsing the code, and inferring the names based on which variables hook values get assigned to. Because the code for this is non-trivial, it's lazy-loaded only if the feature is enabled.
 
 To configure this package to support this functionality, you'll need to provide a prop that dynamically imports the extra functionality:
 ```js

filename: packages/react-devtools/CONTRIBUTING.md
patch: @@ -1,5 +1,5 @@
 
-Intrested in contributing to React DevTools, but not sure where to start? This is the place!
+Interested in contributing to React DevTools, but not sure where to start? This is the place!
 
 # Install project dependencies
 To get started, check out the React repo:
Repository: denoland/deno
Pull request: fix(ext/node): send data frame with end_stream flag on _final call

We previously ended the http2 stream by sending trailers which should have been only used if waitForTrailers option is set on the http2session. This patch updates it and ends the stream by sending an empty data frame with end_stream flag set or by emitting 'wantTrailers' event if waitForTrailers option is set.

Hard to create an unit test as this requires that a test server needs to ack end of stream flag and then process a request. The example from #24058 works.

Closes https://github.com/denoland/deno/issues/24058

Changed files:
filename: ext/node/ops/http2.rs
patch: @@ -344,15 +344,15 @@ pub async fn op_http2_client_send_data(
   state: Rc<RefCell<OpState>>,
   #[smi] stream_rid: ResourceId,
   #[buffer] data: JsBuffer,
+  end_of_stream: bool,
 ) -> Result<(), AnyError> {
   let resource = state
     .borrow()
     .resource_table
     .get::<Http2ClientStream>(stream_rid)?;
   let mut stream = RcRef::map(&resource, |r| &r.stream).borrow_mut().await;
 
-  // TODO(bartlomieju): handle end of stream
-  stream.send_data(data.to_vec().into(), false)?;
+  stream.send_data(data.to_vec().into(), end_of_stream)?;
   Ok(())
 }
 

filename: ext/node/polyfills/http2.ts
patch: @@ -978,7 +978,7 @@ export class ClientHttp2Stream extends Duplex {
       return;
     }
 
-    shutdownWritable(this, cb);
+    shutdownWritable(this, cb, this.#rid);
   }
 
   // TODO(bartlomieju): needs a proper cleanup
@@ -1176,15 +1176,30 @@ export class ClientHttp2Stream extends Duplex {
   }
 }
 
-function shutdownWritable(stream, callback) {
+function shutdownWritable(stream, callback, streamRid) {
   debugHttp2(">>> shutdownWritable", callback);
   const state = stream[kState];
   if (state.shutdownWritableCalled) {
+    debugHttp2(">>> shutdownWritable() already called");
     return callback();
   }
   state.shutdownWritableCalled = true;
-  onStreamTrailers(stream);
-  callback();
+  if (state.flags & STREAM_FLAGS_HAS_TRAILERS) {
+    onStreamTrailers(stream);
+    callback();
+  } else {
+    op_http2_client_send_data(streamRid, new Uint8Array(), true)
+      .then(() => {
+        callback();
+        stream[kMaybeDestroy]();
+        core.tryClose(streamRid);
+      })
+      .catch((e) => {
+        callback(e);
+        core.tryClose(streamRid);
+        stream._destroy(e);
+      });
+  }
   // TODO(bartlomieju): might have to add "finish" event listener here,
   // check it.
 }