[GHC] #13753: Improve GHC's ghc package environment lookup logic

#13753: Improve GHC's ghc package environment lookup logic -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: 8.2.2 Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Documentation for package enviroments which describes the current lookup logic: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/packages.htm... #package-environments There's two things I'd like to improve: 1. Define a special magic "null" environment, which instructs GHC to ignore any package environment files. To this end, I propose to use the name `-` (i.e. a single dash), as that is more portable than using the empty string for environment variables. In other words: * `-package-env -` or * `GHC_ENVIRONMENT=-` (unless a `-package-env` flag which has higher priority overrides it) would prevent GHC from interpreting any package environment files. 2. Provide a way to disambiguate environment names (i.e. those that are looked up in `$HOME/.ghc/arch-os-version/environments/name`) and environment files arguments. Currently, if you say `GHC_ENVIRONMENT=test` then a local file `test` would shadow the environment named `test` which would result in rather confusing errors. Instead I suggest to have package-env identifiers be interpreted as "names" by default, and only if they look like relative or absolute paths (i.e. `./foobar` or `/home/foo/...`) be interpreted as file locations (relative to $CWD). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13753 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13753: Improve GHC's ghc package environment lookup logic -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.2.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: RyanGlScott (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13753#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13753: Improve GHC's ghc package environment lookup logic -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.2.2 => 8.4.1 Comment: It doesn't look like this will happen for 8.2.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13753#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13753: Improve GHC's ghc package environment lookup logic -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by gershomb): Along with this, GHC and GHCI should always notify when loading with a package-env file. The default lookup paths make it too easy to accidentally run with a file when you don't realize you are, causing potentially strange behavior. Now that cabal new-* commands generate these files by default, I imagine there will be many people confused by this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13753#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13753: Improve GHC's ghc package environment lookup logic -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by gershomb): And one other note -- if the env file points to bad/missing stuff, GHC should emit an error that points to the env file as the source of the problem! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13753#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13753: Improve GHC's ghc package environment lookup logic -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by hvr): I've created #15145 to track the notification feature, for which I have already a working patch which I'll upload asap to Phab for further discussion. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13753#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13753: Improve GHC's ghc package environment lookup logic -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4690 Wiki Page: | -------------------------------------+------------------------------------- Changes (by hvr): * differential: => Phab:D4690 Comment: Phab:D4690 implements the first half of this feature request, i.e. the ability to opt out from the package environment feature. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13753#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13753: Improve GHC's ghc package environment lookup logic -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4690 Wiki Page: | -------------------------------------+------------------------------------- Changes (by int-e): * cc: int-e (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13753#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13753: Improve GHC's ghc package environment lookup logic
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4690
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13753: Improve GHC's ghc package environment lookup logic -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4690 Wiki Page: | -------------------------------------+------------------------------------- Comment (by refold): Just to clarify: Ben's [https://ghc.haskell.org/trac/ghc/ticket/13753#comment:10 latest comment] refers to the second part of the ticket, the [https://ghc.haskell.org/trac/ghc/ticket/13753#comment:9 `-package-env -` patch] will be in 8.6. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13753#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13753: Improve GHC's ghc package environment lookup logic -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4690 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): comment:9 has been backported to `ghc-8.4` in 026d908f56c05d1f02df688816278c479872212b. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13753#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC