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

Stack re-arranges library search path #4527

Closed
mouse07410 opened this issue Jan 21, 2019 · 5 comments
Closed

Stack re-arranges library search path #4527

mouse07410 opened this issue Jan 21, 2019 · 5 comments

Comments

@mouse07410
Copy link

General summary/comments (optional)

stack does not respect the order of the paths to search for libraries.

Steps to reproduce

  1. Specify extra lib dirs in ~/.cabal/config and in ~/.stack/config.yaml`.
  2. Run stack install ghc-paths
  3. Do cat /Users/uri/.stack/global-project/.stack-work/install/x86_64-ohc-paths-0.1.0.9-KaBYbRV3ryA10w04FwbrO2 and enjoy what you see.

Excerpt from ~/.cabal/config:

. . . . .
extra-include-dirs: /opt/local/include
extra-include-dirs: /usr/local/include
-- deterministic:
-- cid:
extra-lib-dirs: /opt/local/lib/liconv
extra-lib-dirs: /opt/local/lib
extra-lib-dirs: /usr/local/lib
. . . . .
allow-newer: True
exact-configuration: False
. . . . .

Excerpt from ~/.stack/config.yaml:

. . . . .
extra-include-dirs: [ /opt/local/include, /usr/local/include ]
extra-lib-dirs: [ /opt/local/lib/liconv, /opt/local/lib, /usr/local/lib, /usr/lib ]
. . . . .

Expected

Library paths listed in the order the config file stated. Also, expected that exact-configuration: False would be respected.

Actual

$ cat /Users/uri/.stack/global-project/.stack-work/install/x86_64-osx/lts-13.2/8.6.3/flag-cache/ghc-paths-0.1.0.9-KaBYbRV3ryA10w04FwbrO2 
H???	config-v3
                 --user--package-db=clear--package-db=globalH--package-db=/Users/uri/.stack/snapshots/x86_64-osx/lts-13.2/8.6.3/pkgdbB--libdir=/Users/uri/.stack/snapshots/x86_64-osx/lts-13.2/8.6.3/libB--bindir=/Users/uri/.stack/snapshots/x86_64-osx/lts-13.2/8.6.3/binE--datadir=/Users/uri/.stack/snapshots/x86_64-osx/lts-13.2/8.6.3/shareJ--libexecdir=/Users/uri/.stack/snapshots/x86_64-osx/lts-13.2/8.6.3/libexecF--sysconfdir=/Users/uri/.stack/snapshots/x86_64-osx/lts-13.2/8.6.3/etcT--docdir=/Users/uri/.stack/snapshots/x86_64-osx/lts-13.2/8.6.3/doc/ghc-paths-0.1.0.9U--htmldir=/Users/uri/.stack/snapshots/x86_64-osx/lts-13.2/8.6.3/doc/ghc-paths-0.1.0.9X--haddockdir=/Users/uri/.stack/snapshots/x86_64-osx/lts-13.2/8.6.3/doc/ghc-paths-0.1.0.97--dependency=Cabal=Cabal-2.4.1.0--ghc-options/usr/lib/libiconv.dylib'--extra-include-dirs=/opt/local/include'--extra-include-dirs=/usr/local/include--extra-lib-dirs=/opt/local/lib&--extra-lib-dirs=/opt/local/lib/liconv--extra-lib-dirs=/usr/lib--extra-lib-dirs=/usr/local/lib--with-gcc=/usr/bin/gcc--exact-configuration$Cababase-4.12.0.0directory-1.3.3.0

Stack version

$ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package, installed with/by Haskell Platform
@dbaynard
Copy link
Contributor

Again, this relate to #4504, right?

@mouse07410
Copy link
Author

Related, meaning this issue was discovered with #4504? Yes.

But I think this one points at a different problem with stack.

@snoyberg
Copy link
Contributor

Also, expected that exact-configuration: False would be respected.

I don't see any claim that Stack recognizes such a setting, and I get a warning when I try including that in my config.yaml file.

@snoyberg
Copy link
Contributor

For providing more information for debugging issues like this, I'd recommend comparing the output of a --cabal-verbose run of stack build with cabal build --verbose and see which different flags are being passed to the underlying executables.

@snoyberg
Copy link
Contributor

See #4650

snoyberg added a commit that referenced this issue Mar 25, 2019
…search-path

Make libs and includes order-dependent (fixes #4527)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants