Closed kalhauge closed 7 years ago
@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.
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
@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.
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
.
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
.
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.
For anyone else that has this problem, I was able to get the build running with Nix on MacOS Monterey using the following default.nix
file.
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/9cc577aa46b0ae2c2b369354bb27055d35c89efd.tar.gz") {}
}:
pkgs.mkShell {
buildInputs = [
# pkgs.haskellPackages.hfsevents
# pkgs.ghc
pkgs.libffi
pkgs.libiconv
pkgs.ncurses
pkgs.stack
pkgs.zlib
pkgs.darwin.apple_sdk.frameworks.CoreServices
pkgs.darwin.apple_sdk.frameworks.Cocoa
pkgs.darwin.objc4.all
];
}
Unfortunately, this still uses a user-level GHC install. Perhaps someone with more time on their hands could figure out a "proper" nix config with the help of the haskell4nix documentation.
On MacOS, running Nix and Stack, hledger-ui does not work:
Some efforts have been done on the internet to fix this:
https://github.com/commercialhaskell/stack/issues/1698
But neither adding
darwin.apple_sdk.frameworks.CoreServices
anddarwin.apple_sdk.frameworks.Cocoa
or addingdarwin.xcode
tonix.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: