Crash in Getting Started with Go codelab, step 9 (Adding third-party dependencies)
After following the instructions in steps 1-8, on step 9 I encountered a crash:
$ plz run ///go//tools/please_go -- get github.com/stretchr/[email protected]
Building [0/1, 0.0s]:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x77d1c8]
goroutine 1 [running]:
main.main()
tools/please_go/please_go.go:222 +0x68
I've seen this on two different systems, both running Ubuntu 24.10.
$ plz --version
Please version 17.12.5
Continuing the codelab with the go_repo statements in the instructions works fine -- the problem is just in getting the dependencies with please_go -- get.
After seeing the deletion in please_go, I tried using puku fmt and got good results. I guess this is what the codelab should be suggesting now. The existing text is:
"To add third party dependencies to Please, the easiest way is to use ///go//tools:please_go to resolve them, and then add them to third_party/go/BUILD. Let's add github.com/stretchr/testify:"
This issue has been automatically marked as stale because it has not had any recent activity in the past 90 days. It will be closed if no further activity occurs. If you require additional support, please reply to this message. Thank you for your contributions.
Thank you for your question. go_module() is now deprecated. The current, preferred method for adding new Go dependencies involves using the standard Go tooling, followed by a Please synchronization command:
go get XX && puku sync -w
This fetches the dependency and synchronizes with please.
The new codelab with Puku Sync is under review and will be published soon.