[GHC] #9698: GHC_PACKAGE_PATH should be more lenient for empty paths
#9698: GHC_PACKAGE_PATH should be more lenient for empty paths -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Consider a working {{{GHC_PACKAGE_PATH=foo:bar:baz:}}}. It is not uncommon that we would want to append som extra vars later which might possibly be empty, perhaps resulting in {{{GHC_PACKAGE_PATH=foo:bar:baz::qux:}}}. Unfortunately, due to the {{{::}}} GHC tries to looking for a package at the empty path and shows the usual error about not being able to find the package. This forces the user to set up various safeguards (such as {{{${GHC_PACKAGE_PATH:+:} }}} bashism) at the inital binding location. It'd be great if GHC would simply skip over empty paths. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9698> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9698: GHC_PACKAGE_PATH should be more lenient for empty paths -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: feature | Status: new 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: | -------------------------------------+------------------------------------- Changes (by thomie): * component: Compiler => ghc-pkg * related: => #2521 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9698#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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 | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => patch * differential: => Phab:D414 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9698#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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
#9698: GHC_PACKAGE_PATH should be more lenient for empty paths -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: feature | Status: closed request | Milestone: 7.10.1 Priority: normal | Version: 7.8.3 Component: ghc-pkg | Keywords: Resolution: fixed | 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 | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed * milestone: => 7.10.1 Comment: Merged, thanks! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9698#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC