sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: TSC fails to emit required files when run below node_modules
Labels: Suggestion,In Discussion

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.2.0-dev.20181107

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** node_modules

**Code**


`/tmp/node_modules/tsc-test/tsconfig.json`
```json
{
  "compilerOptions": {
    "outDir": "dist"
  },
  "files": [
    "src/index.ts"
  ]
}
```

`/tmp/node_modules/tsc-test/src/index.ts`
```ts
import { A } from './A';

export const main = () => {
  console.log('A=', A);
};
```

`/tmp/node_modules/tsc-test/src/A.ts`
```ts
export const A = 'A';
```

**Expected behavior:**

Output files:

- `/tmp/node_modules/tsc-test/dist/index.js`
- `/tmp/node_modules/tsc-test/dist/A.js`

**Actual behavior:**

Output files:

`/tmp/node_modules/tsc-test/dist/index.js`
```js
"use strict";
exports.__esModule = true;
var A_1 = require("./A");
exports.main = function () {
    console.log('A=', A_1.A);
};
```

_No `A.js` is output_

**Notes:**

I wanted to build a typescript project as part of an npm postinstall script, to enable installation from npm or from git.  In the case of installation from npmjs, `dist/` will already exist.  In the case of installation from git, `dist/` will be missing and build will be run.

After setting this up, I noticed that only files listed in my tsconfig `files` list were being emitted when installing from git.  I looked around for tsconfig or tsc options that may change this behavior, but realized it probably had to do with `'node_modules'` being in the path.

I debugged the issue by modifying the built `tsc.js`.  In my case, the problematic code is in `nodeModuleNameResolverWorker/tryResolve`, specifically [here](https://github.com/Microsoft/TypeScript/blob/b534fb4849eca0a792199fb6c0cb8849fece1cfd/src/compiler/moduleNameResolver.ts#L918:L921):
```ts
const { path: candidate, parts } = normalizePathAndParts(combinePaths(containingDirectory, moduleName));
const resolved = nodeLoadModuleByRelativeName(extensions, candidate, /*onlyRecordFailures*/ false, state, /*considerPackageJson*/ true);
// Treat explicit "node_modules" import as an external library import.
return resolved && toSearchResult({ resolved, isExternalLibraryImport: contains(parts, "node_modules") });
```

The call to `contains(parts, "node_modules")` should likely consider the project root directory, and ignore `"node_modules"` in the path parts above the root.
Repository: pytorch
Issue: Error in building Caffe2 on Windows (experimental operators)
Labels: caffe2

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->
Error in building Caffe2 under Windows 10 with enabled GPU and Python Bindings.
## To Reproduce

Steps to reproduce the behavior:

1. Followed the manual for building from source under Windows using Visual Studio 2015 v3.
2. Enabled Cuda and Python Bindings ensuring the correct MSVC is selected.
3. Run the script build_windows.bat.
Same results by manually running CMake and then building the solution

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->
96 Errors in generating Caffe2.lib.
Starting like that and following a similar pattern for the remaining errors.

(ClCompile target) ->
         D:\Libraries\pytorch\c10/util/TypeList.h(160): error C2938: 'extract_type_t<unknown-type>' : Failed to special
       ize alias template (compiling source file D:\Libraries\pytorch\caffe2\operators\experimental\c10\schemas\add.cc)
        [D:\Libraries\pytorch\build\caffe2\caffe2.vcxproj]
         D:\Libraries\pytorch\c10/util/TypeList.h(160): error C3546: '...': there are no parameter packs available to e
       xpand (compiling source file D:\Libraries\pytorch\caffe2\operators\experimental\c10\schemas\add.cc) [D:\Librarie
       s\pytorch\build\caffe2\caffe2.vcxproj]
         D:\Libraries\pytorch\caffe2/core/operator_c10wrapper.h(54): error C3203: 'typelist': unspecialized class templ
       ate can't be used as a template argument for template parameter 'TypeList', expected a real type (compiling sour
       ce file D:\Libraries\pytorch\caffe2\operators\experimental\c10\schemas\add.cc) [D:\Libraries\pytorch\build\caffe
       2\caffe2.vcxproj]
         D:\Libraries\pytorch\c10/util/TypeList.h(42): error C2338: In typelist::to_tuple<T>, T must be typelist<...>.
       (compiling source file D:\Libraries\pytorch\caffe2\operators\experimental\c10\schemas\add.cc) [D:\Libraries\pyto
       rch\build\caffe2\caffe2.vcxproj]
         D:\Libraries\pytorch\caffe2/core/operator_c10wrapper.h(54): error C2794: 'type': is not a member of any direct
        or indirect base class of 'c10::guts::typelist::to_tuple<int>' (compiling source file D:\Libraries\pytorch\caff
       e2\operators\experimental\c10\schemas\add.cc) [D:\Libraries\pytorch\build\caffe2\caffe2.vcxproj]
         D:\Libraries\pytorch\caffe2/core/operator_c10wrapper.h(54): error C2938: 'to_tuple_t<int>' : Failed to special
       ize alias template (compiling source file D:\Libraries\pytorch\caffe2\operators\experimental\c10\schemas\add.cc)
        [D:\Libraries\pytorch\build\caffe2\caffe2.vcxproj]
## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->
Produce Caffe2.lib

## Environment
 - Caffe2 Version Number 0.8.2
 - Windows 10 Home x64
 - Source
 - Both manually with CMake and running build_windows.bat
 - Python 2.7.14 x64
 - Cuda 9.2 with CuDNN 7.2.1.38
 - Nvidia GeForce GTX 1060 
 - CMake 3.12.4
Repository: terminal
Issue: Three problems displaying End User Defined Characters in Windows Console
Labels: Product-Conhost,Area-Rendering,Area-Output,Issue-Bug

The first problem is that the top of the character is truncated.
The second problem is that they occupy two display cells.
The third problem is that they are displayed overlapping.

To reproduce:
 Run the MS supplied Private Character Editor "C:\Windows\System32\eudcedit.exe".
Draw two lines using the straight line tool from one corner to the opposite corner. Draw a box around the border using the hollow rectangle tool. Save the character either for all fonts.
Run the MS supplied Character Map app "C:\Windows\System32\charmap.exe". Select "All fonts (Private Characters), select the character created in the previous step, and then click copy. 
Open cmd.exe type "REM" and then paste the character several times onto the same line. Press <return>
type REM and type "0123456789" for comparison.
![capture](https://user-images.githubusercontent.com/20423143/48266926-c46b6f00-e428-11e8-875b-0bbdc18a28e2.PNG)
It should be noted that copying and pasting other characters such as the Unicode box drawing glyphs display correctly. 
I am using Windows 10 build 1803, all current updates applied.
Repository: flutter
Issue: Emojis on keyboard
Labels: a: text input,c: new feature,platform-android,framework,engine,P2,team-android,triaged-android

Hello, I have a problem with the Emojis on Android Keyboard.

The thing is:
In the TextField I must insert a UserName, emojis are not allowed. Besides this while using the Android keyboard the emojis button appear and is available, but in iOS keyboard it does not appear. 

Maybe is not a bug, but I think is a good idea add some TextInputType to choose if add Emojis button or not and it should  be consistent between both systems whether you can insert Emojis or not.

Thanx
Repository: rust
Issue: Confusing error message when trying to implement a shared mutable state
Labels: C-enhancement,A-diagnostics,T-compiler

Let's say I am a rust beginner coming from another language, and I want to write a simple multi-threaded program in rust.

So I write this simple function : 

```rust
fn simple() -> u8 {
    let mut x = 0;
    std::thread::spawn(|| {
        x += 1;
    });
    x += 1;
    x
}
```

One of the selling points of rust is being able to prevent data races, so it should be able to explain in details what is wrong with this function. However, it gives a confusing error message.

It does not compile, and the compiler returns : 
> closure may outlive the current function, but it borrows `x`, which is owned by the current function
> help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword

And if I look up the detailed error message in the error book (here: https://doc.rust-lang.org/error-index.html#E0373), it also tells me to add a `move` in front of the closure.

I think this is confusing. Obviously, the right thing to do here is to use a mutex, but this is not mentioned neither in the error message, nor in the error book.

Maybe the error should also say something like

> If you need to use `x` both in the current function and in the closure, than you may have to use a form of [shared state concurrency](https://doc.rust-lang.org/book/second-edition/ch16-03-shared-state.html)

It would be even nicer if the compiler could detect that we are using `x` after the litigious function, and thus not talk about `move` at all.
Repository: flutter
Issue: UiKitViews breaks group opacity into 2 groups
Labels: platform-ios,engine,a: platform-views,P2,team-ios,triaged-ios

The opacity is applied separately to the render objects that are before the platform view and to the ones that are after it.
Repository: pytorch
Issue: torch.linspace does not check for infinity and nan
Labels: module: error checking,triaged,module: tensor creation

*UPDATED*:
```
>>> torch.linspace(1.175494351e-38, float('nan'),steps=30)
tensor([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
        nan, nan, nan, nan, nan, nan])
>>> torch.linspace(1.175494351e-38, float('inf'),steps=30)
tensor([nan, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf,
        inf, inf, inf, inf, inf, inf])
```

*OUTDATED*:
```python
import torch

print(torch.arange(0, float('+inf')).shape)
# torch.Size([-9223372036854775808])

print(torch.__version__)
# 1.0.0a0+9d9e5f8

```

cc @gchanan @mruberry
Repository: go
Issue: cmd/compile: refine calcHasCall's handling of ODIV and OMOD
Labels: Suggested,NeedsFix,compiler/runtime

@cherrymui noted in the review of CL 148837 that on non-soft-float platforms, when working with floats, ODIV and OMOD won't panic. We should handle them a bit more precisely in `calcHasCall`.
Repository: TypeScript
Issue: Expose compiler option allowNonTsExtensions
Labels: Suggestion,In Discussion

## Search Terms

allowNonTsExtensions

## Suggestion

Make `allowNonTsExtensions` from
https://github.com/Microsoft/TypeScript/blob/0010a38660b1eb03c188c9c1758177b4501760b7/src/compiler/types.ts#L4480
public / not-internal

## Use Cases

The Monaco Editor requires usage of this compiler option for in-memory TypeScript / JavaScript editors.

## Examples

https://github.com/Microsoft/monaco-editor/blob/35f3f99ff251744eabe4dfbff8535288e363933d/test/playground.generated/extending-language-services-configure-javascript-defaults.html#L53

## Checklist

My suggestion meets these guidelines:

* [✔️] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [✔️] This wouldn't change the runtime behavior of existing JavaScript code
* [✔️] This could be implemented without emitting different JS based on the types of the expressions
* [✔️] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [?] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: TypeScript
Issue: Allow minimal type checking of JavaScript files
Labels: Suggestion,In Discussion,Domain: JavaScript,Add a Flag

I'm in the process of introducing TypeScript support into an enormous, 6-year old web application with a *lot* of JavaScript files. In order to get the most advantages out of TypeScript while we slowly migrate over (which will likely happen slowly), I'd like the following to be true:

- TypeScript files (`.ts` and `.tsx`) are type checked with `strict: true`, so that we get as much useful feedback about TS code as possible.
- JavaScript code that imports and then incorrectly uses typed TypeScript code throws a TS error
- Other TypeScript errors in JavaScript files are suppressed, because we haven't had the chance to migrate the file to TypeScript yet. OR, at the least, JavaScript files are type checked with `strict: false` to minimize the number of errors they output.

## Primary Suggestion

It would be fantastic if typescript had a `"minimalCheckJs"` config option that, when set to true, would only check JS files for errors on imported typed code. For example, setting `"minimalCheckJs": true, "strict": true` in `tsconfig.json` would have this effect:

```javascript
# moduleA.ts
function hello(msg) {} # throws "no implicit any" error on "msg" arg

export default function logA(msg: string) {
  console.log(msg);
}

# moduleB.js
import logA from './moduleA'
import something from './someJavaScriptFile.js' # does not throw "cannot find module" error

logA(1) # throws TS error, because logA is typed

function logB(msg) { # does not show "no implicit any" error on "msg" arg
  console.log(msg);
}
```

This feature would allow me to convert a file from JS to TS, add types to the file, and immediately be assured that the exported code is being used correctly throughout my entire code base (including JS files). Currently, I can set `"checkJs": true`, but then I will see *thousands* of other kinds of errors that TypeScript finds in the JS files, such as `cannot find module` errors.

## Alternative Suggestion

If the above feature is difficult to implement, a less ideal but also helpful feature would be to allow setting `"strict": false` for JS files and `"strict": true` for TS files. Some way to combine the following:

```json
# strictly type check TS files
{
  "compilerOptions": {
    "checkJs": false,
    "allowJs": true,
    "strict": true
  },
  "include": ["**/*.ts", "**/*.tsx"],
}

# type check JS files with strict: false
{
  "compilerOptions": {
    "checkJs": true,
    "allowJs": true,
    "strict": false
  },
  "include": ["**/*.js", "**/*.jsx"],
}
```
Repository: go
Issue: runtime: repeated syscalls inhibit periodic preemption
Labels: Performance,NeedsInvestigation,compiler/runtime

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

    go version go1.11 darwin/amd64

### 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
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/benesch/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/benesch/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
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/tw/njf8lc695t70f1lkhts5d0nr0000gn/T/go-build056467710=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?

Ran the following program repeatedly.

```go
package cgotest

// #include <unistd.h>
import "C"

import (
	"context"
	"math/rand"
	// "runtime"
	"sync"
	"testing"
	"time"
)

func test27660(t *testing.T) {
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()
	ints := make([]int, 100)
	locks := make([]sync.Mutex, 100)
	// Slowly create threads so that ThreadSanitizer is forced to
	// frequently resize its SyncClocks.
	for i := 0; i < 100; i++ {
		go func() {
			for ctx.Err() == nil {
				// Sleep in C for long enough that it is likely that the runtime
				// will retake this goroutine's currently wired P.
				C.usleep(1000 /* 1ms */)
				// runtime.Gosched()
			}
		}()
		go func() {
			// Trigger lots of synchronization and memory reads/writes to
			// increase the likelihood that the race described in #27660
			// results in corruption of ThreadSanitizer's internal state
			// and thus an assertion failure or segfault.
			for ctx.Err() == nil {
				j := rand.Intn(100)
				locks[j].Lock()
				ints[j]++
				locks[j].Unlock()
			}
		}()
		time.Sleep(time.Millisecond)
	}
}
```

The program usually completes in 100ms, but occasionally takes upwards of 60s, and sometimes more than 10m (i.e., maybe it never completes). It appears to be caused by the scheduler starving out the outer goroutine, as uncommenting the runtime.Gosched call makes the test pass reliably in under 60s.

It's possible that this is #10958, but I think that the call to `ctx.Err()` should allow for preemption, as should the call into cgo. I'm filing as a separate bug so I have an issue to reference when I add this test in http://golang.org/cl/148717. I'll dig a little deeper in a bit.

/cc @dvyukov
Repository: TypeScript
Issue: Feature Request: type for Arguments OF Function
Labels: Suggestion,In Discussion

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please read the FAQ first, especially the "Common Feature Requests" section.

-->

## Search Terms

<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->

## Suggestion

<!-- A summary of what you'd like to see added or changed -->

current typescript support `...args`
but when we use

```ts
declare function a(x: number, y: number) : number
declare function a(x: number, s: string) : string

a(...[1, 2]) // => Error: TS2556: Expected 2 arguments, but got 0 or more.
```

will get error

## Use Cases

<!--
What do you want to use this for?
What shortcomings exist with current approaches?
-->

## Examples

```ts
declare function a(x: number, y: number) : number
declare function a(x: number, s: string) : string
```

Actual behavior:

```ts
a(...[1, 2]) // => Error: TS2556: Expected 2 arguments, but got 0 or more.
```

### type `ArgumentsOFFunction<T extends Function>`

a type can let typescript know this is args array of target function
> notice:  this type is not exists

Expected behavior:

```ts
let args1: ArgumentsOFFunction<typeof a> = [x = 1, s = ''];
let args2: ArgumentsOFFunction<typeof a> = [x = 1, y = 2];
let args3: ArgumentsOFFunction<typeof a> = ['1', 2]; // trigger a ts error => Error: TS2345: Argument of type '"1"' is not assignable to parameter of type 'number'.

a(...args1) // => string
a(...args2) // => number

a(1, 'str') // => string
a(1, 2) // => number

a('1', 2) // trigger a ts error => Error: TS2345: Argument of type '"1"' is not assignable to parameter of type 'number'.

declare function b(...args: ArgumentsOFFunction<typeof a>) : boolean

b(...args1) // => boolean
b(...args2) // => boolean

b(1, 'str') // => boolean
b(1, 2) // => boolean

b('1', 2) // trigger a ts error => Error: TS2345: Argument of type '"1"' is not assignable to parameter of type 'number'.
```

<!-- Show how this would be used and what the behavior would be -->

## Checklist

My suggestion meets these guidelines:

* [ ] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [ ] This wouldn't change the runtime behavior of existing JavaScript code
* [ ] This could be implemented without emitting different JS based on the types of the expressions
* [ ] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [ ] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: scrcpy
Issue: OpenGL Integration
Labels: question,opengl

This is purely speculation on my part, but would it be possible to pass the decoding through OpenGL on the computer side? The reason for this... use [Reshade!](https://github.com/crosire/reshade)

There are some really exceptional [filters](https://github.com/crosire/reshade-shaders/tree/master/Shaders) available in Reshade, and it would only require that the stream pass through OpenGL (or Win only DX9+). Some of the filters (i.e. ambient occlusion) require a true 3D rendered scene, but most of the others are just post-processors that don't require the actual 3D. They do, however, use the graphics card texture processing to do the filter and can be quite fast.

Notably, [SMAA](https://github.com/crosire/reshade-shaders/blob/master/Shaders/SMAA.fxh) is a very capable AA filter that can use color/luma in addition to depth buffer to find edges. We can't have depth buffer in this case, but could still have "true" AA as opposed to FXAA.
Repository: flutter
Issue: [google_maps_flutter] Support Widgets as markers
Labels: c: new feature,customer: crowd,p: maps,package,c: proposal,team-ecosystem,P3,triaged-ecosystem

It would be very handy to allow markers on the google maps to be flutter widgets. I know that currently there is already a method to load an image from assets but this is a static marker.

Overlaying a widget as a marker allows for dynamic generation of markers (example: rating of location on the map)
Repository: pytorch
Issue: Feature request: von Mises-Fisher distribution
Labels: module: distributions,triaged

## 🚀 Feature
<!-- A clear and concise description of the feature proposal -->
There should be a von Mises-Fisher distribution in torch.distributions. 

## Motivation
It is very important to have those directional distributions when you want to do research related to directional statistics for machine learning. For example, von Mises-Fisher will be very useful for modeling unit length vectors. See paper https://arxiv.org/pdf/1804.00891.pdf 

## Additional context
TensorFlow has the von Mises-Fisher distribution. https://github.com/tensorflow/tensorflow/issues/6141

Here is also an implementation of von Mises-Fisher in pytorch (using scipy, without GPU support) https://github.com/nicola-decao/s-vae-pytorch/tree/master/hyperspherical_vae/distributions
<!-- Add any other context or screenshots about the feature request here. -->

cc @vincentqb @fritzo @neerajprad @alicanb @vishwakftw
Repository: terminal
Issue: MiniTerm: ProcessFactory.Start is hard-coded to run "cmd.exe" and ignores intended parameter
Labels: Work-Item,Help Wanted,Area-Interop,Product-Conpty,Issue-Samples

See:

https://github.com/Microsoft/console/blob/34ff272cfa5b49dcb0bbe7aaec41797d9c285e5e/samples/ConPTY/MiniTerm/MiniTerm/Processes/ProcessFactory.cs#L21