sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Add diff chunk header lines to Git
Labels: Suggestion,Help Wanted,Community Tooling,Experience Enhancement,PursuitFellowship

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ, especially the "Common Feature Requests" section: https://github.com/Microsoft/TypeScript/wiki/FAQ

-->

## Search Terms

`userdiff` `xfuncname`

## Suggestion

Please add regular expressions to https://github.com/git/git/blob/master/userdiff.c such that TypeScript constructs can be identified in a predictable manner by the Git diff algorithm.

## Use Cases

When I do a `git diff` or `git add -p` that includes TypeScript code, it's nice to see the function and/or class names of the changed lines I am looking at.

## Examples

- `git diff -- *.ts`
- `git add -p -- *.ts`

## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
    - Particularly "Provide a structuring mechanism for larger pieces of code."
Repository: vscode
Issue: onDebugInitialConfigurations activation event causes extensions to load when pressing F5 to run other projects
Labels: bug,debug

This has bugged me forever, but @isidorn [informs me](https://github.com/microsoft/vscode-python/issues/9557#issuecomment-574259357) this isn't intended.

1. Clone [mock-debug](https://github.com/Microsoft/vscode-mock-debug)
2. Replace `activationEvents` with `"onDebugInitialConfigurations"`
2.5 Change vscode engine version to 1.41 if using Stable (and delete `InlineDebugAdapterFactory`)
3. Run the project to launch extension dev host
4. Confirm mock-debug is *not* loaded
5. Open some project (for example Dart) that does *not* have a `launch.json`
6. Press `F5`
7. Note mock-debug is listed in the list and extension is activated

This behaviour is bad because many language extensions do expensive things at activation (downloaded SDK components, spawn language servers) which does not make sense to do for C#, Python, etc. when I'm pressing `F5` to run my Dart (for ex.) project.
Repository: vscode
Issue: [folding] seperate color for line numbers at collapsed row
Labels: feature-request,editor-folding

When we collapse rows, it's difficult to tell that we have, especially since hovering over the line numbers gutter causes all of the expand/collapse indicators to return.

I realize that, currently, a sticky expand indicator is left behind when rows are collapsed, but I propose that the line numbers themselves be lit up with a themable color.  So, for example, if rows collapse so that we have

...
149
150
**151
306**
307
308
...

the numbers **151** and **306** would glow brighter in some way.  This would be in addition to the sticky expander.
Repository: go
Issue: cmd/link: add a flag to the linker to do not write function names to runtime.pclntab
Labels: NeedsInvestigation,compiler/runtime

### What version of Go are you using (`go version`)?

<pre>
go version
go version devel +71154e061f Tue Jan 14 17:13:34 2020 +0000 linux/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes.

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/experiment0/.cache/go-build"
GOENV="/home/experiment0/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/experiment0/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/experiment0/.gimme/versions/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/experiment0/.gimme/versions/go/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build891839909=/tmp/go-build -gno-record-gcc-switches"
</pre></details>

### What did you do?

```
go get github.com/u-root/u-root
u-root -o /dev/null -build bb core boot
go get github.com/u-root/u-root/bb
go tool nm -size -sort size "$(go env GOPATH)"/bin/bb | head -1
```

### What did you expect to see?

```
  e02ba0    3836272 r runtime.pclntab
```

### What did you see instead?

```
  e39500    4808314 r runtime.pclntab
```

### Proposal

I found here https://groups.google.com/d/msg/golang-nuts/hEdGYnqokZc/zQojaoWlAgAJ that a binary size could be reduced by avoiding of [wasting space on function names](https://github.com/golang/go/blob/71154e061f067a668e7b619d7b3701470b8561be/src/cmd/link/internal/ld/pcln.go#L163) within `runtime.pclntab`. So I propose to add a linker flag (for example `-stripfnnames`) to do that. We need such feature for applying Golang into embedded environments (with very limited total space).

I would like to prepare a PR if it will be approved.
Repository: terminal
Issue: Explore whether Terminal could be 'runas' a different user identity
Labels: Issue-Feature,Product-Terminal,Product-Meta,Needs-Tag-Fix

Related to #2485, #1053, #3534

This issue is a fork from a conversation started in #146 (specifically [this comment onwards](https://github.com/microsoft/terminal/issues/146#issuecomment-572636545)) discussing if/whether Terminal can/could support being `runas` a different user identity than the currently logged-in user.

> Note: This is not sudo or run elevated - that's a different concept since elevation runs a process with the current user's identity, but with additional (admin) rights.

The primary ask here is that users, particularly those in enterprise scenarios, often need to run commands/scripts/etc. under a different user account with different permissions/rights than their normal/general user account.

Alas, UWP apps do not currently support the ability to run under a different identity than the currently logged-in user.

Thus, there are a couple of questions:
1. Can the UWP app platform provide a way to run UWP apps under a different/specific user identity?
2. If not, can Terminal be built/delivered allowing users to run under a different identity?

We'll go do some homework and respond to this thread with what we find.

Thanks all on the original thread for sharing their feedback :)
Repository: flutter
Issue: Update internal engine toolchain to VS 2019
Labels: engine,platform-windows,P2,team-engine,triaged-engine

Currently the bots are [pulling VS 2017 via gclient](https://github.com/flutter/buildroot/blob/master/build/vs_toolchain.py#L416) to build the Windows engine. This means that errors building with VS 2019, which is what most people would now install, go undetected; currently there are at least some type conversion issues in ANGLE that are causing build errors with 2019 but not 2017.

We should [switch to pulling 2019](https://chromium.googlesource.com/chromium/src/+/8e82c6ab1bc2223fa25f1a127b65071d2d58ae36%5E%21/). That change should be straightforward, but we need to fix the build errors first.
Repository: rust
Issue: declarative macro results in `rustc` entering infinite loop
Labels: A-macros,T-compiler,C-bug,I-hang

Rustc: `rustc 1.40.0 (73528e339 2019-12-16)`

`uname -a`: Darwin Carls-MacBook-Pro-2.local 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec  1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64 x86_64

I have crafted a declarative macro that results in `rustc` entering an infinite loop and never completing.

Repro:

```rust
#[macro_export]
macro_rules! lock {
    // Done normalizing
    (@ { $($t:tt)* }) => {
    };
    (@ { $($t:tt)* } $a:pat, $b:expr, $c:block $($r:tt)* ) => {
        $crate:lock!(@{ $($t)* $a,$b, $c, } $($r)*)

    };
    ( $($t:tt)* ) => {
        $crate::lock!(@{} $($t:tt)*)
    }
}

fn main() {
    lock! {
        foo, bar(), {
            println!("WAT!");
        }
    }
}
```
Repository: go
Issue: cmd/go: confusing error message for invalid package path
Labels: NeedsInvestigation,modules

I made a mistake in `gopls` (corrected in [CL 214717](https://go-review.googlesource.com/c/tools/+/214717)), which resulted in us passing multiple package paths as one argument to `go list`. The resulting error message did not make this easy to debug, as it wasn't clear that that was the issue.

`-: module golang.org/x/tools@latest found (v0.0.0-20200114052453-d31a08c2edf2), but does not contain package golang.org/x/tools/internal/lsp/noparse_format golang.org/x/tools/internal/lsp/folding`

It should be pretty obvious that a package path with a space is invalid, but it's not obvious what's going wrong from the error message.
Repository: kubernetes
Issue: kube-apiserver: limit request handling before apiserver is healthy
Labels: sig/api-machinery,kind/feature,lifecycle/frozen

**What would you like to be added**:

The idea is to 429 or 500 certain requests until apiserver becomes healthy for the first time.

Requests which would not be blocked:
* self-requests (required for apiserver to become healthy)
* healthz / livez / readyz
* componentstatuses (maybe)

**Why is this needed**:

We've observed on startup cases where apiserver is deluged with list requests, and it spends so much time servicing them that it can't become healthy.
Repository: flutter
Issue: Support multiple windows on iPad
Labels: platform-ios,tool,t: xcode,P3,team-ios,triaged-ios

## Use case
https://developer.apple.com/news/?id=01132020b

> Support for Multitasking on iPad is strongly encouraged. Adding support for multiple windows [...] will ensure your app delivers a modern and complete experience on iPadOS.

See desktop efforts at https://github.com/flutter/flutter/issues/30701
Catalyst support at https://github.com/flutter/flutter/issues/33860

- https://developer.apple.com/design/human-interface-guidelines/ios/system-capabilities/multiple-windows/
- https://developer.apple.com/videos/play/wwdc2019/212
Repository: pytorch
Issue: Can't import torch on latest master
Labels: module: build,triaged

## 🐛 Bug

```
(/scratch/rzou/pt/master-env) [0] rzou@devfair0317:/scratch/rzou/pt/master (master) $ python
Python 3.7.5 (default, Oct 25 2019, 15:51:11)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/scratch/rzou/pt/master/torch/__init__.py", line 106, in <module>
    _load_global_deps()
  File "/scratch/rzou/pt/master/torch/__init__.py", line 64, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/scratch/rzou/pt/master-env/lib/python3.7/ctypes/__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /private/home/rzou/local/miniconda3/lib/libmpichcxx.so.3: undefined symbol: __cxa_pure_virtual
```

## To Reproduce

Steps to reproduce the behavior:

1. check out pytorch at 4a26bb9b18
1. build pytorch 
1. import torch

## Additional context

Deleting libmpichcxx.so from `miniconda3/lib/` and rebuilding pytorch seems to solve the problem, but I don't know where libmpichcxx.so came from at all
Repository: rust
Issue: Sealed traits for rustdoc
Labels: T-rustdoc,A-trait-system,C-feature-request,A-rustdoc-ui,T-rustdoc-frontend

In #67562, it was proposed to make `trait Any` an unsafe trait. This was ultimately rejected, as we do not currently want downstream users to see that it is unsafe. However, we wanted a way to have both. The suggestion is that rustdoc could have an (unstable, for now) attribute that indicates that a trait is "sealed," in the sense that no upstream impls are permitted.

rustdoc would then show this trait as unimplementable. It would not show any unsafety on the trait (as it is then irrelevant to readers of the documentation).

See https://github.com/rust-lang/rust/pull/67562#issuecomment-572102876, https://github.com/rust-lang/rust/pull/67562#issuecomment-572909100.
Repository: pytorch
Issue: dist.send/recv "IndexError: map::at" error when bool tensors are used with mpi backend
Labels: triaged,module: boolean tensor

## 🐛 Bug

I am building a model parallel MLP network and as a method to accelerate it, I am trying to minimize communication between nodes as much as possible. So I have the need to communicate a bool (instead of torch.int8 which works fine) tensor between nodes. For this I am using pytorch with ompi (with ucx and gdrcopy). But I get "IndexError: map::at" error when bool tensors are used. However I dont get this when gloo backend is used. Appreciate if you could have a look at it.

## To Reproduce
```
import os
import torch
import torch.distributed as dist
from torch.multiprocessing import Process

world_size = 2

def run(rank, size):
  if rank == 0:
    x = torch.tensor([1,1], dtype=torch.bool)
    dist.send(x, 1)
  if rank != 0:
    t = torch.zeros(2, dtype=torch.bool)
    dist.recv(t, 0)


def init_process(rank, size, fn, backend='mpi'):
  os.environ['MASTER_ADDR'] = '127.0.0.1'
  os.environ['MASTER_PORT'] = '29500'
  dist.init_process_group(backend, rank=rank, world_size=size)
  fn(rank, size)

if __name__ == "__main__":
  processes = []
  for rank in range(world_size):
    p = Process(target=init_process, args=(rank, world_size, run))
    p.start()
    processes.append(p)

  for p in processes:
    p.join()
```

## Environment
PyTorch version: 1.4.0a0+a54dc87
Is debug build: No
CUDA used to build PyTorch: 10.1

OS: Ubuntu 18.04.2 LTS
GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
CMake version: version 3.14.0

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.1.243
GPU models and configuration: GPU 0: GeForce GTX 850M
Nvidia driver version: 435.21
cuDNN version: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.7.6.4

Versions of relevant libraries:
[pip3] numpy==1.13.3
[conda] blas                      1.0                         mkl  
[conda] magma-cuda101             2.5.1                         1    pytorch
[conda] mkl                       2019.4                      243  
[conda] mkl-include               2019.4                      243  
[conda] mkl-service               2.3.0            py37he904b0f_0  
[conda] mkl_fft                   1.0.15           py37ha843d7b_0  
[conda] mkl_random                1.1.0            py37hd6b4f25_0  
[conda] mkldnn                    0.16.1                        0    mingfeima
[conda] torch                     1.4.0a0+a54dc87          pypi_0    pypi
[conda] torchvision               0.5.0a0+61763fa          pypi_0    pypi


cc @izdeby
Repository: create-react-app
Issue: Allow to import a CRA app as a node.js package
Labels: issue: proposal,needs triage

### Is your proposal related to a problem?

> Sometimes, you start a project as an "app", and it perfectly fits. But then, later, your app grows, and what was an "app" before becomes a "module" within a bigger app. 
> 
> And at this point you may get stuck because you can't import that "module" as a node dependency, and **that can be a real blocker for product growth**.

This has potential to be more and more a real blocker, especially because of universal apps (like Next.js) that could have the ability to "just import" CRA apps, but can't, because of this CRA's limitation.

### Describe the solution you'd like

Assuming I write a CRA app `my-cra-app`, and I want to use this app in another node.js project - _such as Next.s_ -, I'd like to import it that way:

```tsx
import MyApp from 'my-cra-app'; // The CRA app loaded as a node.js module
import React from 'react';

const MyCustomCraApp: React.FunctionComponent<Props> = (props: Props): JSX.Element => {
  const { prop2 } = props;

  return (
    <MyApp
      prop1={true}
      prop2={prop2}
    />
  );
};

type Props = {
  prop2: string;
}

export default MyCustomCraApp;

```

### Describe alternatives you've considered

At the moment, the only possibility is to load a CRA app on the browser-side. Meaning loading the CSS and JS files in the <head> section, and creating a DOM element that matches the element where gets injected the CRA app.

I haven't found any solution to load a CRA app as a node.js module, and it's therefore not SSR compatible. (loading has to happens on the client side)

### Additional context

Discussed with the community at https://spectrum.chat/create-react-app/general/how-to-convert-a-cra-app-into-a-package~23fd401e-ebb4-409f-9c8f-599fdddb0882

I don't know if it's technically doable, nor how hard it might be.
Repository: pytorch
Issue: [Feature proposal] improved algorithms for checkpointing
Labels: feature,triaged


## Feature

We would like to propose a replacement for `torch/utils/checkpointing.py` which provides more efficient checkpointing strategies. We already have a working prototype called `rotor`, and available [on our gitlab](https://gitlab.inria.fr/hiepacs/rotor). We are opening an issue to discuss the opportunity to include `rotor` into `torch/utils`, as well as the possible changes to the code that this would require.

## Motivation

The checkpointing strategy available in `torch/utils/checkpoint.py` are not optimal: as mentioned in [this comment](https://github.com/pytorch/pytorch/pull/4594#pullrequestreview-88079144), more efficient strategies would allow faster training times for a given memory usage. Additionnally, the number of segments used in `checkpoint.py` needs to be hand-tuned, whereas it would be more practical to specify a limit on memory usage.

## Pitch 

Just like in `checkpoint.py`, our code only handles `nn.Sequential` types of networks. We start with performing measures of time and memory usage of each module in the sequence on a sample input. Then, given a memory limit, we compute provably optimal strategies with a dynamic programming algorithm. The resulting strategy is then implemented in a way which is similar to what is done in `checkpoint.py`.

Our working prototype is called `rotor`, and is available [on our gitlab](https://gitlab.inria.fr/hiepacs/rotor). The README file of the project provides a sample code to explain its basic usage. The algorithms used in our code and an experimental evaluation based on the models of torchvision are described in [our research report](https://hal.inria.fr/hal-02352969). 

## Notes on the current version

* The code is not yet sufficiently documented and tested, we have plans to improve on that, but wanted to discuss this feature proposal during this time.
	
* Just like `torch/utils/checkpoint.py`, our code preserves RNG states by default at each checkpoint, and restores it during the backward phase.
Repository: rust
Issue: Expand `unreachable_code` lint to support detecting unreachable code after panicking.
Labels: A-lints,T-lang,T-compiler,C-feature-request

This seems a useful lint, but I'm not sure whether this is implementable in `clippy`.
Repository: TypeScript
Issue: Object is possibly null inside a closure defined within a const constraint
Labels: Suggestion,In Discussion

Search: Object is possibly null, narrowed type, type constraint, closure

**Code**

```ts
const foo: string | null = 'bar'
if (foo) {
    function baz() {
        console.log(foo.length)  // Object is possibly 'null'
    }
}
```

**Expected behavior:**

Compiles

**Actual behavior:**

```
const foo: string | null
Object is possibly 'null'
```

**Playground Link:** 

[Playground](https://www.typescriptlang.org/play/?ts=Nightly#code/MYewdgzgLgBAZiEAuG0BOBLMBzGAfGMAVwBsSYBeGAcgCMBDNagKAzhgAoEQBKGAb2Yxh8ImGBQM4GAwBeHPoJHKYoSCBIBTAHQkQ2Lol2acUABY8hIgL7NrQA)

**Related Issues:**

#12113, #33319, #9998

**Discussion:**

By design, type narrowings are reset inside closures. This makes sense, but there is one case where better assumptions can be made: when the closure is defined inside a type constraint block AND the type narrowing is based on a `const` value. Even if called from async, the closure is still referencing a const and was created after a suitable type constraint occurred.

Thoughts?
Repository: go
Issue: cmd/go: dylib on macos with rpath fails to run with go run/test
Labels: OS-Darwin,NeedsInvestigation

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.13.6 darwin/amd64
</pre>

### What version of macOS are you using (`go version`)?

<pre>
$ sw_vers -productVersion
10.15.2
</pre>

### Does this issue reproduce with the latest release?
Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/eric/Library/Caches/go-build"
GOENV="/Users/eric/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/eric/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/v4/m6f6w8h54j58bp8q4h_138180000gn/T/go-build216040480=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?
When trying to run a simple go source file that links against an rpath based dylib, it fails to run with either `go run` or `go test` on 1.13.6. However, doing `go build` followed by running the executable works fine. It also works fine when I build go and test it from the `go1.13.6` tag. It also works in go 1.13.5 but from looking at the commits between the two, I cannot find an issue. This leads me to believe that however the 1.13.6 was built on google servers introduced some kind of issue.

A repro with a makefile is located at https://github.com/edaniels/go1136dylibissue.

### What did you expect to see?
I expected to see a log output of `2` from:

```
LD_LIBRARY_PATH=`pwd`/dylib/lib go run github.com/edaniels/go1136dylibissue/cmd
```


### What did you see instead?
```
dyld: Library not loaded: @rpath/libfoo.dylib
  Referenced from: /var/folders/v4/m6f6w8h54j58bp8q4h_138180000gn/T/go-build330381377/b001/exe/cmd
  Reason: image not found
signal: abort trap
```