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

Building through Cabal and Nix #73

Open
walseb opened this issue Feb 25, 2024 · 1 comment
Open

Building through Cabal and Nix #73

walseb opened this issue Feb 25, 2024 · 1 comment

Comments

@walseb
Copy link

walseb commented Feb 25, 2024

Hello!

Is anyone able to build this package through Cabal or Nix?

For me, Nix tells me atto-lisp is marked as broken and won't build.

Cabal can't build atto-lisp either, due to a too old base being set.

I tried cloning atto-lisp and removing that limitation, but now it seems like Happy won't build:

Failed to build haskell-src-exts-1.23.1. The failure occurred during the
configure step.
Build log (
/home/admin/.cabal/logs/ghc-9.4.8/haskell-src-exts-1.23.1-82eadf38c5bdf000e30b879f83308c1693e4ed1205ee33cd26bd817cae88a0e5.log
):
Configuring library for haskell-src-exts-1.23.1..
Error: .cabal-wrapped: The program 'happy' version >=1.19 is required but the
version of /home/admin/.cabal/bin/happy could not be determined.

Error: cabal: Failed to build haskell-src-exts-1.23.1 (which is required by
exe:HaskellEmacs from HaskellEmacs-0.0.0). See the build log above for
details.

Thoughts?

@walseb
Copy link
Author

walseb commented Apr 2, 2024

For those wanting to build this on Cabal, you need to clone this: https://github.com/francesquini/atto-lisp
Create a cabal.project pointing to it (simply insert something like packages: ./ ./deps/atto-lisp), and then do a bunch of overrides as this was written prior to cabal v2:

(with-eval-after-load 'haskell-emacs
  (defun haskell-emacs--compile-command (heB)
    "Compile haskell-emacs with buffer HEB."
    (if (eql 1 ;; If this doesn't work for you, I would remove this check. I don't know why my cabal outputs 1.
             (progn (message "Compiling ...")
                    (setq test (+ (call-process "cabal" nil heB nil "init")
                                  ;; (call-process "cabal" nil heB nil "install" "happy" "--overwrite-policy=always") -- just install as a system dependency instead of having cabal install it
                                  (call-process "cabal" nil heB nil "install" "--overwrite-policy=always")))))
        (progn
          (message "Haskell compilation success!")
          (kill-buffer heB))
      (let ((bug (with-current-buffer heB (buffer-string))))
        (kill-buffer heB)
        (error bug))))

  (defun haskell-emacs--set-bin ()
    "Set the path of the executable."
    (setq haskell-emacs--bin "~/.local/bin/HaskellEmacs")))

Also remember to enable cabal

(setq haskell-emacs-build-tool 'cabal)

I think the package needs a bit of a rewrite which I might get to some day.

Brilliant package nonetheless!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant