Skip to content

ExecutablePath.hsc import cleanup in the #else case

Greg Steuck requested to merge blackgnezdo/ghc:execpath-imports into master

As of d8d6ad8c we get unneeded imports failing the build on OpenBSD:

_build/stage1/libraries/ghc-internal/build/GHC/Internal/System/Environment/ExecutablePath.hs:43:1: error: [GHC-66111] [-Wunused-imports, Werror=unused-imports]
The import of ‘GHC.Internal.Real’ is redundant
except perhaps to import instances from ‘GHC.Internal.Real’
To import instances alone, use: import GHC.Internal.Real()
|
43 | import GHC.Internal.Real
| ^^^^^^^^^^^^^^^^^^^^^^^^

libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc:100:1: error: [GHC-66111] [-Wunused-imports, Werror=unused-imports]
The import of ‘GHC.Internal.Foreign.C.Error’ is redundant
except perhaps to import instances from ‘GHC.Internal.Foreign.C.Error’
To import instances alone, use: import GHC.Internal.Foreign.C.Error()
|
100 | import GHC.Internal.Foreign.C.Error
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I replicated the first import into all the branches where it should be and remove the other one which is unused.

I confirmed that this works on ghc-9.10 branch. Please backport.

Merge request reports