`System.Environment.getEnv` fails in alpine-3.12 and ghc-9.2.1
Summary
System.Environment.getEnv "PATH"
fails in alpine-3.12 and ghc-9.2.1 with
PATH: getEnv: does not exist (no environment variable)
in a fresh alpine-3.12 virtual machine and ghc-9.2.1 installed with ghcup
The bug has been discovered in the haskell-lanaguage-server ci (https://github.com/jneira/haskell-language-server/actions/runs/1726024910 / https://github.com/haskell/haskell-language-server/pull/2615) where we've noted:
- With the same alpine container image all tested ghcs < 9.2.1 work
- With the same github workflow ubuntu-18.02 works for ghc 9.2.1
Steps to reproduce
https://user-images.githubusercontent.com/54035/150512698-fd444d01-5034-4109-8652-1ec417e37b06.png
The concrete env var does not matter, it happens with $USER, $HOME and other vars known to be set in the environment
Expected behavior
System.Environment.getEnv
should return the PATH
env var value
Environment
- GHC version used: 9.2.1
Optional:
- Operating System: Alpine linux 3.12
- System Architecture: x86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information