Skip to content

cabal-install-3.6 fails to install network-3.1.2.2 in windows #7649

Closed

Description

@jneira
  • but cabal-install-3.4.0.0 is able to build it
  • logs:
Configuring network-3.1.2.2...
configure: WARNING: unrecognized options: --with-compiler
checking build system type... x86_64-pc-msys
checking host system type... x86_64-pc-msys
checking for gcc... D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe accepts -g... yes
checking for D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe option to accept ISO C89... none needed
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe -E
checking for grep that handles long lines and -e... configure: error: no acceptable grep could be found in /d/ghcup/bin:/c/Users/atrey/AppData/Roaming/cabal/bin:/usr/bin:/mingw64/bin:/d/cabal/store/ghc-8.10.7/hsc2hs-0.68.7-640ce3a674b3ce528257d431f5e15fc40c5ab1a7/bin:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/d/dev/app/git/cmd:/c/Users/atrey/AppData/Local/Microsoft/WindowsApps:/d/bin:/d/dev/ws/haskell/stack:/d/dev/app/emacs-26.2-x86_64/bin:/d/dev/app/Git/bin:/d/dev/app/curl_7_53_1_openssl_nghttp2_x64/bin:/d/dev/app/diffutils-2.8.7-1-bin/bin:/d/dev/app/grep-2.5.4-bin/bin:/d/dev/app/chocolatey/bin:/d/dev/app/vscode/bin:/d/Program Files/Java/jdk1.8.0_231/bin:/d/Program Files/7-Zip:/d/dev/app/node-v12.14.1-win-x64:/d/dev/ws/node.js:/d/dev/app/apache-maven-3.3.9/bin:/d/Program Files/PostgreSQL/11/bin:/d/bin/hls:/d/dev/app/python39/Scripts:/d/dev/app/python39:/d/ghcup/bin:/d/bin/cabal;/usr/xpg4/bin
cabal-3.6.0.0.exe: Failed to build network-3.1.2.2 (which is required by
exe:cabal from cabal-install-3.7.0.0). The failure occurred during the
configure step.

with cabal-3.4.0.0

Configuring network-3.1.2.2...
configure: WARNING: unrecognized options: --with-compiler
checking build system type... x86_64-pc-msys
checking host system type... x86_64-pc-msys
checking for gcc... D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe accepts -g... yes
checking for D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe option to accept ISO C89... none needed
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
....

Could it be related with #7510 (which i tested myself 🤦)?

