please icon indicating copy to clipboard operation
please copied to clipboard

Crash in Getting Started with Go codelab, step 9 (Adding third-party dependencies)

Open timburks opened this issue 1 year ago • 3 comments

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.

timburks avatar Nov 26 '24 00:11 timburks

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:"

timburks avatar Nov 26 '24 06:11 timburks

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.

stale[bot] avatar Apr 26 '25 00:04 stale[bot]

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.

scyyx5 avatar Nov 10 '25 09:11 scyyx5