Re: [go-nuts] Re: Changing PWD ruins test caching

2024-02-08 Thread Kevin Burke
You're right. I ended up inserting a shim to replace os/env.go in the standard library, that would dump the stack trace of anything that called os.Getenv("PWD"). It turns out that a popular testing library was doing this - https://github.com/onsi/ginkgo/issues/1355. On Thu, Feb 8, 2024 at 3:19 PM

Re: [go-nuts] Re: Changing PWD ruins test caching

2024-02-07 Thread Kevin Burke
Sorry for slow reply. We are using Alpine, which I don't think is either of those flavors. I discovered this by enabling GODEBUG=gocachehash=1, running the tests twice, and then checking the diff between the two test runs. On Tue, Nov 28, 2023 at 11:57 AM 'Bryan C. Mills' via golang-nuts < golang

[go-nuts] Re: Changing PWD ruins test caching

2023-11-28 Thread 'Bryan C. Mills' via golang-nuts
As far as I can tell the code in question is only built on AIX and OpenBSD — are you using one of those two platforms? If not, perhaps the caching problem is coming from somewhere else. That said, it does appear that calls to `os.Chdir` result in a spurious dependency on the PWD variable: https:

[go-nuts] Re: Changing PWD ruins test caching

2023-11-25 Thread Kevin Chowski
I haven't had this problem so this is a complete guess. But if PWD is the only env variable causing a problem, you could try hard coding it to a constant value (which would never match any real directory). That would allow the PWD to always be the same no matter which directory it was actually