Activity

  1. phadej commented on Sep 14, 2021

    @phadej
    Collaborator
    ...:/d/dev/app/python39:/d/ghcup/bin:/d/bin/cabal;/usr/xpg4/bin
    

    are very much : separated indeed.

  2. Mikolaj commented on Sep 14, 2021

    @Mikolaj
    Member

    Is this solved, then? If not, how exactly do I reproduce? I don't see any direct instruction for that.

    Edit: never mind, I'm on Linux and this is probably Windows.

  3. changed the title [-]cabal-install-3.6 fails to install network-3.1.2.2[/-] [+]cabal-install-3.6 fails to install network-3.1.2.2 in windows[/+] on Sep 14, 2021
  4. jneira commented on Sep 14, 2021

    @jneira
    MemberAuthor

    I tested it in a misys2 bash console and same error with cabal --store-dir /d/cabal/store2 install network --lib

  5. Mikolaj commented on Sep 14, 2021

    @Mikolaj
    Member

    @jneira: you are probably using master branch? How about 3.6? Any idea where are the : separators @phadej mentions coming from? Any idea why it worked previously, when people tested the PR?

  6. jneira commented on Sep 14, 2021

    @jneira
    MemberAuthor

    @jneira: you are probably using master branch? How about 3.6?

    I think I am using 3.6 official release but I will confirm

    Any idea where are the : separators @phadej mentions coming from?

    the problem maybe is the unique ; in the list and no :? not sure

    Any idea why it worked previously, when people tested the PR?

    not yet ☺️ but maybe it is not related, will try again the pr commit to discard

  7. Mikolaj commented on Sep 14, 2021

    @Mikolaj
    Member

    @jneira: you are probably using master branch? How about 3.6?

    I think I am using 3.6 official release but I will confirm

    I've seen cabal-install-3.7.0.0 in your log above, hence asking.

    the problem maybe is the unique ; in the list and no :? not sure

    Huh, I'm not sure any more.

    [Edited: removed all the rest of my musings, because they didn't make sense. Read #7494 instead.]

    [Edit2: after reading #7494, I agree there should be no colons, but only semicolons in PATH. So cabal is giving wrong PATH to configure or the following not always holds: "When cabal is called the msys2-runtime converts the environment block to contain windows paths since Cabal is a Windows program and expect a Windows style environmental block."]

    [Edit3: perhaps it depends on whether cabal is called from Windows console or msys/cygwin terminal or whether the cabal binary is more or less native Windows binary (if that's possible)?]

  8. jneira commented on Sep 14, 2021

    @jneira
    MemberAuthor

    3.7 is shown cause I was trying to build a recent commit of cabal but using an older version of cabal itself

  9. Mikolaj commented on Sep 14, 2021

    @Mikolaj
    Member

    3.7 is shown cause I was trying to build a recent commit of cabal but using an older version of cabal itself

    Oh, right, my bad.

  10. Mikolaj commented on Sep 14, 2021

    @Mikolaj
    Member

    @Mistuke: does the log tell you anything? What can be going wrong?

  11. phadej commented on Sep 14, 2021

    @phadej
    Collaborator

    My guess is that we don't overwrite PATH provided by bash console itself.

    And if you test in PowerShell the problem doesn't arise. Can @jneira try to build in PowerShell?

  12. jneira commented on Sep 14, 2021

    @jneira
    MemberAuthor

    I am afraid the log from the description was from a powershell session 😕
    I tested it in a msys bash and same result

  13. jneira commented on Sep 14, 2021

    @jneira
    MemberAuthor

    Ok, i am afraid there had been some confusion that I could have avoided posting the full logs with versions of tooling:

    PS D:\dev\ws\haskell\issues> cabal --version
    cabal-install version 3.6.0.0
    compiled using version 3.6.1.0 of the Cabal library
    PS D:\dev\ws\haskell\issues> $(gcm cabal).path
    D:\ghcup\bin\cabal.exe
    PS D:\dev\ws\haskell\issues> cabal --store-dir D:\cabal\store2 install network --lib
    Resolving dependencies...
    Build profile: -w ghc-8.10.7 -O1
    In order, the following will be built (use -v for more details):
     - hsc2hs-0.68.7 (exe:hsc2hs) (requires build)
     - network-3.1.2.2 (lib:network) (requires build)
    Starting     hsc2hs-0.68.7 (exe:hsc2hs)
    Building     hsc2hs-0.68.7 (exe:hsc2hs)
    Installing   hsc2hs-0.68.7 (exe:hsc2hs)
    Completed    hsc2hs-0.68.7 (exe:hsc2hs)
    Starting     network-3.1.2.2 (all, legacy fallback)
    
    Failed to build network-3.1.2.2. The failure occurred during the configure
    step.
    Build log (
    D:\cabal\logs\ghc-8.10.7\network-3.1.2.2-43da37077e8a7b3eeb1dbd1af4e0673f5a10eb39.log
    ):
    Configuring network-3.1.2.2...
    configure: WARNING: unrecognized options: --with-compiler
    checking build system type... x86_64-pc-msys
    checking host system type... x86_64-pc-msys
    checking for gcc... D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.exe
    checking for suffix of executables... .exe
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe accepts -g... yes
    checking for D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe option to accept ISO C89... none needed
    checking for an ANSI C-conforming const... yes
    checking how to run the C preprocessor... D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe -E
    checking for grep that handles long lines and -e... configure: error: no acceptable grep could be found in /d/ghcup/bin:/c/Users/atrey/AppData/Roaming/cabal/bin:/usr/bin:/mingw64/bin:/d/cabal/store2/ghc-8.10.7/hsc2hs-0.68.7-640ce3a674b3ce528257d431f5e15fc40c5ab1a7/bin:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/d/dev/app/git/cmd:/c/Users/atrey/AppData/Local/Microsoft/WindowsApps:/d/bin:/d/dev/ws/haskell/stack:/d/dev/app/emacs-26.2-x86_64/bin:/d/dev/app/Git/bin:/d/dev/app/curl_7_53_1_openssl_nghttp2_x64/bin:/d/dev/app/diffutils-2.8.7-1-bin/bin:/d/dev/app/grep-2.5.4-bin/bin:/d/dev/app/chocolatey/bin:/d/dev/app/vscode/bin:/d/Program Files/Java/jdk1.8.0_231/bin:/d/Program Files/7-Zip:/d/dev/app/node-v12.14.1-win-x64:/d/dev/ws/node.js:/d/dev/app/apache-maven-3.3.9/bin:/d/Program Files/PostgreSQL/11/bin:/d/bin/hls:/d/dev/app/python39/Scripts:/d/dev/app/python39:/d/ghcup/bin:/d/bin/cabal;/usr/xpg4/bin
    cabal-3.6.0.0.exe: Failed to build network-3.1.2.2. See the build log above
    for details.
    

    with -v3 we can see the configure invocation:

    "D:\ghcup\msys64\usr\bin\sh.exe" "C:\/TEMP/cabal-install.-6000/dist-newstyle/tmp/src-6000/network-3.1.2.2/configure" "--with-compiler=ghc" "--prefix=D:\cabal\store2\ghc-8.10.7\network-3.1.2.2-43da37077e8a7b3eeb1dbd1af4e0673f5a10eb39" "--bindir=D:\cabal\store2\ghc-8.10.7\network-3.1.2.2-43da37077e8a7b3eeb1dbd1af4e0673f5a10eb39\bin" "--libdir=D:\cabal\store2\ghc-8.10.7\network-3.1.2.2-43da37077e8a7b3eeb1dbd1af4e0673f5a10eb39\lib" "--libexecdir=D:\cabal\store2\ghc-8.10.7\network-3.1.2.2-43da37077e8a7b3eeb1dbd1af4e0673f5a10eb39\libexec" "--datadir=D:\cabal\store2\ghc-8.10.7\network-3.1.2.2-43da37077e8a7b3eeb1dbd1af4e0673f5a10eb39\share" "--sysconfdir=D:\cabal\store2\ghc-8.10.7\network-3.1.2.2-43da37077e8a7b3eeb1dbd1af4e0673f5a10eb39\etc" "CC=D:\ghcup\ghc\8.10.7\lib\../mingw/bin\gcc.exe"
    
  14. 37 remaining items

  15. madjestic commented on Oct 24, 2023

    @madjestic

    Hey guys,

    I've tried ghc 9.4.7 and cabal 3.10.1.0, the error message is the same.

  16. Mikolaj commented on Oct 24, 2023

    @Mikolaj
    Member

    Thanks for the experiment. Does compiling C programs that use ./configure work? Actually, does running sh work?

  17. madjestic commented on Oct 24, 2023

    @madjestic

    I will explain how I am doing that: I've got ghcup installed as recommended on the website, ugraded and updated. I start the Powershell, navigate to the haskell project (a clean test project with network added into the project's cabal as the only dependency besides base), run cabal build and get this error.

    I am not aware of how I am supposed to use sh on ./configure under windows. Running these commands in Powershell just gives errors. Where can I read about the necessary steps involving sh and configure, @Mikolaj ?

    Regards,
    Vlad

  18. Mikolaj commented on Oct 24, 2023

    @Mikolaj
    Member

    @madjestic: actually, I'm quite clueless regarding Windows --- I was just following your error message. I'm also trying to understand how broken your toolchain is and what may be responsible for that.

    @hasufell: is ghcup so plug-and-play on Windows, e.g., does it install msys2 so that the user can run sh in powershell or install a C library from source [edit: with ./configure] (is there a good smoke test library to use in that role?)?

  19. madjestic commented on Oct 24, 2023

    @madjestic

    I can only humbly suggest that my toolchain is probably as vanilla as most windows 11 users will experience. I kept it very simple and nearly everything is a default, I was not trying being clever or customize my environment beyond adding SDL2 dll to the path and cabal/config.

  20. Mikolaj commented on Oct 24, 2023

    @Mikolaj
    Member

    I can only humbly suggest that my toolchain is probably as vanilla as most windows 11 users will experience.

    That's what I'm worried about. :D

  21. Bodigrim commented on Oct 24, 2023

    @Bodigrim
    Collaborator

    My experience is that building network on Windows requires MinGW / MSYS terminal. Usually Git Bash works well. It's a pity if this is not documented clearly, but probably more an issue for network than for Cabal.

  22. hasufell commented on Oct 25, 2023

    @hasufell
    Member

    is ghcup so plug-and-play on Windows, e.g., does it install msys2 so that the user can run sh in powershell

    Yes, we:

    That means you don't need an msys2 shell, because cabal knows about those directories.

    If the cabal config doesn't include this, it will fail.

  23. Mikolaj commented on Oct 30, 2023

    @Mikolaj
    Member

    @madjestic: can you reconcile these bits of info? Are msys2 paths in your cabal config?

  24. madjestic commented on Oct 30, 2023

    @madjestic

    I will take a look and let you know asap, thanks!

  25. madjestic commented on Nov 22, 2023

    @madjestic

    Hey guys,
    I think that I do have msys2 paths in the cabal config. Here's my cabal/config.

    Am I missing something there?

  26. gbaz commented on Nov 23, 2023

    @gbaz
    Collaborator

    those paths look correct. perhaps you can download and build network individually, running cabal at a high verbosity, so that we could see the error logs, which may be more informative?

  27. jasagredo commented on Dec 15, 2023

    @jasagredo
    Collaborator

    I think this is a manifestation of this other issue I created #9519

  28. gbaz commented on Jan 19, 2024

    @gbaz
    Collaborator

    Not so sure. If it was the exec handling and git handling, not sure how that might have affected build?

  29. jasagredo commented on Jan 19, 2024

    @jasagredo
    Collaborator

    Indeed. My comment was before I started investigating deeply the fix for my ticket. This is NOT related to #9519.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions