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

hledger-ui: hfsevent broken on MacOS/Nix/Stack #613

Closed
kalhauge opened this Issue Sep 26, 2017 · 6 comments

Comments

Projects
None yet
2 participants
@kalhauge

kalhauge commented Sep 26, 2017

On MacOS, running Nix and Stack, hledger-ui does not work:

$ stack build hledger-ui
hledger-1.3.99: build (lib + exe)
hfsevents-0.1.6: configure
hfsevents-0.1.6: build
vty-5.16: configure
vty-5.16: build
vty-5.16: copy/register
Progress: 3/6
--  While building package hfsevents-0.1.6 using:
     $HOME/.stack/setup-exe-cache/x86_64-osx-nix/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx-nix/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: hledger/.stack-work/logs/hfsevents-0.1.6.log

    Configuring hfsevents-0.1.6...
    Building hfsevents-0.1.6...
    Preprocessing library hfsevents-0.1.6...
    [1 of 1] Compiling System.OSX.FSEvents ( System/OSX/FSEvents.hs, .stack-work/dist/x86_64-osx-nix/Cabal-1.24.2.0/build/System/OSX/FSEvents.o )

    /private/var/folders/gh/j563xb_s475dmjn_5n60bwnw0000gn/T/stack73141/hfsevents-0.1.6/cbits/c_fsevents.m:1:10: error:
         fatal error: 'CoreServices/CoreServices.h' file not found
    #include <CoreServices/CoreServices.h>
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    `cc' failed in phase `C Compiler'. (Exit code: 1)

Some efforts have been done on the internet to fix this:

commercialhaskell/stack#1698

But neither adding darwin.apple_sdk.frameworks.CoreServices and
darwin.apple_sdk.frameworks.Cocoa or
adding darwin.xcode
to nix.packages in ~/.stack/config.yaml, works.

I know that this is a problem with hfsevent, Nix and Stack, and not with
hledger-ui, but I thought I would add it here regardless.

Versions:

$ nix-env --version
nix-env (Nix) 1.11.15

$ stack --version
Version 1.5.1, Git revision 600c1f01435a10d127938709556c1682ecfd694e (4861 commits) x86_64 hpack-0.17.1

MacOS Sierra: 10.12.6
@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Sep 27, 2017

Owner

@kalhauge, I don't see this problem on macos 10.12.5. stack is 1.5.1 and config.yaml is default. hfsevents-0.1.6 is installed. I don't use Nix. In the past I have probably run the "install xcode command line tools" step sometimes recommended. Also I may have installed things with homebrew.

Owner

simonmichael commented Sep 27, 2017

@kalhauge, I don't see this problem on macos 10.12.5. stack is 1.5.1 and config.yaml is default. hfsevents-0.1.6 is installed. I don't use Nix. In the past I have probably run the "install xcode command line tools" step sometimes recommended. Also I may have installed things with homebrew.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Sep 27, 2017

Owner

Also:

~$ locate CoreServices.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Headers/CoreServices.h
/System/Library/Frameworks/CoreServices.framework/Versions/A/Headers/CoreServices.h
Owner

simonmichael commented Sep 27, 2017

Also:

~$ locate CoreServices.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Headers/CoreServices.h
/System/Library/Frameworks/CoreServices.framework/Versions/A/Headers/CoreServices.h
@kalhauge

This comment has been minimized.

Show comment
Hide comment
@kalhauge

kalhauge Sep 27, 2017

@simonmichael, nix is a different beast. It tries to keep its build paths pure to the point where it's almost running small virtual machines for each build. This gives some complications with libraries that use OS features. It is especially bad with use of MacOS core libraries.

kalhauge commented Sep 27, 2017

@simonmichael, nix is a different beast. It tries to keep its build paths pure to the point where it's almost running small virtual machines for each build. This gives some complications with libraries that use OS features. It is especially bad with use of MacOS core libraries.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Sep 27, 2017

Owner

Ah I see, a nix-on-mac problem. I've noted it by the nix instructions on the download page.

You said "Maybe splitting hledger-lib and the others into self-contained repositories might reduce building overhead." - you know you can build specific packages, right ? Eg stack build hledger hledger-ui, or make ghcid.

Owner

simonmichael commented Sep 27, 2017

Ah I see, a nix-on-mac problem. I've noted it by the nix instructions on the download page.

You said "Maybe splitting hledger-lib and the others into self-contained repositories might reduce building overhead." - you know you can build specific packages, right ? Eg stack build hledger hledger-ui, or make ghcid.

@simonmichael simonmichael added the docs label Sep 27, 2017

@kalhauge

This comment has been minimized.

Show comment
Hide comment
@kalhauge

kalhauge Sep 27, 2017

It's mostly for developing reasons having different libraries in different repositories makes them easier to develop on using Spacemacs and other tools as they will just run stack build or cabal build.

kalhauge commented Sep 27, 2017

It's mostly for developing reasons having different libraries in different repositories makes them easier to develop on using Spacemacs and other tools as they will just run stack build or cabal build.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Oct 2, 2017

Owner

hledger-ui depends on fsnotify for the --watch feature, and that depends on hfsevents.

I don't want to complicate packaging and testing by making this a conditional build feature. I noted this issue next to the Nix instructions on the download page, hopefully that is enough on our side and the nixies will get it worked out.

Owner

simonmichael commented Oct 2, 2017

hledger-ui depends on fsnotify for the --watch feature, and that depends on hfsevents.

I don't want to complicate packaging and testing by making this a conditional build feature. I noted this issue next to the Nix instructions on the download page, hopefully that is enough on our side and the nixies will get it worked out.

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