[GHC] #9698: GHC_PACKAGE_PATH should be more lenient for empty paths

GHC ghc-devs at haskell.org
Wed Nov 19 23:03:02 UTC 2014


#9698: GHC_PACKAGE_PATH should be more lenient for empty paths
-------------------------------------+-------------------------------------
              Reporter:  Fuuzetsu    |            Owner:
                  Type:  feature     |           Status:  patch
  request                            |        Milestone:
              Priority:  normal      |          Version:  7.8.3
             Component:  ghc-pkg     |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:  #2521
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:  Phab:D414   |
-------------------------------------+-------------------------------------

Comment (by Austin Seipp <austin@…>):

 In [changeset:"6fc78fdfa1482a31ed7b586f20c9d7cb592ea944/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="6fc78fdfa1482a31ed7b586f20c9d7cb592ea944"
 Refactor: use System.FilePath.splitSearchPath

 Summary:
 To address #2521 ("Trailing colon on GHC_PACKAGE_PATH doesn't work with
 ghc-pkg"), we were using a custom version of splitSearchPath (e4f46f5de).
 This
 solution however caused issue #9698 ("GHC_PACKAGE_PATH should be more
 lenient
 for empty paths").

 This patch reverts back to System.FilePath.splitSearchPath (fixes #9698)
 and
 adresses (#2521) by testing for a trailing search path separators
 explicitly
 (instead of implicitly using empty search path elements).

 Empty paths are now allowed (ignored on Windows, interpreted as current
 directory on Posix systems), and trailing path separator still tack on the
 user and system package databases.

 Also update submodule filepath, which has a version of splitSearchPath
 which
 handles quotes in the same way as our custom version did.

 Test Plan:
 $ GHC_PACKAGE_PATH=/::/home: ./ghc-pkg list
 ...
 db stack: ["/",".","/home","<userdb>","<systemdb>"]
 ...

 Reviewers: austin

 Reviewed By: austin

 Subscribers: thomie, carter, simonmar

 Differential Revision: https://phabricator.haskell.org/D414

 GHC Trac Issues: #2521, #9698
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9698#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list