Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,259
    • Issues 5,259
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 565
    • Merge requests 565
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #1838
Closed
Open
Issue created Nov 06, 2007 by guest@trac-guest

do not use getEnv "HOME", use System.Directory.getHomeDirectory

[i've set component to ghci, but this isn't limited to ghci]

i was wondering where ghci was looking for ~/.ghci on windows, because that doesn't seem to work for me, unless i run ghcii.sh under cygwin, inheriting cygwin's HOME environment variable.

my win/xp doesn't have %HOME%, the closest i can find in the docs are %HOMEDRIVE% and %HOMEPATH%. there is some special casing in System.Directory.getHomeDirectory, which seems to follow a different route via a C helper, but ends up with the same result (here a session with a plain windows ghci 6.6.1, but the code hasn't changed in head):

Prelude> System.Environment.getEnv "HOME"
*** Exception: HOME: getEnv: does not exist (no environment variable)
Prelude> System.Environment.getEnv "HOMEPATH"
"\\Documents and Settings\\cr3"
Prelude> System.Environment.getEnv "HOMEDRIVE"
"C:"
Prelude> System.Directory.getHomeDirectory
"C:\\Documents and Settings\\cr3"

the main culprit seems to be compiler/ghci/InteractiveUI.hs, with 2 cases. there also seem to be several instances of Compat/Directory.hs, in compat/, in libraries/bootstrapping.Cabal/Distribution/, and in libraries/Cabal/Distribution/.

could the ghci uses (and possibly the Compat uses as well?) please be replaced with uses of System.Directory.getHomeDirectory?

Trac metadata
Trac field Value
Version 6.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC claus.reinke@talk21.com
Operating system
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking