x/tools/cmd/gorename: takes 20s+ for a package that imports cgo package #26821
Labels
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
gorename
is not usable for the program pasted below. That program imports a package that is build in cgo mode.The reason for this is the way gorename deals with cgo file. It processes them with the co preprocessor. The example below leads to this command being run (that takes 24 seconds):
go tool cgo -objdir /var/folders/km/50gy6_q557v6_7vxbf9b29v00000gn/T/github.com_veandco_go-sdl2_sdl_C598351148 -- -D_THREAD_SAFE -I/opt/local/include/SDL2 -I /var/folders/km/50gy6_q557v6_7vxbf9b29v00000gn/T/github.com_veandco_go-sdl2_sdl_C598351148 audio.go blendmode.go clipboard.go cpuinfo.go endian.go error.go events.go filesystem.go gamecontroller.go gesture.go haptic.go hints.go joystick.go keyboard.go keycode.go loadso.go log.go mouse.go mutex.go pixels.go power.go rect.go render.go rwops.go scancode.go sdl.go sdl_cgo.go surface.go sysrender.go syswm.go timer.go touch.go version.go video.go
It's been called from parsePackageFiles of x/tools/go/loader/loader.go
I think it's a problem of
go/loader
.@alandonovan, is there a way to fix this? I would be glad to tackle it.
The text was updated successfully, but these errors were encountered: