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

Does not build on Windows #3

Closed
mpilgrem opened this issue Apr 20, 2022 · 1 comment
Closed

Does not build on Windows #3

mpilgrem opened this issue Apr 20, 2022 · 1 comment

Comments

@mpilgrem
Copy link

Building on Windows 11 (with stack version 2.7.5 and lts-19.4 (GHC 9.0.2)) fails with:

brotli> configure (lib)
Configuring brotli-0.0.0.0...
brotli> build (lib)
Preprocessing library for brotli-0.0.0.0..
Building library for brotli-0.0.0.0..
brotli> copy/register
Installing library in C:\Users\mikep\Documents\Code\GitHub\brotli\.stack-work\install\9e456e06\lib\x86_64-windows-ghc-9.0.2\brotli-0.0.0.0-HH3BgkM1KFnCoH8s0HSlFJ
Registering library for brotli-0.0.0.0..
Cabal-simple_Z6RU0evB_3.4.1.0_ghc-9.0.2.exe:
'C:\Users\mikep\AppData\Local\Programs\stack\x86_64-windows\ghc-9.0.2\bin\ghc-pkg-9.0.2.exe'
exited with an error:
brotli-0.0.0.0: Warning: haddock-interfaces:
C:\Users\mikep\Documents\Code\GitHub\brotli\.stack-work\install\9e456e06\doc\brotli-0.0.0.0\brotli.haddock
doesn't exist or isn't a file
brotli-0.0.0.0: library-dirs: /mingw64/lib is a relative path which makes no
sense (as there is nothing for it to be relative to). You can make paths
relative to the package database itself by using ${pkgroot}. (use --force to
override)
brotli-0.0.0.0: dynamic-library-dirs: /mingw64/lib is a relative path which
makes no sense (as there is nothing for it to be relative to). You can make
paths relative to the package database itself by using ${pkgroot}. (use
--force to override)


--  While building package brotli-0.0.0.0 (scroll up to its section to see the error) using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.4.1.0_ghc-9.0.2.exe --builddir=.stack-work\dist\d53b6a14 register
    Process exited with code: ExitFailure 1

This appears to be due to part of brotli.cabal, namely pkgconfig-depends: libbrotlienc, libbrotlidec. If I replace that in a local fork of the package with extra-libraries: libbrotlienc, libbrotlidec, it builds as expected. I will submit a pull request, accordingly.

@mpilgrem
Copy link
Author

This may, somehow, have been due to there being another MSYS2 set up on my machine. Having now deleted it, and relying only on the stack-supplied MSYS2, I can't repeat the problem. Key steps (extracts only of outputs):

> stack unpack brotli
> cd brotli-0.0.0.0
> stack init
> stack exec -- pacman -S mingw-w64-x86_64-pkg-config
> stack exec -- pkg-config --variable=pc_path pkg-config
C:\Users\mikep\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\lib\pkgconfig;C:\Users\mikep\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\share\pkgconfig
> stack exec -- pacman -S mingw-w64-x86_64-brotli
> stack build
...
Installing library in C:\Users\mikep\Documents\Code\Haskell\brotli-0.0.0.0\.stack-work\install\4a3b70df\lib\x86_64-windows-ghc-9.0.2\brotli-0.0.0.0-HH3BgkM1KFnCoH8s0HSlFJ
Registering library for brotli-0.0.0.0..

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

No branches or pull requests

1 participant