gitlib icon indicating copy to clipboard operation
gitlib copied to clipboard

Cannot build hlibgit2-0.18.0.13 on Windows

Open kuznero opened this issue 11 years ago • 2 comments

Building hlibgit2 on Windows

Building hlibgit2-0.18.0.13...
Preprocessing library hlibgit2-0.18.0.13...
[ 1 of 49] Compiling Bindings.Libgit2.Version ( dist\build\Bindings\Libgit2\Version.hs, dist\build\Bindings\Libgit2\Version.o )
[ 2 of 49] Compiling Bindings.Libgit2.Windows ( dist\build\Bindings\Libgit2\Windows.hs, dist\build\Bindings\Libgit2\Windows.o )

BindingsLibgit2Windows.hsc:7:6:
    Not in scope: type constructor or class `CUInt'

BindingsLibgit2Windows.hsc:8:10:
    Not in scope: type constructor or class `CUInt'

BindingsLibgit2Windows.hsc:9:6:
    Not in scope: type constructor or class `FunPtr'
    Perhaps you meant `Functor' (imported from Prelude)

BindingsLibgit2Windows.hsc:9:14:
    Not in scope: type constructor or class `CUInt'

BindingsLibgit2Windows.hsc:10:6:
    Not in scope: type constructor or class `FunPtr'
    Perhaps you meant `Functor' (imported from Prelude)

BindingsLibgit2Windows.hsc:10:18:
    Not in scope: type constructor or class `CUInt'

BindingsLibgit2Windows.hsc:11:6:
    Not in scope: type constructor or class `FunPtr'
    Perhaps you meant `Functor' (imported from Prelude)

Trying to fix it by modifying Bindings/Libgit2/Windows.hsc and adding missing (though Windows.hsc seams to be auto-generated by the ruby script) reference to common module:

import Bindings.Libgit2.Common

This time it goes further up until C code:

PS [GIT] C:\PRJ\KUZ\_temp\hlibgit2-0.18.0.13
λ cabal clean
cleaning...
PS [GIT] C:\PRJ\KUZ\_temp\hlibgit2-0.18.0.13
λ cabal configure; cabal build
Resolving dependencies...
Configuring hlibgit2-0.18.0.13...
Building hlibgit2-0.18.0.13...
Preprocessing library hlibgit2-0.18.0.13...
[ 1 of 49] Compiling Bindings.Libgit2.Version ( dist\build\Bindings\Libgit2\Version.hs, dist\build\Bindings\Libgit2\Version.o )
[ 2 of 49] Compiling Bindings.Libgit2.Common ( dist\build\Bindings\Libgit2\Common.hs, dist\build\Bindings\Libgit2\Common.o )
[ 3 of 49] Compiling Bindings.Libgit2.Errors ( dist\build\Bindings\Libgit2\Errors.hs, dist\build\Bindings\Libgit2\Errors.o )
[ 4 of 49] Compiling Bindings.Libgit2.Message ( dist\build\Bindings\Libgit2\Message.hs, dist\build\Bindings\Libgit2\Message.o )
[ 5 of 49] Compiling Bindings.Libgit2.Strarray ( dist\build\Bindings\Libgit2\Strarray.hs, dist\build\Bindings\Libgit2\Strarray.o )
[ 6 of 49] Compiling Bindings.Libgit2.Threads ( dist\build\Bindings\Libgit2\Threads.hs, dist\build\Bindings\Libgit2\Threads.o )
[ 7 of 49] Compiling Bindings.Libgit2.Types ( dist\build\Bindings\Libgit2\Types.hs, dist\build\Bindings\Libgit2\Types.o )
[ 8 of 49] Compiling Bindings.Libgit2.Config ( dist\build\Bindings\Libgit2\Config.hs, dist\build\Bindings\Libgit2\Config.o )
[ 9 of 49] Compiling Bindings.Libgit2.Ignore ( dist\build\Bindings\Libgit2\Ignore.hs, dist\build\Bindings\Libgit2\Ignore.o )
[10 of 49] Compiling Bindings.Libgit2.Oid ( dist\build\Bindings\Libgit2\Oid.hs, dist\build\Bindings\Libgit2\Oid.o )
[11 of 49] Compiling Bindings.Libgit2.Graph ( dist\build\Bindings\Libgit2\Graph.hs, dist\build\Bindings\Libgit2\Graph.o )
[12 of 49] Compiling Bindings.Libgit2.Indexer ( dist\build\Bindings\Libgit2\Indexer.hs, dist\build\Bindings\Libgit2\Indexer.o )
[13 of 49] Compiling Bindings.Libgit2.Index ( dist\build\Bindings\Libgit2\Index.hs, dist\build\Bindings\Libgit2\Index.o )
[14 of 49] Compiling Bindings.Libgit2.Merge ( dist\build\Bindings\Libgit2\Merge.hs, dist\build\Bindings\Libgit2\Merge.o )
[15 of 49] Compiling Bindings.Libgit2.Net ( dist\build\Bindings\Libgit2\Net.hs, dist\build\Bindings\Libgit2\Net.o )
[16 of 49] Compiling Bindings.Libgit2.Notes ( dist\build\Bindings\Libgit2\Notes.hs, dist\build\Bindings\Libgit2\Notes.o )
[17 of 49] Compiling Bindings.Libgit2.Object ( dist\build\Bindings\Libgit2\Object.hs, dist\build\Bindings\Libgit2\Object.o )
[18 of 49] Compiling Bindings.Libgit2.OdbBackend ( dist\build\Bindings\Libgit2\OdbBackend.hs, dist\build\Bindings\Libgit2\OdbBackend.o )
[19 of 49] Compiling Bindings.Libgit2.Odb ( dist\build\Bindings\Libgit2\Odb.hs, dist\build\Bindings\Libgit2\Odb.o )
[20 of 49] Compiling Bindings.Libgit2.Pack ( dist\build\Bindings\Libgit2\Pack.hs, dist\build\Bindings\Libgit2\Pack.o )
[21 of 49] Compiling Bindings.Libgit2.Push ( dist\build\Bindings\Libgit2\Push.hs, dist\build\Bindings\Libgit2\Push.o )
[22 of 49] Compiling Bindings.Libgit2.Reflog ( dist\build\Bindings\Libgit2\Reflog.hs, dist\build\Bindings\Libgit2\Reflog.o )
[23 of 49] Compiling Bindings.Libgit2.Refs ( dist\build\Bindings\Libgit2\Refs.hs, dist\build\Bindings\Libgit2\Refs.o )
[24 of 49] Compiling Bindings.Libgit2.RefdbBackend ( dist\build\Bindings\Libgit2\RefdbBackend.hs, dist\build\Bindings\Libgit2\RefdbBackend.o
 )
