[GHC] #14483: getExecutablePath from System.Environment in base should follow symlinks properly.

#14483: getExecutablePath from System.Environment in base should follow symlinks properly. -------------------------------------+------------------------------------- Reporter: angerman | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.3 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: -------------------------------------+------------------------------------- During the implementation of relocation capabilities in GHC for linux and macOS it came to light, that windows (which has had this support for quite some time), uses a custom implementation of `getExecutablePath`. Ideally this logic should be moved into `base`. Phyx- noted in D4121 that this should be possible for 8.6, as at that point Win32 should be new enough to be usable in base for this. The result would be that the custom code in GHC (SysTools) and the older copy in GhcPkg of the same code can be unified with the linux and macOS CPP conditional branch. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14483 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14483: getExecutablePath from System.Environment in base should follow symlinks properly. -------------------------------------+------------------------------------- Reporter: angerman | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.3 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 angerman): Just to elaborate what is to be done here: 1. Look at `getBaseDir :: IO (Maybe String)` in `compiler/main/SysTools.hs`, and integrate the symbolic link resolution logic from there in `getExecutablePath` in the `System.Environment` Module from the `base` package. 2. If the `MIN_VERSION_base(...)` is high enough, use `getExecutablePath` also on Windows in `compiler/main/SysTools.hs`, `utils/ghc-pkg/Main.hs` and `utils/hsc2hs/Main.hs`. It looks like this should be rather easy, but requires someone with some windows exposure. Testcases in the testsuite for `getExecutablePath` would be a great bonus! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14483#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14483: getExecutablePath from System.Environment in base should follow symlinks properly. -------------------------------------+------------------------------------- Reporter: angerman | Owner: alpmestan Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.3 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 alpmestan): * owner: (none) => alpmestan Comment: I'll give this a shot early next week. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14483#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14483: getExecutablePath from System.Environment in base should follow symlinks properly. -------------------------------------+------------------------------------- Reporter: angerman | Owner: alpmestan Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): D4227 Wiki Page: | -------------------------------------+------------------------------------- Changes (by alpmestan): * status: new => patch * differential: => D4227 Comment: I have a patch that improves the windows implementation of `getExecutablePath` so that it follows symlinks at https://phabricator.haskell.org/D4227 -- feedback welcome. This however does not change ghc, ghc-pkg and hsc2hs to use `getExecutablePath` (instead of the current duplicated code that does something equivalent). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14483#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14483: getExecutablePath from System.Environment in base should follow symlinks properly. -------------------------------------+------------------------------------- Reporter: angerman | Owner: alpmestan Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): D4227 Wiki Page: | -------------------------------------+------------------------------------- Comment (by alpmestan): And here is a patch in which I switch ghc/ghc-pkg to using `getExecutablePath` when built with a recent enough `base`: https://phabricator.haskell.org/D4229 Eventually, in a few major versions, we'll be able to get rid of the `base < 4.11` code path and simply use `getExecutablePath`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14483#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14483: getExecutablePath from System.Environment in base should follow symlinks
properly.
-------------------------------------+-------------------------------------
Reporter: angerman | Owner: alpmestan
Type: bug | Status: patch
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): D4227
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14483: getExecutablePath from System.Environment in base should follow symlinks properly. -------------------------------------+------------------------------------- Reporter: angerman | Owner: alpmestan Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): D4227 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14483#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14483: getExecutablePath from System.Environment in base should follow symlinks properly. -------------------------------------+------------------------------------- Reporter: angerman | Owner: alpmestan Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): D4227 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.6.1 => 8.4.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14483#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14483: getExecutablePath from System.Environment in base should follow symlinks
properly.
-------------------------------------+-------------------------------------
Reporter: angerman | Owner: alpmestan
Type: bug | Status: closed
Priority: normal | Milestone: 8.4.1
Component: Compiler | Version: 8.3
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): D4227
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Tamar Christina

#14483: getExecutablePath from System.Environment in base should follow symlinks properly. -------------------------------------+------------------------------------- Reporter: angerman | Owner: alpmestan Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): D4227 Wiki Page: | -------------------------------------+------------------------------------- Comment (by alpmestan): Thanks for picking this up, I've had to turn my attention to 2 urgent tasks lately, sorry for the delay! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14483#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC