-
Notifications
You must be signed in to change notification settings - Fork 763
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
gopls: spawns cc1 processes on file save when using imports that use cgo #268
Comments
@stamblerre @heschik What is the current status of cgo support in the language server? My understanding is completely avoiding invocation of cgo tool and c compilation isn't |
Heschi can probably speak to this a bit more than I can, but significant progress has been made for users of Go 1.15. |
For a program that doesn't directly use cgo, cgo compilation should only happen once, but it has to completely finish. Until it does, each save will probably kick off a new compilation process. Note that each of those are running the same compilation step with different working directories. By now I would expect this to be resolved. If not, please run |
@heschik it's actually happening for each file which references a file which includes that dependency (i.e. a main.go file that references that InstagoMainWindow.go file). So every time I create a new file it will keep my CPU busy for ~a minute. Though yes, after it finishes it will not spawn cc1 processes anymore. Can't this process, which is highly expensive CPU-wise, be queued and executed asynchronously, so that you can keep on saving and working? |
Then the most likely explanation is that compilation is failing each time. Have you run |
@heschik you can find a repro case here:
git clone [email protected]:elegos/instago.git
cd instago
git checkout feature/gui
pushd source/gui
make setup
popd
code . Then open |
I have successfully built qt projects before, but this one fails with a missing symbol: I noticed that the You still haven't answered my question. Does |
Hello @heschik Yes, As for the submodule, it was not my intention, but apparently the chain tool used to build the solution including the library (provided by the library itself) is cumbersome to say the least and didn't allow me to specify the main package rather than the root of the project. I'll try to make one unique go module (in the root of the project) and, if successful, see if there are differences in VSCode. |
@elegos: Were you able to resolve this issue? Is it OK to close this? |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gocode -v
orcode-insiders -v
to get version of VS Code or VS Code Insidersgo env
to get the go development environment detailsShare the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
Whenever I try to save my go sources that import a dependency which makes use of cgo, the file save is blocked until all the
cc1
instances that have been spawned (using 100% of a thread each) end, which usually takes ~10 secondsSteps to reproduce the behavior:
ps aux
command):Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.
The text was updated successfully, but these errors were encountered: