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

Error importing a library when using the plugin #503

Closed
nisdas opened this issue Jan 28, 2019 · 9 comments
Closed

Error importing a library when using the plugin #503

nisdas opened this issue Jan 28, 2019 · 9 comments
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues lang: go Go rules integration P3 We're not considering working on this, but happy to review a PR. (No assignee) product: GoLand GoLand plugin type: bug

Comments

@nisdas
Copy link

nisdas commented Jan 28, 2019

Despite the libraries existing in my workspace , I keep on getting this error
Build constraints exclude all Go files in //path/to/library . I am not sure exactly how to interpret this error correctly as I have no issues importing other libraries. This has lead to syntax highlighting being red over all my source files as the ide keeps on showing the import as invalid.

To reproduce this issue locally:

  • Create a bazel project from this https://github.com/prysmaticlabs/prysm.
  • After syncing the project , open up any source file(ex : beacon-chain/blockchain/service.go) which imports this package:
    github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1
  • You will then get the error Build constraints exclude all Go files , which leads to syntax highlighting of any obejct used from that package being red as it is regarded as invalid.
@nisdas
Copy link
Author

nisdas commented Jan 28, 2019

Looks like #194 is related to this

@ewang
Copy link

ewang commented Feb 8, 2019

It works in IntelliJ, but not on GoLand 2018.3.3. Looks like GoLand isn't picking up the pb.go files that are generated by Bazel.

@ewang
Copy link

ewang commented Feb 8, 2019

@nisdas After further investigation, looks like IntelliJ with Go plugin doesn't enable Vgo support by default but GoLand does. Disabling Vgo support for the project in GoLand resolved the above issue for me.

@chaoren chaoren added the lang: go Go rules integration label Mar 4, 2019
@grefab
Copy link

grefab commented Mar 15, 2019

Same issue here. Enableing/disabling Vgo did not help (was not enabled by default in Goland for my project). This seems to only affect go libs that use cgo, since most of the imports are recognized correctly.

@cdelguercio
Copy link

Any update on this? I'm using GoLand 2019.2.5 and v2019.12.02 of the Bazel plugin.

@ranveermeemo
Copy link

+1 Still failing.

@riuvshyn
Copy link

riuvshyn commented Mar 1, 2021

I have same issue with

IntelliJ IDEA 2020.3.2 (Ultimate Edition)
Build #IU-203.7148.57, built on January 26, 2021
Licensed to ... Ltd / ...
Subscription is active until ...
Runtime version: 11.0.9.1+11-b1145.77 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: ParNew, ConcurrentMarkSweep
Memory: 4012M
Cores: 12
Non-Bundled Plugins: YAML/Ansible support, dk.lost_world.intellij-touch, org.intellij.plugins.hcl, org.jetbrains.plugins.go-template, org.jetbrains.kotlin, Pythonid, org.jetbrains.plugins.go

some libs are just are red in the editor however I can successfully build the project with no issues.

@sgowroji sgowroji added the awaiting-maintainer Awaiting review from Bazel team on issues label Nov 18, 2022
@blorente blorente added the P3 We're not considering working on this, but happy to review a PR. (No assignee) label Nov 22, 2022
@blorente
Copy link
Collaborator

blorente commented Dec 8, 2022

Could you try updating to the newest IntelliJ/GoLand, and updating the plugin? There's been quite a bit of work on .pb.go files lately.

@sgowroji
Copy link
Member

We are closing this issue now as it is fixed in the latest plugin and IDE releases. Please check and let us know , with complete steps, if you are still seeing the same observation. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues lang: go Go rules integration P3 We're not considering working on this, but happy to review a PR. (No assignee) product: GoLand GoLand plugin type: bug
Projects
None yet
Development

No branches or pull requests

10 participants