[25 of 49] Compiling Bindings.Libgit2.Refdb ( dist\build\Bindings\Libgit2\Refdb.hs, dist\build\Bindings\Libgit2\Refdb.o )
[26 of 49] Compiling Bindings.Libgit2.Refspec ( dist\build\Bindings\Libgit2\Refspec.hs, dist\build\Bindings\Libgit2\Refspec.o )
[27 of 49] Compiling Bindings.Libgit2.Repository ( dist\build\Bindings\Libgit2\Repository.hs, dist\build\Bindings\Libgit2\Repository.o )
[28 of 49] Compiling Bindings.Libgit2.Reset ( dist\build\Bindings\Libgit2\Reset.hs, dist\build\Bindings\Libgit2\Reset.o )
[29 of 49] Compiling Bindings.Libgit2.Revparse ( dist\build\Bindings\Libgit2\Revparse.hs, dist\build\Bindings\Libgit2\Revparse.o )
[30 of 49] Compiling Bindings.Libgit2.Revwalk ( dist\build\Bindings\Libgit2\Revwalk.hs, dist\build\Bindings\Libgit2\Revwalk.o )
[31 of 49] Compiling Bindings.Libgit2.Signature ( dist\build\Bindings\Libgit2\Signature.hs, dist\build\Bindings\Libgit2\Signature.o )
[32 of 49] Compiling Bindings.Libgit2.Stash ( dist\build\Bindings\Libgit2\Stash.hs, dist\build\Bindings\Libgit2\Stash.o )
[33 of 49] Compiling Bindings.Libgit2.Status ( dist\build\Bindings\Libgit2\Status.hs, dist\build\Bindings\Libgit2\Status.o )
[34 of 49] Compiling Bindings.Libgit2.Submodule ( dist\build\Bindings\Libgit2\Submodule.hs, dist\build\Bindings\Libgit2\Submodule.o )
[35 of 49] Compiling Bindings.Libgit2.Tag ( dist\build\Bindings\Libgit2\Tag.hs, dist\build\Bindings\Libgit2\Tag.o )
[36 of 49] Compiling Bindings.Libgit2.Trace ( dist\build\Bindings\Libgit2\Trace.hs, dist\build\Bindings\Libgit2\Trace.o )
[37 of 49] Compiling Bindings.Libgit2.Transport ( dist\build\Bindings\Libgit2\Transport.hs, dist\build\Bindings\Libgit2\Transport.o )
[38 of 49] Compiling Bindings.Libgit2.CredHelpers ( dist\build\Bindings\Libgit2\CredHelpers.hs, dist\build\Bindings\Libgit2\CredHelpers.o )
[39 of 49] Compiling Bindings.Libgit2.Remote ( dist\build\Bindings\Libgit2\Remote.hs, dist\build\Bindings\Libgit2\Remote.o )
[40 of 49] Compiling Bindings.Libgit2.Tree ( dist\build\Bindings\Libgit2\Tree.hs, dist\build\Bindings\Libgit2\Tree.o )
[41 of 49] Compiling Bindings.Libgit2.Diff ( dist\build\Bindings\Libgit2\Diff.hs, dist\build\Bindings\Libgit2\Diff.o )
[42 of 49] Compiling Bindings.Libgit2.Windows ( dist\build\Bindings\Libgit2\Windows.hs, dist\build\Bindings\Libgit2\Windows.o )

BindingsLibgit2Windows.hsc:9:6:
    Not in scope: type constructor or class `CUInt'

BindingsLibgit2Windows.hsc:10:10:
    Not in scope: type constructor or class `CUInt'

BindingsLibgit2Windows.hsc:11:6:
    Not in scope: type constructor or class `FunPtr'
    Perhaps you meant `Functor' (imported from Prelude)

BindingsLibgit2Windows.hsc:11:14:
    Not in scope: type constructor or class `CUInt'

BindingsLibgit2Windows.hsc:12:6:
    Not in scope: type constructor or class `FunPtr'
    Perhaps you meant `Functor' (imported from Prelude)

BindingsLibgit2Windows.hsc:12:18:
    Not in scope: type constructor or class `CUInt'

BindingsLibgit2Windows.hsc:13:6:
    Not in scope: type constructor or class `FunPtr'
    Perhaps you meant `Functor' (imported from Prelude)

At this point I got desperate and removed Bindings.Libgit2.Windows module from cabal project completely (from cabal file and Bindings.Libgit2 module) as I thought that manipulating codepages might not be most important thing I will need going forward (I'm sure, that I'm wrong on this in the long run though). This is what I got:

PS [GIT] C:\PRJ\KUZ\_temp\hlibgit2-0.18.0.13
λ cabal clean
cleaning...
PS [GIT] C:\PRJ\KUZ\_temp\hlibgit2-0.18.0.13
λ cabal configure; cabal build
Resolving dependencies...
Configuring hlibgit2-0.18.0.13...
Building hlibgit2-0.18.0.13...
Preprocessing library hlibgit2-0.18.0.13...
[ 1 of 48] Compiling Bindings.Libgit2.Version ( dist\build\Bindings\Libgit2\Version.hs, dist\build\Bindings\Libgit2\Version.o )
[ 2 of 48] Compiling Bindings.Libgit2.Common ( dist\build\Bindings\Libgit2\Common.hs, dist\build\Bindings\Libgit2\Common.o )
[ 3 of 48] Compiling Bindings.Libgit2.Errors ( dist\build\Bindings\Libgit2\Errors.hs, dist\build\Bindings\Libgit2\Errors.o )
[ 4 of 48] Compiling Bindings.Libgit2.Message ( dist\build\Bindings\Libgit2\Message.hs, dist\build\Bindings\Libgit2\Message.o )
[ 5 of 48] Compiling Bindings.Libgit2.Strarray ( dist\build\Bindings\Libgit2\Strarray.hs, dist\build\Bindings\Libgit2\Strarray.o )
[ 6 of 48] Compiling Bindings.Libgit2.Threads ( dist\build\Bindings\Libgit2\Threads.hs, dist\build\Bindings\Libgit2\Threads.o )
[ 7 of 48] Compiling Bindings.Libgit2.Types ( dist\build\Bindings\Libgit2\Types.hs, dist\build\Bindings\Libgit2\Types.o )
[ 8 of 48] Compiling Bindings.Libgit2.Config ( dist\build\Bindings\Libgit2\Config.hs, dist\build\Bindings\Libgit2\Config.o )
[ 9 of 48] Compiling Bindings.Libgit2.Ignore ( dist\build\Bindings\Libgit2\Ignore.hs, dist\build\Bindings\Libgit2\Ignore.o )
[10 of 48] Compiling Bindings.Libgit2.Oid ( dist\build\Bindings\Libgit2\Oid.hs, dist\build\Bindings\Libgit2\Oid.o )
[11 of 48] Compiling Bindings.Libgit2.Graph ( dist\build\Bindings\Libgit2\Graph.hs, dist\build\Bindings\Libgit2\Graph.o )
[12 of 48] Compiling Bindings.Libgit2.Indexer ( dist\build\Bindings\Libgit2\Indexer.hs, dist\build\Bindings\Libgit2\Indexer.o )
[13 of 48] Compiling Bindings.Libgit2.Index ( dist\build\Bindings\Libgit2\Index.hs, dist\build\Bindings\Libgit2\Index.o )
[14 of 48] Compiling Bindings.Libgit2.Merge ( dist\build\Bindings\Libgit2\Merge.hs, dist\build\Bindings\Libgit2\Merge.o )
[15 of 48] Compiling Bindings.Libgit2.Net ( dist\build\Bindings\Libgit2\Net.hs, dist\build\Bindings\Libgit2\Net.o )
[16 of 48] Compiling Bindings.Libgit2.Notes ( dist\build\Bindings\Libgit2\Notes.hs, dist\build\Bindings\Libgit2\Notes.o )
[17 of 48] Compiling Bindings.Libgit2.Object ( dist\build\Bindings\Libgit2\Object.hs, dist\build\Bindings\Libgit2\Object.o )
[18 of 48] Compiling Bindings.Libgit2.OdbBackend ( dist\build\Bindings\Libgit2\OdbBackend.hs, dist\build\Bindings\Libgit2\OdbBackend.o )
[19 of 48] Compiling Bindings.Libgit2.Odb ( dist\build\Bindings\Libgit2\Odb.hs, dist\build\Bindings\Libgit2\Odb.o )
[20 of 48] Compiling Bindings.Libgit2.Pack ( dist\build\Bindings\Libgit2\Pack.hs, dist\build\Bindings\Libgit2\Pack.o )
[21 of 48] Compiling Bindings.Libgit2.Push ( dist\build\Bindings\Libgit2\Push.hs, dist\build\Bindings\Libgit2\Push.o )
[22 of 48] Compiling Bindings.Libgit2.Reflog ( dist\build\Bindings\Libgit2\Reflog.hs, dist\build\Bindings\Libgit2\Reflog.o )
[23 of 48] Compiling Bindings.Libgit2.Refs ( dist\build\Bindings\Libgit2\Refs.hs, dist\build\Bindings\Libgit2\Refs.o )
[24 of 48] Compiling Bindings.Libgit2.RefdbBackend ( dist\build\Bindings\Libgit2\RefdbBackend.hs, dist\build\Bindings\Libgit2\RefdbBackend.o
 )
