Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/kfulint: type checking error on stdlib packages #54

Closed
quasilyte opened this issue May 10, 2018 · 2 comments
Closed

cmd/kfulint: type checking error on stdlib packages #54

quasilyte opened this issue May 10, 2018 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@quasilyte
Copy link
Member

quasilyte commented May 10, 2018

Many stdlib packages cause linter to give up with type checking error.
Most likely, it's because we run Check incorrectly (maybe we should consider build tags or something).

Here is output for math package:

./bin/kfulint -dir=$GOROOT/src/math
skip math: type check error: $GOROOTsrc/math/sincos_386.go:13:6: Sincos redeclared in this block
skip math_test: type check error: $GOROOTsrc/math/all_test.go:3557:7: undeclared name: SqrtGo

There are many other packages with similar problem:

  • runtime (re-definitions of symbols)
  • net (imports "C")
  • net/http (undeclared name)

Other peculiar errors:

bufio:
scan_test.go:408:10: invalid operation: scanner (variable of type *bufio.Scanner) has no field or method MaxTokenSize

bytes:
bytes_test.go:577:31: undeclared name: EqualPortable

context:
context/x_test.go:29:58: undeclared name: XTestDeadlineExceededSupportsTimeout

crypto:
ase/cipher_ppc64le.go:27:6: encryptBlockAsm redeclared in this block
crypto/rand/rand_js.go:9:8: could not import syscall/js (can't find import: "syscall/js")
rc4/rc4_asm.go:13:18: method XORKeyStream already declared for type Cipher struct{s [256]uint32; i uint8; j uint8}
x509/root_darwin_arm_gen.go:38:6: main redeclared in this block
x509/root_cgo_darwin.go:221:8: could not import C (can't find import: "C")

These issues may be related or not.
This needs investigation.

@quasilyte quasilyte added the bug Something isn't working label May 10, 2018
@quasilyte quasilyte added this to the v0.2 milestone May 10, 2018
@fexolm
Copy link
Contributor

fexolm commented May 10, 2018

It might be because we don't handle packages. So some types from other packages seems undeclarated.

@quasilyte
Copy link
Member Author

quasilyte commented May 10, 2018

It's not very urgent, but we must fix this.

quasilyte added a commit that referenced this issue May 10, 2018
This required to change dir-oriented approach to package-oriented.
kfulint now accepts package paths (well, import paths)
instead of directory paths.

Sanity tests are updated to import packages with fewer dependencies.
This helps to avoid big increase in test time.
(loader can be quite slow for packages with lots of imports.)

Fixes #54
quasilyte pushed a commit that referenced this issue May 12, 2018
This required to change dir-oriented approach to package-oriented.
kfulint now accepts package paths (well, import paths)
instead of directory paths.

Sanity tests are updated to import packages with fewer dependencies.
This helps to avoid big increase in test time.
(loader can be quite slow for packages with lots of imports.)

Fixes #54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants