This commit is contained in:
Joey Hess 2021-12-31 11:17:26 -04:00
parent df269b2f8f
commit b60a041e9e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -0,0 +1,26 @@
[[!comment format=mdwn
username="joey"
subject="""comment 1"""
date="2021-12-31T15:05:40Z"
content="""
It seems that somehow it is failing to set environment variables. Eg,
`GIT_INDEX_FILE` is what makes git use `.git/annex/index` and if it was not
set it would behave as you describe.
This strongly suggests that there is a bug in the compiler/libraries.
Here is a small test program:
import System.Environment
import System.Process
main = do
let p = (proc "sh" ["-c", "echo testing: $TEST"])
let p' = p { env = Just [("TEST", "foo")] }
withCreateProcess p' $ \_ _ _ pid -> waitForProcess pid
setEnv "TEST" "bar"
withCreateProcess p $ \_ _ _ pid -> waitForProcess pid
If run with "runghc foo.hs", that should output "testing: foo" and then
"testing: bar".
"""]]