Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Kevin's local build directory being shown? #21

Closed
exegeteio opened this issue Apr 28, 2024 · 3 comments · Fixed by #24
Closed

Kevin's local build directory being shown? #21

exegeteio opened this issue Apr 28, 2024 · 3 comments · Fixed by #24

Comments

@exegeteio
Copy link

It appears that the folder on @kevinmcconnell 's machine where the app was built is being output when the go app errors out:

$ bundle exec thrust ./app.rb
{"time":"2024-04-28T12:25:33.26878-07:00","level":"INFO","msg":"Server started","http":":80"}
{"time":"2024-04-28T12:25:33.269463-07:00","level":"INFO","msg":"Server stopping"}
{"time":"2024-04-28T12:25:33.26952-07:00","level":"INFO","msg":"Server stopped"}
panic: fork/exec ./app.rb: permission denied

goroutine 1 [running]:
github.com/basecamp/thruster/internal.(*Service).Run(0x1400003ff20)
        /Users/kevin/Work/basecamp/thruster/internal/service.go:40 +0x2a4
main.main()                                                                                                                     /Users/kevin/Work/basecamp/thruster/cmd/thrust/main.go:25 +0x94```

In my case, `app.rb` is not executable and I should have used `thrust ruby ./app.rb`.  I did find it rather worrying to see Kevin's home directory when I trued to run the command, though.

Not swish enough with Go to suggest a fix here.  But if anyone has suggestions of what to Google for, I'd love to contribute a PR.
@kevinmcconnell
Copy link
Collaborator

Hi @exegeteio, it’s default Go behaviour to include the source paths in stack traces during a panic. I don’t think it’s really a problem in this case, but I agree it can be surprising.

I’ll update the makefile to trim those paths out of the release builds (there’s a compiler flag to do that). Thanks for bringing this up!

@kevinmcconnell
Copy link
Collaborator

kevinmcconnell commented Apr 28, 2024

But if anyone has suggestions of what to Google for, I'd love to contribute a PR.

Oops sorry, missed that part on first read! If you fancy taking a stab at this, take a look at the -trimpath flag for go build. I think we’ll want to add that in the Makefile. The dist target is what’s used to make release builds.

@kevinmcconnell
Copy link
Collaborator

@exegeteio I've also added #22, for the related issue that we shouldn't be showing a stack trace in this situation anyway (regardless of what's in that stack trace).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants