Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#221 Introduced unused-imports warnings which lead to failures in GHC #224

Closed
BinderDavid opened this issue Nov 27, 2023 · 7 comments · Fixed by #225
Closed

#221 Introduced unused-imports warnings which lead to failures in GHC #224

BinderDavid opened this issue Nov 27, 2023 · 7 comments · Fixed by #225

Comments

@BinderDavid
Copy link
Contributor

I think #221 introduced some code which generates "unused-imports" warnings when compiled with GHC. This leads to the fact that the submodule within GHC cannot be updated, since -Werror is enabled. I observed this in the following pipeline: https://gitlab.haskell.org/ghc/ghc/-/jobs/1722073

===> Command failed with error code: 1
_build\stage1\libraries\Win32\build\System\Win32\WindowsString\Console.hs:67:1: error: [GHC-66111] [-Wunused-imports, Werror=unused-imports]
    The import of `Graphics.Win32.Misc' is redundant
      except perhaps to import instances from `Graphics.Win32.Misc'
    To import instances alone, use: import Graphics.Win32.Misc()
   |
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
_build\stage1\libraries\Win32\build\System\Win32\WindowsString\Console.hs:68:1: error: [GHC-66111] [-Wunused-imports, Werror=unused-imports]
    The import of `Graphics.Win32.GDI.Types' is redundant
      except perhaps to import instances from `Graphics.Win32.GDI.Types'
    To import instances alone, use: import Graphics.Win32.GDI.Types()
   |
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_build\stage1\libraries\Win32\build\System\Win32\WindowsString\Console.hs:70:1: error: [GHC-66111] [-Wunused-imports, Werror=unused-imports]
    The import of `Foreign.C.Types' is redundant
      except perhaps to import instances from `Foreign.C.Types'
    To import instances alone, use: import Foreign.C.Types()
   |
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_build\stage1\libraries\Win32\build\System\Win32\WindowsString\Console.hs:71:1: error: [GHC-66111] [-Wunused-imports, Werror=unused-imports]
    The import of `Foreign.C.String' is redundant
      except perhaps to import instances from `Foreign.C.String'
    To import instances alone, use: import Foreign.C.String()
   |
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_build\stage1\libraries\Win32\build\System\Win32\WindowsString\Console.hs:72:1: error: [GHC-66111] [-Wunused-imports, Werror=unused-imports]
    The import of `Foreign.Ptr' is redundant
      except perhaps to import instances from `Foreign.Ptr'
    To import instances alone, use: import Foreign.Ptr()
   |
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_build\stage1\libraries\Win32\build\System\Win32\WindowsString\Console.hs:74:42: error: [GHC-38856] [-Wunused-imports, Werror=unused-imports]
    The import of `pokeArray'
    from module `Foreign.Marshal.Array' is redundant
   |
   |                                          ^^^^^^^^^
@BinderDavid
Copy link
Contributor Author

BinderDavid commented Nov 28, 2023

Also #221 seems to have introduced a dependency on os-string which is not reflected in the cabal file. The appveyor CI reports this error for my #223

https://ci.appveyor.com/project/Mistuke/win32-5ec4k/builds/48620220/job/414ddky2omugv629

System\Win32\WindowsString\Types.hsc:41:1: error:
    Could not load module `System.OsString.Windows'
    It is a member of the hidden package `os-string-2.0.0'.
    Perhaps you need to add `os-string' to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
41 | import System.OsString.Windows
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
System\Win32\WindowsString\Types.hsc:42:1: error:
    Could not load module `System.OsString.Internal.Types'
    It is a member of the hidden package `os-string-2.0.0'.
    Perhaps you need to add `os-string' to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
42 | import System.OsString.Internal.Types
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
System\Win32\WindowsString\Types.hsc:43:1: error:
    Could not find module `System.OsPath.Data.ByteString.Short.Word16'
    Perhaps you meant
      System.OsString.Data.ByteString.Short.Word16 (needs flag -package-id os-string-2.0.0)
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
43 | import System.OsPath.Data.ByteString.Short.Word16 (
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
Error: cabal.exe: Failed to build Win32-2.13.4.0

I think this repo might also be missing branch protection for master?
Ping @hasufell : You recently also worked on this repo.

@hasufell
Copy link
Member

Also #221 seems to have introduced a dependency on os-string which is not reflected in the cabal file.

It does not. You simply have to depend on filepath < 1.5.

@hasufell
Copy link
Member

That said, this library has to be updated to work with filepath >= 1.5.

See #222

@BinderDavid
Copy link
Contributor Author

It does not. You simply have to depend on filepath < 1.5.

Does this mean that in the meantime we have to add an upper bound on the filepath dependency? Because the failure occurs in the CI of this repo, not in some project of mine.

@hasufell
Copy link
Member

It does not. You simply have to depend on filepath < 1.5.

Does this mean that in the meantime we have to add an upper bound on the filepath dependency? Because the failure occurs in the CI of this repo, not in some project of mine.

Yes

@BinderDavid BinderDavid mentioned this issue Nov 28, 2023
@Mistuke
Copy link
Contributor

Mistuke commented Nov 28, 2023

It does not. You simply have to depend on filepath < 1.5.

Does this mean that in the meantime we have to add an upper bound on the filepath dependency? Because the failure occurs in the CI of this repo, not in some project of mine.

I think we can ask a hackage trustee to modify the bounds so CI and projects don't break.

@BinderDavid
Copy link
Contributor Author

I think we can ask a hackage trustee to modify the bounds so CI and projects don't break.

As a package maintainer you should have the rights to do metadata revisions yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants