Skip to content

Remove all mentions of cabal-dev. #480

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

Merged
merged 2 commits into from
Mar 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions haskell-customize.el
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Used for locating additional package data files.")
(defcustom haskell-process-type
'auto
"The inferior Haskell process type to use."
:type '(choice (const auto) (const ghci) (const cabal-repl) (const cabal-dev) (const cabal-ghci))
:type '(choice (const auto) (const ghci) (const cabal-repl) (const cabal-ghci))
:group 'haskell-interactive)

(defcustom haskell-process-wrapper-function
Expand Down Expand Up @@ -103,12 +103,6 @@ a per-project basis."
:group 'haskell-interactive
:type '(choice string (repeat string)))

(defcustom haskell-process-path-cabal-dev
"cabal-dev"
"The path for starting cabal-dev."
:group 'haskell-interactive
:type '(choice string (repeat string)))

(defcustom haskell-process-args-ghci
'("-ferror-spans")
"Any arguments for starting ghci."
Expand Down
6 changes: 2 additions & 4 deletions haskell-load.el
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ actual Emacs buffer of the module being loaded."
(cl-ecase (haskell-process-type)
('ghci haskell-process-path-cabal)
('cabal-repl haskell-process-path-cabal)
('cabal-ghci haskell-process-path-cabal)
('cabal-dev haskell-process-path-cabal-dev))
('cabal-ghci haskell-process-path-cabal))
(cl-caddr state)))))

:live
Expand Down Expand Up @@ -247,8 +246,7 @@ actual Emacs buffer of the module being loaded."
:app-name (cl-ecase (haskell-process-type)
('ghci haskell-process-path-cabal)
('cabal-repl haskell-process-path-cabal)
('cabal-ghci haskell-process-path-cabal)
('cabal-dev haskell-process-path-cabal-dev))
('cabal-ghci haskell-process-path-cabal))
:app-icon haskell-process-logo)))))))))

(defun haskell-process-echo-load-message (process buffer echo-in-repl th)
Expand Down
5 changes: 0 additions & 5 deletions haskell-modules.el
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ If DONTCREATE is non-nil don't create a new session."
(let ((modules (shell-command-to-string
(format "%s | %s | %s"
(cond
((eq 'cabal-dev (haskell-process-type))
(if (or (not dontcreate) session)
(format "cabal-dev -s %s/cabal-dev ghc-pkg dump"
(haskell-session-cabal-dir session))
"echo ''"))
((haskell-sandbox-exists-p session)
(concat "ghc-pkg dump -f "
(shell-quote-argument (haskell-sandbox-pkgdb session))))
Expand Down
17 changes: 0 additions & 17 deletions haskell-package.el
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,6 @@

(require 'cl-lib)

;; Dynamically scoped variables.
;; TODO What actually sets this?
(defvar haskell-config-use-cabal-dev)

;; (defun haskell-package-conf-path-get (&optional project)
;; "Gets the user conf or the cabal-dev conf. Get the global conf elsewhere."
;; (if haskell-config-use-cabal-dev
;; (if project
;; (let* ((cabal-path (haskell-project-cabal-dir project)))
;; (format "%scabal-dev/packages-%s.conf/"
;; (if (string-match "/$" cabal-path)
;; cabal-path
;; (concat cabal-path "/"))
;; (haskell-ghc-version)))
;; (haskell-package-conf-user-path-get))
;; (haskell-package-conf-user-path-get)))

(defun haskell-package-conf-user-path-get ()
"Get the user conf path."
(let ((out (shell-command-to-string "ghc-pkg --user list no-results-please")))
Expand Down
10 changes: 1 addition & 9 deletions haskell-process.el
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,7 @@ HPTYPE is the result of calling `'haskell-process-type`' function."
session-name
nil)
(apply haskell-process-wrapper-function
(list (list haskell-process-path-cabal-ghci)))))
('cabal-dev
(let ((dir (concat (haskell-session-cabal-dir session) "/cabal-dev")))
(append (list (format "Starting inferior cabal-dev process %s -s %s ..."
haskell-process-path-cabal-dev dir)
session-name
nil)
(apply haskell-process-wrapper-function
(list (cons haskell-process-path-cabal-dev (list "ghci" "-s" dir))))))))))
(list (list haskell-process-path-cabal-ghci))))))))

(defun haskell-process-make (name)
"Make an inferior Haskell process."
Expand Down
33 changes: 0 additions & 33 deletions tests/haskell-process-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -61,38 +61,5 @@
((haskell-session-target "dummy-session2") => "dumdum-session"))
(haskell-process-compute-process-log-and-command "dummy-session2" 'cabal-repl))))))

(ert-deftest test-haskell-process--compute-process-log-and-command-cabal-ghci ()
(should (equal '("Starting inferior cabal-ghci process using cabal-ghci ..." "dumses3" nil "cabal-ghci")
(let ((haskell-process-path-ghci "ghci"))
(custom-set-variables '(haskell-process-wrapper-function #'identity))
(mocklet (((haskell-session-name "dummy-session3") => "dumses3"))
(haskell-process-compute-process-log-and-command "dummy-session3" 'cabal-ghci))))))

(ert-deftest test-haskell-process--with-wrapper-compute-process-log-and-command-cabal-ghci ()
(should (equal '("Starting inferior cabal-ghci process using cabal-ghci ..." "dumses3" nil "nix-shell" "default.nix" "--command" "cabal-ghci")
(let ((haskell-process-path-ghci "ghci"))
(custom-set-variables '(haskell-process-wrapper-function
(lambda (argv) (append (list "nix-shell" "default.nix" "--command" )
(list (shell-quote-argument (mapconcat 'identity argv " ")))))))
(mocklet (((haskell-session-name "dummy-session3") => "dumses3"))
(haskell-process-compute-process-log-and-command "dummy-session3" 'cabal-ghci))))))

(ert-deftest test-haskell-process--compute-process-log-and-command-cabal-dev ()
(should (equal '("Starting inferior cabal-dev process cabal-dev -s directory/cabal-dev ..." "dumses4" nil "cabal-dev" "ghci" "-s" "directory/cabal-dev")
(let ((haskell-process-path-cabal-dev "cabal-dev"))
(custom-set-variables '(haskell-process-wrapper-function #'identity))
(mocklet (((haskell-session-name "dummy-session4") => "dumses4")
((haskell-session-cabal-dir "dummy-session4") => "directory"))
(haskell-process-compute-process-log-and-command "dummy-session4" 'cabal-dev))))))

(ert-deftest test-haskell-process--with-wrapper-compute-process-log-and-command-cabal-dev ()
(should (equal '("Starting inferior cabal-dev process cabal-dev -s directory/cabal-dev ..." "dumses4" nil "run-with-docker" "cabal-dev\\ ghci\\ -s\\ directory/cabal-dev")
(let ((haskell-process-path-cabal-dev "cabal-dev"))
(custom-set-variables '(haskell-process-wrapper-function
(lambda (argv) (append (list "run-with-docker")
(list (shell-quote-argument (mapconcat 'identity argv " ")))))))
(mocklet (((haskell-session-name "dummy-session4") => "dumses4")
((haskell-session-cabal-dir "dummy-session4") => "directory"))
(haskell-process-compute-process-log-and-command "dummy-session4" 'cabal-dev))))))

;;; haskell-process-tests.el ends here