Hi, I have a problem with the go backend and the `...
# general
l
Hi, I have a problem with the go backend and the
-ltrace
does not provide any information. If I run
pants test src/go/module/some_test.go
the execution stops at
Prepare Go test binary
. Did anyone have a similar issue. For me it seems like it has something to do with certain dependencies being imported. In my case the open policy agent sdk. If I run the tests directly with the go cli everything works as expected.
g
Anything in
pants.d/exceptions.log
? When you say "stops at", does it seem to crash?
l
No it does not crash. It just runs the timer up. No logs. The
exceptions.log
file is also empty.
g
I'd try running with
--keep-sandboxes=always
and looking in the last sandbox it points at. There should be a
__run.sh
in there that you could try running and see what it outputs. There's also
--no-pantsd --no-local-cache
in case there's a cache issue, but it'll give you massive amounts of logs and make things very slow.
Oh, just to double-check: What version of Pants are you running on?
l
I run on
2.17
What I saw in the log file of the run is:
Copy code
10:47:45.93 [DEBUG] Launching 1 roots (poll=true).
10:47:46.45 [DEBUG] Launching 1 roots (poll=true).
10:47:46.98 [DEBUG] Launching 1 roots (poll=true).
10:47:47.28 [35m[TRACE][0m Canceled: select
10:47:47.28 [32m[DEBUG][0m Canceled: `test` goal
I will try your hints.
g
Interesting, wonder why it cancels the test goal. If you run
pants test src/go/module::
does it run any tests?
l
Sry that was me
I just repeats the
[Debug]
line until I cancel
g
Ah, right
So it doesn't actually exit either, it just stops doing work?
l
It is launching 1 roots, I guess. No idea what that means.
I ran:
pants --print-stacktrace --keep-sandboxes=always --no-pantsd --no-local-cache test
The last sandbox created is:
12:56:21.81 [INFO] Preserving local process execution dir /private/var/folders/tz/fnc3x59j4f9fhq4q09yk_fl00000gn/T/pants-sandbox-4tR6hc for Create embed mapping for crypto/internal/nistec
The output of `__run.sh`is :
{"EmbedConfig":{"Patterns":{"p256_asm_table.bin":["p256_asm_table.bin"]},"Files":{"p256_asm_table.bin":"/usr/local/go/src/crypto/internal/nistec/p256_asm_table.bin"}}}
Running
go test -v ./...
in the module works perfectly fine. I am not sure how to further debug this. I guess I need to create a repo to reproduce this issue.
g
That's always helpful, and an issue on Pants GitHub too. I'm not too familiar with the go test support in Pants so don't have much more to add beyond these generic steps.
1
l
h
Thanks for the repro repo, that is gold standard