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

internal error: package "context" without types was imported #255

Closed
Tracked by #91
remyleone opened this issue Mar 31, 2022 · 6 comments · Fixed by #270
Closed
Tracked by #91

internal error: package "context" without types was imported #255

remyleone opened this issue Mar 31, 2022 · 6 comments · Fixed by #270
Assignees
Labels
dependencies Pull requests that update a dependency file
Milestone

Comments

@remyleone
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

tfproviderlint and terraform-plugin-sdk Version

$ tfproviderlint -version
tfproviderlint v0.28.1

$  go mod graph | cut -d' ' -f 1 | grep terraform-plugin-sdk | uniq
github.com/hashicorp/terraform-plugin-sdk/[email protected]

$ go version
go version go1.18 darwin/amd64

Affected Check(s) or Function(s)

  • AT###

Expected Behavior

The program runs.

Actual Behavior

$ tfproviderlint run ./...
tfproviderlint: internal error: package "context" without types was imported from "github.com/scaleway/terraform-provider-scaleway/v2/scaleway"

You can use the master branch and it reproduces: https://github.com/scaleway/terraform-provider-scaleway

@bflad
Copy link
Owner

bflad commented Mar 31, 2022

Potentially similar in nature to ent/ent#2155 where updating x/tools in this repository might fix some Go 1.18 handling.

@remyleone
Copy link
Author

remyleone commented Apr 4, 2022

@bflad #256 I was not sure what was your workflow with a vendor folder so I just updated the go.mod and vendor.modules.txt

@remyleone
Copy link
Author

Would you consider adding dependabot to this repository? If you are interested, I can provide you with a merge request :)

@davewongillies
Copy link

I get this same error too, but with a different package (its an internal project, so the URL is redacted, sorry):

$ tfproviderlint ./...
tfproviderlint: internal error: package "crypto/tls" without types was imported from "<redacted>"

@bflad bflad self-assigned this Apr 8, 2022
@bflad bflad added the dependencies Pull requests that update a dependency file label Apr 8, 2022
@bflad bflad added this to the v0.29.0 milestone Apr 8, 2022
@bflad
Copy link
Owner

bflad commented Apr 8, 2022

Would you consider adding dependabot to this repository?

Normally, I'd be all for this (and actually, I was caught off guard myself that it was not already in place), although I'm leery of introducing it though since I specifically want this project to not force terraform-plugin-sdk dependency upgrades on folks. I'd rather have this module's dependencies only tracking the minimum versions where possible there. I guess the best compromise in this scenario might be to create a dependabot configuration which explicitly ignores those two dependencies with comments explaining why they are ignored. I guess we'll also see how "noisy" x/tools updates become.

tobio added a commit to elastic/terraform-provider-ec that referenced this issue Aug 29, 2022
tobio added a commit to elastic/terraform-provider-ec that referenced this issue Aug 29, 2022
tobio added a commit to elastic/terraform-provider-ec that referenced this issue Aug 29, 2022
* Bump golang to 1.19

* Bump golangci-lint for 1.19 support

* Lint/Format

* Ignore tfproviderlint until bflad/tfproviderlint#255 is fixed

* Bump golang in CI
ShiChangkuo added a commit to ShiChangkuo/terraform-provider-huaweicloud that referenced this issue Oct 20, 2022
Ignoring bflad/tfproviderlint until bflad/tfproviderlint#255 is fixed...
using ShiChangkuo/tfproviderlint instead
ShiChangkuo added a commit to huaweicloud/terraform-provider-huaweicloud that referenced this issue Oct 20, 2022
* chore: bump terraform-plugin-sdk to v2.24.0

* ci: update tfproviderlint job

Ignoring bflad/tfproviderlint until bflad/tfproviderlint#255 is fixed...
using ShiChangkuo/tfproviderlint instead

* update README
manicminer added a commit to hashicorp/terraform-provider-azuread that referenced this issue Nov 18, 2022
manicminer added a commit to hashicorp/terraform-provider-azurerm that referenced this issue Nov 19, 2022
manicminer added a commit to hashicorp/terraform-provider-azurerm that referenced this issue Nov 19, 2022
favoretti pushed a commit to favoretti/terraform-provider-azurerm that referenced this issue Jan 12, 2023
@jimeh
Copy link
Contributor

jimeh commented Jan 26, 2023

Any updates on when/how this might be resolved? :)

jimeh added a commit to krystal/terraform-provider-katapult that referenced this issue Jan 26, 2023
Once the following issue is resolved, we can re-eanble it again:

- bflad/tfproviderlint#255
jimeh added a commit to krystal/terraform-provider-katapult that referenced this issue Jan 26, 2023
Once the following issue is resolved, we can re-eanble it again:

- bflad/tfproviderlint#255
bflad added a commit that referenced this issue Apr 13, 2023
Reference: #255
Reference: golang/go#56494

Manual upgrade due to prior Go panic:

```console
$ go get golang.org/x/[email protected]
panic: internal error: can't find reason for requirement on golang.org/x/[email protected]

goroutine 1 [running]:
cmd/go/internal/modget.(*resolver).updateBuildList.func1({{0x1400043ed80, 0x13}, {0x140000c2e70, 0x22}})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/internal/modget/get.go:1760 +0xc4
cmd/go/internal/modget.(*resolver).updateBuildList(0x1400007e000, {0x100f55398, 0x1400009e000}, {0x0, 0x0, 0x0})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/internal/modget/get.go:1765 +0x41c
cmd/go/internal/modget.(*resolver).resolveQueries(0x1400007e000, {0x100f55398, 0x1400009e000}, {0x140000b0090, 0x1, 0x10126bde0?})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/internal/modget/get.go:1243 +0x148
cmd/go/internal/modget.runGet({0x100f55398, 0x1400009e000}, 0x140000b8600?, {0x1400009a1a0, 0x1, 0x1})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/internal/modget/get.go:314 +0x38c
main.invoke(0x10125e3c0, {0x1400009a190, 0x2, 0x2})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/main.go:225 +0x37c
main.main()
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/main.go:179 +0x7cc
```

Updated via:

```shell
go get golang.org/x/crypto@latest # panic workaround
go get golang.org/x/[email protected]
go mod tidy
go mod vendor
```

Introduces `xpasses/XR007` and `xpasses/XR008` test skips due to `golang.org/x/tools` now properly returning an error with invalid source files. This is expected with the suggested fixes implementation since those will intentionally remove source code, leaving the source code in an unbuildable state to encourage the developer to figure out the rest of the necessary solution.
bflad added a commit that referenced this issue Apr 13, 2023
Reference: #255
Reference: golang/go#56494

Manual upgrade due to prior Go panic:

```console
$ go get golang.org/x/[email protected]
panic: internal error: can't find reason for requirement on golang.org/x/[email protected]

goroutine 1 [running]:
cmd/go/internal/modget.(*resolver).updateBuildList.func1({{0x1400043ed80, 0x13}, {0x140000c2e70, 0x22}})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/internal/modget/get.go:1760 +0xc4
cmd/go/internal/modget.(*resolver).updateBuildList(0x1400007e000, {0x100f55398, 0x1400009e000}, {0x0, 0x0, 0x0})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/internal/modget/get.go:1765 +0x41c
cmd/go/internal/modget.(*resolver).resolveQueries(0x1400007e000, {0x100f55398, 0x1400009e000}, {0x140000b0090, 0x1, 0x10126bde0?})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/internal/modget/get.go:1243 +0x148
cmd/go/internal/modget.runGet({0x100f55398, 0x1400009e000}, 0x140000b8600?, {0x1400009a1a0, 0x1, 0x1})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/internal/modget/get.go:314 +0x38c
main.invoke(0x10125e3c0, {0x1400009a190, 0x2, 0x2})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/main.go:225 +0x37c
main.main()
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/cmd/go/main.go:179 +0x7cc
```

Updated via:

```shell
go get golang.org/x/crypto@latest # panic workaround
go get golang.org/x/[email protected]
go mod tidy
go mod vendor
```

Introduces `xpasses/XR007` and `xpasses/XR008` test skips due to `golang.org/x/tools` now properly returning an error with invalid source files. This is expected with the suggested fixes implementation since those will intentionally remove source code, leaving the source code in an unbuildable state to encourage the developer to figure out the rest of the necessary solution.
karencfv added a commit to oxidecomputer/terraform-provider-oxide that referenced this issue Apr 27, 2023
karencfv added a commit to oxidecomputer/terraform-provider-oxide that referenced this issue Apr 27, 2023
This commit implements a lint, build and test pipeline as well as the initial piece for a release pipeline.

Now that bflad/tfproviderlint#255 has been closed, we can fully implement all linters as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
4 participants