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

For MacOS and pcre, no way to do equiv of cabal --extra-include-dirs #333

Closed
myShoggoth opened this Issue Jun 16, 2015 · 11 comments

Comments

Projects
None yet
4 participants
@myShoggoth

myShoggoth commented Jun 16, 2015

A better solution would obviously be preferred, but can't use stack to do a mysql based project.

-- While building package pcre-light-0.4.0.3 using:
/Applications/ghc-7.8.4.app/Contents/bin/runhaskell -package=Cabal-1.18.1.5 -clear-package-db -global-package-db /var/folders/wd/0mx8cfxx3d967nmwcmvn037m0000gn/T/stack12670/pcre-light-0.4.0.3/Setup.lhs --builddir=.stack-work/dist/x86_64-osx/Cabal-1.18.1.5/ build
Process exited with code: ExitFailure 1
Logs have been written to: "/Users/andrew/src/startupspot/.stack-work/logs/pcre-light-0.4.0.3.log"

Configuring pcre-light-0.4.0.3...
Building pcre-light-0.4.0.3...
Preprocessing library pcre-light-0.4.0.3...
Base.hsc:103:10: fatal error: 'pcre.h' file not found
#include <pcre.h>
         ^
1 error generated.
compiling .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/Text/Regex/PCRE/Light/Base_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/Text/Regex/PCRE/Light/Base_hsc_make.c -o .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/Text/Regex/PCRE/Light/Base_hsc_make.o -m64 -fno-stack-protector -D__GLASGOW_HASKELL__=708 -Ddarwin_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Ddarwin_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -I/Applications/ghc-7.8.4.app/Contents/lib/ghc-7.8.4/bytestring-0.10.4.0/include -I.stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen -include .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen/cabal_macros.h -I.stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen -include .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen/cabal_macros.h -I.stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen -include .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen/cabal_macros.h -I/Applications/ghc-7.8.4.app/Contents/lib/ghc-7.8.4/base-4.7.0.2/include -I.stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen -include .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen/cabal_macros.h -I/Applications/ghc-7.8.4.app/Contents/lib/ghc-7.8.4/integer-gmp-0.5.1.0/include -I.stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen -include .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen/cabal_macros.h -I.stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen -include .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen/cabal_macros.h -I/Applications/ghc-7.8.4.app/Contents/lib/ghc-7.8.4/include -I.stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen -include .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/autogen/cabal_macros.h -I/Applications/ghc-7.8.4.app/Contents/lib/ghc-7.8.4/include/
@radix

This comment has been minimized.

Contributor

radix commented Jun 16, 2015

I don't understand. Isn't this just a matter of you needing to install libpcre on your system?

@myShoggoth

This comment has been minimized.

myShoggoth commented Jun 16, 2015

No, it is installed. For cabal I have to use --extra-include-dirs=/usr/local/pcre/include

@snoyberg snoyberg added this to the 0.1.0.0 milestone Jun 17, 2015

@snoyberg snoyberg self-assigned this Jun 17, 2015

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Jun 17, 2015

Good catch, this is something we need. I'll add it today.

@radix

This comment has been minimized.

Contributor

radix commented Jun 17, 2015

@myShoggoth I brainfarted and didn't pay attention to the title of the ticket, only the description. My apologies!

@myShoggoth

This comment has been minimized.

myShoggoth commented Jun 17, 2015

No problem, just glad to see this addressed so fast. It would be awesome if
there was a way to hunt those kinds of things down and just make it work,
but fixing C/C++ compiler include paths automatically would be above and
beyond and probably lead to insanity.

On Tue, Jun 16, 2015 at 8:50 PM, Christopher Armstrong <
notifications@github.com> wrote:

@myShoggoth https://github.com/myShoggoth I brainfarted and didn't pay
attention to the title of the ticket, only the description. My apologies!


Reply to this email directly or view it on GitHub
#333 (comment)
.

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Jun 17, 2015

I'm going to add --extra-include-dirs and --extra-lib-dirs. We could theoretically also have --extra-prog-path, but that seems silly when you can just tweak PATH directly. I'll plan on adding this to the config file as well as the command line, so that if desired you can just fix this globally.

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Jun 17, 2015

Alright, this should now be working on master, want to give it a shot?

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Jun 18, 2015

Closing this, please reopen if this doesn't resolve the problem.

@snoyberg snoyberg closed this Jun 18, 2015

@snoyberg snoyberg removed the in progress label Jun 18, 2015

@myShoggoth

This comment has been minimized.

myShoggoth commented Jun 19, 2015

I just got a chance to try this out, sorry it took so long.

As of Version 0.0.3.1, Git revision 241f7cf it worked great:

Andrews-iMac:startupspot andrew$ ~/src/stack/.stack-work/install/x86_64-osx/lts-2.9/7.8.4/bin/stack build --extra-include-dirs=/usr/local/pcre/include

@mLuby

This comment has been minimized.

mLuby commented Dec 3, 2015

I'm seeing this same issue after a few weeks of stack working wonderfully. Tried @myShoggoth 's solution but got the same error.

pcre-light-0.4.0.3: configure
pcre-light-0.4.0.3: build
Progress: 1/4
--  While building package pcre-light-0.4.0.3 using:
      /Users/mLuby/.stack/programs/x86_64-osx/ghc-7.10.2/bin/runhaskell -package=Cabal-1.22.4.0 -clear-package-db -global-package-db -package-db=/Users/mLuby/.stack/snapshots/x86_64-osx/lts-3.1/7.10.2/pkgdb/ /var/folders/zx/mgs8v5z97gbcqf2pvxdkhp9r0000gq/T/stack6995/pcre-light-0.4.0.3/Setup.lhs --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/ build --ghc-options -hpcdir .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/hpc/.hpc/ -ddump-hi -ddump-to-file
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/mLuby/triviell/.stack-work/logs/pcre-light-0.4.0.3.log

    Configuring pcre-light-0.4.0.3...
    Building pcre-light-0.4.0.3...
    Preprocessing library pcre-light-0.4.0.3...
    Base.hsc:103:10: fatal error: 'pcre.h' file not found
    #include <pcre.h>
             ^
    1 error generated.
    compiling .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Text/Regex/PCRE/Light/Base_hsc_make.c failed (exit code 1)
    command was: /usr/bin/gcc -c .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Text/Regex/PCRE/Light/Base_hsc_make.c -o .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Text/Regex/PCRE/Light/Base_hsc_make.o -m64 -fno-stack-protector -D__GLASGOW_HASKELL__=710 -Ddarwin_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Ddarwin_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -I.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/autogen -include .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/autogen/cabal_macros.h -I/Users/mLuby/.stack/programs/x86_64-osx/ghc-7.10.2/lib/ghc-7.10.2/bytes_6elQVSg5cWdFrvRnfxTUrH/include -I/Users/mLuby/.stack/programs/x86_64-osx/ghc-7.10.2/lib/ghc-7.10.2/base_GDytRqRVSUX7zckgKqJjgw/include -I/Users/mLuby/.stack/programs/x86_64-osx/ghc-7.10.2/lib/ghc-7.10.2/integ_2aU3IZNMF9a7mQ0OzsZ0dS/include -I/Users/mLuby/.stack/programs/x86_64-osx/ghc-7.10.2/lib/ghc-7.10.2/include -I/Users/mLuby/.stack/programs/x86_64-osx/ghc-7.10.2/lib/ghc-7.10.2/include/
@myShoggoth

This comment has been minimized.

myShoggoth commented Dec 5, 2015

I had to do a find . -name "pcre.h" in / originally to figure out where the file was, if you haven't done that same I would do that and then adjust the --extra-include-dirs value to point to that directory.

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