Skip to content

Can't supply extra include dirs or extra library dirs on Windows #7096

Closed as not planned

Description

@newhoggy

Describe the bug
Using cabal-3.2.0.0 on Windows. Cabal thinks that absolute paths I pass in are relative paths.

For example:

cabal build all --extra-lib-dirs=C:\\Users\\newho\\wrk\\iohk\\cardano-node\\libsodium-win64\\lib --extra-include-dirs=c:\\Users\\newho\\wrk\\iohk\\cardano-node\\libsodium-win64\\include

The error I get is

cardano-crypto-class-2.0.0: dynamic-library-dirs:
/c/Users/newho/wrk/iohk/cardano-node/libsodium-win64/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)

To Reproduce
Steps to reproduce the behavior:

One Windows, in bash shell (from git bash prompt):

$ git clone [email protected]:input-output-hk/cardano-node.git
$ cd cardano-node
$ curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-mingw.tar.gz -o moo.tar.gz
$ tar zxvf moo.tar.gz
$ cat >> cabal.project.local <<EOF
package cardano-crypto-praos
flags: -external-libsodium-vrf
EOF
$ cabal v2-build all --extra-lib-dirs=C:\\Users\\newho\\wrk\\iohk\\cardano-node\\libsodium-win64\\lib --extra-include-dirs=c:\\Users\\newho\\wrk\\iohk\\cardano-node\\libsodium-win64\\include

I can also report that this similarly fails in Command Prompt. In this case, I run:

C:\Users\newho\wrk\iohk\cardano-node>cabal build all --extra-lib-dirs=C:\Users\newho\wrk\iohk\cardano-node\libsodium-win64\lib --extra-include-dirs=c:\Users\newho\wrk\iohk\cardano-node\libsodium-win64\include

Expected behavior
This should work.

System information

  • Windows 10
  • cabal-.3.2.0.0, ghc-8.6.5 installed via Chocolatey

Activity

  1. jneira commented on Apr 1, 2022

    @jneira
    Member

    #2705 reported the same bad behaviour but for cabal v1-install
    In that case setting

    C_INCLUDE_PATH=C:\libraries\curl-7.40.0-devel-mingw64\include
    LIBRARY_PATH=C:\libraries\curl-7.40.0-devel-mingw64\lib64
    

    did the workaround an i guess it would do for this one

  2. jasagredo commented on Jul 18, 2024

    @jasagredo
    Collaborator

    This doesn't happen on latest cabal:

    ➜ cabal build --extra-lib-dirs=C:\\Users\\Javier\\xx --verbose
    ...
    library-dirs:
    C:\Users\Javier\bb\dist-newstyle\build\x86_64-windows\ghc-9.4.8\bb-0.1.0.0\build
    C:\msys64\clang64\lib C:\Users\Javier\xx
    

    No mention to the warning shown above. I'm closing it, re-open if you disagree

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