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

Haskell compilation #1545

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Haskell compilation #1545

wants to merge 5 commits into from

Conversation

vasanthaganeshk
Copy link
Contributor

@vasanthaganeshk vasanthaganeshk commented Aug 27, 2017

Breaking Change

  • New compilation mode

  • The good

    • Works very similarly to existing haskell-interactive-mode/inf-haskell.
    • It uses haskell-process-type for deducing the compilation command. (Different ones in the presence of cabal.sandbox.config, stack.yaml. Fully explained in the docs here.)
    • Standard key bindings from compile.el (this existed before, but it is documented now).
  • The bad

    • Breaking change
    • New defcustoms
    • Old defcustoms removed.

@gracjan
Copy link
Contributor

gracjan commented Aug 28, 2017

Okay, so this is not that simple:

  1. There are projects that have both xxx.cabal and stack.yml and people want to be able to choose which one to use this time. Some projects have stack.yml as convenience only and their authors develop using xxx.cabal. Also find-dominating-file may find stack.yml up the directory tree when author meant only a cabal file in one of the subdirectories.
  2. The reason for both haskell-compile-cabal-build-command and haskell-compile-cabal-build-command-alt is you may want to normally use a command like cabal build and from time to time do a different command like cabal configure && cabal build. I'm not sure who is using this kind of workflow, but I find it hard to change.

Overall it would be better to have a more principled approach for all of this, based on a sensible definition of 'project' and what does it mean to 'select a project', what is 'project time' and which project does a source file belong to. There is too much magic happening around this.

@gracjan gracjan changed the title Haskell compilaion Haskell compilation Aug 29, 2017
@vasanthaganeshk
Copy link
Contributor Author

@gracjan I was thinking why not provide a minimal interface like the one provided by M-x compile for haskell-compile. It is simple and clear. So with this we can run whatever command we want to run and it will open in a new buffer with HsCompilation mode.

@hvr
Copy link
Member

hvr commented Sep 7, 2017

@gracjan This is btw getting even more confusing with new-build, which throws an (optional) cabal.project and cabal.project.local files (the latter can btw exist even when the former doesn't) into the mix, increasing the combinatorics even more... (you may even end up with those files existing at different levels of your folder hierarchy... fun!) ;-)

@gracjan
Copy link
Contributor

gracjan commented Sep 7, 2017

There was a very crude project selection interaction going on in haskell-get-session. It was confusing and unclear what a project is.

I think we need to define what a project is now, especially because of the backslash that we got on reddit.

Anyway it looks like project management could be a very good selling point of haskell-mode.

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

Successfully merging this pull request may close these issues.

3 participants