-
Notifications
You must be signed in to change notification settings - Fork 347
Pr add haskell compiler type #1717
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
Pr add haskell compiler type #1717
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks great afaict, and I'm inclined towards merging this relatively aggressively, but see my notes about removal of the cabal-new-repl
option and potential breakage for users.
…ler-type, which is similar to haskell-process-type. This makes haskell-compile choose build tools the same way haskell-interactive-mode does. Values are 'cabal, 'cabal-project, 'stack, or 'ghc to choose a build tool, or 'auto (default) to look for stack or cabal files. For haskell-process-type the corresponding values remain 'cabal-repl, 'cabal-new-repl, 'stack-repl, 'ghci. In fact 'cabal-new-repl is obsolete and is accepted as a setting of the defcustom, with a warning, but the accessor function (haskell-process-type) returns 'cabal-repl instead. Factors out logic that deals with value 'auto for both of these, as (haskell-build-type). Also removes a bit of duplicated code from (haskell-process-do-cabal) in haskell-load.el.
Don't reuse cabal or stack command when project dir has changed. When haskell-compiler-type is stack or cabal, and no stack or cabal file was found, run in default-directory. Stack or cabal will fail with appropriate error.
79b033c
to
63cc0fd
Compare
Please review again. 1 unexpected results: 2 skipped results: |
The CI results are spurious, sorry: fixed in a71bc2b. This all looks good to me, so I'll go ahead and merge, and if any related issues come up here then I'll tag you in and we can figure them out together. Thanks again! |
Thank you so much.
…On Tue, Sep 15, 2020 at 3:20 PM Steve Purcell ***@***.***> wrote:
The CI results are spurious, sorry: fixed in a71bc2b
<a71bc2b>
.
This all looks good to me, so I'll go ahead and merge, and if any related
issues come up here then I'll tag you in and we can figure them out
together. Thanks again!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1717 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHRT75OE6EJEBVIG7QM5ADSF7SDBANCNFSM4RAQ65RA>
.
|
Have haskell-compile choose a build tool (stack, cabal, ghc) the same way that
haskell-interactive mode chooses a repl (stack repl, cabal repl, ghci).
That is, add a new customization variable haskell-compiler-type analogous to
haskell-process-type. It's an enum with values to select stack, cabal, or ghc;
and the value 'auto tells emacs to find the closest stack.yaml or *.cabal file
to decide.
Also drops the value 'cabal-new-repl for haskell-process-type, since cabal now
defaults to the new (v2) behavior. I did not add a way to choose cabal v1.
The same code (factored out as (haskell-build-type)) is used for compiler and
repl. It does a rough guess, which is good enough since the chosen command can
be previewed and edited.
haskell-compiler-type replaces the bool haskell-compile-ignore-cabal, which
was biased against stack, and inconsistent with haskell-interactive-mode.
Why two variables instead of one? I can't imagine wanting to compile and
interact with different tools, but I didn't want to make haskell-compile
depend on haskell-interactive-mode, since a user may prefer a different emacs
library instead of either of them.
This pull request is similar in intent to the long-pending #1545,
but is based on a more recent haskell-compile.