[25 of 48] Compiling Bindings.Libgit2.Refdb ( dist\build\Bindings\Libgit2\Refdb.hs, dist\build\Bindings\Libgit2\Refdb.o )
[26 of 48] Compiling Bindings.Libgit2.Refspec ( dist\build\Bindings\Libgit2\Refspec.hs, dist\build\Bindings\Libgit2\Refspec.o )
[27 of 48] Compiling Bindings.Libgit2.Repository ( dist\build\Bindings\Libgit2\Repository.hs, dist\build\Bindings\Libgit2\Repository.o )
[28 of 48] Compiling Bindings.Libgit2.Reset ( dist\build\Bindings\Libgit2\Reset.hs, dist\build\Bindings\Libgit2\Reset.o )
[29 of 48] Compiling Bindings.Libgit2.Revparse ( dist\build\Bindings\Libgit2\Revparse.hs, dist\build\Bindings\Libgit2\Revparse.o )
[30 of 48] Compiling Bindings.Libgit2.Revwalk ( dist\build\Bindings\Libgit2\Revwalk.hs, dist\build\Bindings\Libgit2\Revwalk.o )
[31 of 48] Compiling Bindings.Libgit2.Signature ( dist\build\Bindings\Libgit2\Signature.hs, dist\build\Bindings\Libgit2\Signature.o )
[32 of 48] Compiling Bindings.Libgit2.Stash ( dist\build\Bindings\Libgit2\Stash.hs, dist\build\Bindings\Libgit2\Stash.o )
[33 of 48] Compiling Bindings.Libgit2.Status ( dist\build\Bindings\Libgit2\Status.hs, dist\build\Bindings\Libgit2\Status.o )
[34 of 48] Compiling Bindings.Libgit2.Submodule ( dist\build\Bindings\Libgit2\Submodule.hs, dist\build\Bindings\Libgit2\Submodule.o )
[35 of 48] Compiling Bindings.Libgit2.Tag ( dist\build\Bindings\Libgit2\Tag.hs, dist\build\Bindings\Libgit2\Tag.o )
[36 of 48] Compiling Bindings.Libgit2.Trace ( dist\build\Bindings\Libgit2\Trace.hs, dist\build\Bindings\Libgit2\Trace.o )
[37 of 48] Compiling Bindings.Libgit2.Transport ( dist\build\Bindings\Libgit2\Transport.hs, dist\build\Bindings\Libgit2\Transport.o )
[38 of 48] Compiling Bindings.Libgit2.CredHelpers ( dist\build\Bindings\Libgit2\CredHelpers.hs, dist\build\Bindings\Libgit2\CredHelpers.o )
[39 of 48] Compiling Bindings.Libgit2.Remote ( dist\build\Bindings\Libgit2\Remote.hs, dist\build\Bindings\Libgit2\Remote.o )
[40 of 48] Compiling Bindings.Libgit2.Tree ( dist\build\Bindings\Libgit2\Tree.hs, dist\build\Bindings\Libgit2\Tree.o )
[41 of 48] Compiling Bindings.Libgit2.Diff ( dist\build\Bindings\Libgit2\Diff.hs, dist\build\Bindings\Libgit2\Diff.o )
[42 of 48] Compiling Bindings.Libgit2.Commit ( dist\build\Bindings\Libgit2\Commit.hs, dist\build\Bindings\Libgit2\Commit.o )
[43 of 48] Compiling Bindings.Libgit2.Checkout ( dist\build\Bindings\Libgit2\Checkout.hs, dist\build\Bindings\Libgit2\Checkout.o )
[44 of 48] Compiling Bindings.Libgit2.Clone ( dist\build\Bindings\Libgit2\Clone.hs, dist\build\Bindings\Libgit2\Clone.o )
[45 of 48] Compiling Bindings.Libgit2.Branch ( dist\build\Bindings\Libgit2\Branch.hs, dist\build\Bindings\Libgit2\Branch.o )
[46 of 48] Compiling Bindings.Libgit2.Blob ( dist\build\Bindings\Libgit2\Blob.hs, dist\build\Bindings\Libgit2\Blob.o )
[47 of 48] Compiling Bindings.Libgit2.Attr ( dist\build\Bindings\Libgit2\Attr.hs, dist\build\Bindings\Libgit2\Attr.o )
[48 of 48] Compiling Bindings.Libgit2 ( Bindings\Libgit2.hs, dist\build\Bindings\Libgit2.o )

In file included from libgit2\src\common.h:30:0:
    0,
                     from libgit2\src\/fileops.h:10,
                     from libgit2\src\/index.h:10,
                     from libgit2\src\/repository.h:16,
                     from libgit2\src\attr.c:1:

libgit2\src\win32\mingw-compat.h:13:0:
     warning: "lseek" redefined [enabled by default]
c:\progra~1\haskell platform\2014.2.0.0\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/include/io.h:336:0: not
e: this is the location of the previous definition

libgit2\src\win32\mingw-compat.h:14:0:
     warning: "stat" redefined [enabled by default]
c:\progra~1\haskell platform\2014.2.0.0\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/include/sys/stat.h:258:
0: note: this is the location of the previous definition

libgit2\src\win32\mingw-compat.h:15:0:
     warning: "fstat" redefined [enabled by default]
c:\progra~1\haskell platform\2014.2.0.0\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/include/sys/stat.h:259:
0: note: this is the location of the previous definition

In file included from libgit2\src\fileops.h:10:0:
    0,
                     from libgit2\src\/index.h:10,
                     from libgit2\src\/repository.h:16,
                     from libgit2\src\attr.c:1:

libgit2\src\common.h:52:19:
     fatal error: regex.h: No such file or directory
compilation terminated.

Is there any way to compile hlibgit2 on Windows?

kuznero avatar Dec 05 '14 09:12 kuznero

@kuznero I'm sorry, but I've never tried it, so I have no better information at this point than you do. I think you might have better luck trying to build from the official libgit2 tarball. Then, if you can get that to build, you can port the changes back over into hlibgit2's cabal file.

jwiegley avatar Dec 06 '14 06:12 jwiegley

Is there any way to compile hlibgit2 on Windows?

I have just compiled it on Windows.

  1. I added to cabal file
include-dirs:
      libgit2/src/win32
      E:\Distr\openssl-3.0.0-win64-mingw\include
      E:\Distr\Regex\include
extra-lib-dirs:
      E:\Distr\Regex\lib
      E:\Distr\openssl-3.0.0-win64-mingw\lib64
  1. I downloaded openssl from https://curl.se/windows/dl-7.80.0/ (contains openssl dependency)
  2. I downloaded msys64 from https://www.msys2.org/ (contains regex dependency)
  3. I copied regex.h to E:\Distr\Regex\include, libregex.a and libregex.dll.a to E:\Distr\Regex\lib
  4. Then I tried to build with cabal:
S C:\Projects\Haskell\gitlib\hlibgit2> cabal build
Build profile: -w ghc-9.2.5 -O1
In order, the following will be built (use -v for more details):
 - hlibgit2-0.18.0.16 (lib) (first run)
 - hlibgit2-0.18.0.16 (test:smoke) (first run)
Preprocessing library for hlibgit2-0.18.0.16..
Building library for hlibgit2-0.18.0.16..
In file included from libgit2\src\common.h:30,

                 from libgit2\src\fetch.c:13:0: error: 

libgit2\src\win32\mingw-compat.h:13:0: error:
     warning: "lseek" redefined
       13 | # define lseek _lseeki64
          |
   |
13 | # define lseek _lseeki64
   | ^
In file included from E:/HSP/ghcup/ghc/9.2.5/mingw/x86_64-w64-mingw32/include/sys/stat.h:14,
                 from libgit2\src\common.h:21,

                 from libgit2\src\fetch.c:13:0: error: 

E:\HSP\ghcup\ghc\9.2.5\mingw\x86_64-w64-mingw32\include\io.h:352:0: error:
     note: this is the location of the previous definition
      352 | #define lseek lseek64
          |
    |
352 | #define lseek lseek64
    | ^
In file included from libgit2\src\common.h:30,

                 from libgit2\src\fetch.c:13:0: error: 

libgit2\src\win32\mingw-compat.h:14:0: error:
     warning: "stat" redefined
       14 | # define stat _stati64
          |
   |
14 | # define stat _stati64
   | ^
In file included from libgit2\src\common.h:21,

                 from libgit2\src\fetch.c:13:0: error: 

E:\HSP\ghcup\ghc\9.2.5\mingw\x86_64-w64-mingw32\include\sys\stat.h:279:0: error:
     note: this is the location of the previous definition
      279 | #define stat _stat64
          |
    |
279 | #define stat _stat64
    | ^
In file included from libgit2\src\common.h:30,

                 from libgit2\src\fetch.c:13:0: error: 

libgit2\src\win32\mingw-compat.h:15:0: error:
     warning: "fstat" redefined
       15 | # define fstat _fstati64
          |
   |
15 | # define fstat _fstati64
   | ^
In file included from libgit2\src\common.h:21,

                 from libgit2\src\fetch.c:13:0: error: 

E:\HSP\ghcup\ghc\9.2.5\mingw\x86_64-w64-mingw32\include\sys\stat.h:280:0: error:
     note: this is the location of the previous definition
      280 | #define fstat _fstat64
          |
    |
280 | #define fstat _fstat64
    | ^
In file included from libgit2\src\hash/hash_win32.h:15,
                 from libgit2\src\hash.h:24,
                 from libgit2\src\filebuf.h:11,
                 from libgit2\src\index.h:11,
                 from libgit2\src\repository.h:16,
                 from libgit2\src\remote.h:14,

                 from libgit2\src\fetch.c:14:0: error: 

E:\Distr\openssl-3.0.0-win64-mingw\include\openssl\bio.h:867:29: error:
     error: expected ')' before ';' token
      867 |                       int (*gets) (BIO *, char *, int));
          |                             ^~~~
    |
867 |                       int (*gets) (BIO *, char *, int));
    |                             ^
`gcc.exe' failed in phase `C Compiler'. (Exit code: 1)
cabal-3.6.2.0.exe: Failed to build hlibgit2-0.18.0.16 (which is required by
test:smoke from hlibgit2-0.18.0.16).

As you can see build unsuccessful 6. Then I try change build command to

&"E:\HSP\ghcup\bin\ghc.exe" "--make" "-fbuilding-cabal-package" "-O" "-outputdir" "C:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build" "-odir" "C:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build" "-hidir" "C:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build" "-stubdir" "C:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build" "-i" "-iC:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build" "-i." "-iC:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build\autogen" "-iC:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build\global-autogen" "-IC:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build\autogen" "-IC:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build\global-autogen" "-IC:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build" "-Ilibgit2/include" "-Ilibgit2/src" "-Ilibgit2/deps/http-parser" "-Ilibgit2/src/win32" "-IC:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build\libgit2/include" "-IC:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build\libgit2/src" "-IC:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build\libgit2/deps/http-parser" "-IC:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build\libgit2/src/win32" "-IE:\Distr\openssl-3.0.0-win64-mingw\include" "-IE:\Distr\Regex\include" "-optP-DWINDOWS" "-optP-include" "-optPC:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\build\autogen\cabal_macros.h" "-this-unit-id" "hlibgit2-0.18.0.16-inplace" "-hide-all-packages" "-Wmissing-home-modules" "-no-user-package-db" "-package-db" "E:\HSP\cabal\store\ghc-9.2.5\package.db" "-package-db" "C:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\packagedb\ghc-9.2.5" "-package-db" "C:\Projects\Haskell\gitlib\hlibgit2\dist-newstyle\build\x86_64-windows\ghc-9.2.5\hlibgit2-0.18.0.16\package.conf.inplace" "-package-id" "base-4.16.4.0" "-package-id" "bindings-DSL-1.0.25-d8a29754a88ed46c0fc731c63bca65bc5212dbfb" "-package-id" "zlib-0.6.3.0-a86c87747cd334b31145fa89d5013e7318d2ca69" "-XHaskell98" "-XForeignFunctionInterface" "Bindings.Libgit2" "Bindings.Libgit2.Attr" "Bindings.Libgit2.Blob" "Bindings.Libgit2.Branch" "Bindings.Libgit2.Checkout" "Bindings.Libgit2.Clone" "Bindings.Libgit2.Commit" "Bindings.Libgit2.Common" "Bindings.Libgit2.Config" "Bindings.Libgit2.CredHelpers" "Bindings.Libgit2.Diff" "Bindings.Libgit2.Errors" "Bindings.Libgit2.Graph" "Bindings.Libgit2.Ignore" "Bindings.Libgit2.Index" "Bindings.Libgit2.Indexer" "Bindings.Libgit2.Merge" "Bindings.Libgit2.Message" 
"Bindings.Libgit2.Net" "Bindings.Libgit2.Notes" "Bindings.Libgit2.Object" "Bindings.Libgit2.Odb" "Bindings.Libgit2.OdbBackend" "Bindings.Libgit2.Oid" "Bindings.Libgit2.Pack" "Bindings.Libgit2.Push" "Bindings.Libgit2.Refdb" "Bindings.Libgit2.RefdbBackend" "Bindings.Libgit2.Reflog" "Bindings.Libgit2.Refs" "Bindings.Libgit2.Refspec" "Bindings.Libgit2.Remote" "Bindings.Libgit2.Repository" "Bindings.Libgit2.Reset" "Bindings.Libgit2.Revparse" "Bindings.Libgit2.Revwalk" "Bindings.Libgit2.Signature" "Bindings.Libgit2.Stash" "Bindings.Libgit2.Status" "Bindings.Libgit2.Strarray" "Bindings.Libgit2.Submodule" "Bindings.Libgit2.Tag" "Bindings.Libgit2.Threads" "Bindings.Libgit2.Trace" "Bindings.Libgit2.Transport" "Bindings.Libgit2.Tree" "Bindings.Libgit2.Types" "Bindings.Libgit2.Version" "Bindings.Libgit2.Windows" "-Wall" "-hide-all-packages"

Such command generated by cabal during cabal build, but important: I deleted flag: "-IE:\HSP\ghcup\msys64\mingw64\include" and after that build was successful. Does anyone else know how to disable it in *.cabal file?

betlgtu avatar Mar 01 '23 18:03 betlgtu