[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 2653ce7 312/385: checks on the hsinspect
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 2653ce7 312/385: checks on the hsinspect binary |
Date: |
Tue, 5 Oct 2021 23:59:54 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 2653ce747a52c71f593778deb0610e9ee632982b
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
checks on the hsinspect binary
---
haskell-tng-hsinspect.el | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/haskell-tng-hsinspect.el b/haskell-tng-hsinspect.el
index 79b2ccc..e002be9 100644
--- a/haskell-tng-hsinspect.el
+++ b/haskell-tng-hsinspect.el
@@ -136,21 +136,39 @@ A prefix argument ensures that caches are flushes."
flush-cache)))
;; TODO add a project-wide variable cache
-(defvar haskell-tng--hsinspect-which-hsinspect
- "cabal exec -v0 which -- hsinspect")
(defun haskell-tng--hsinspect-exe (&optional flush-cache)
- "The binary to use for `hsinspect'"
+ "The cached binary to use for `hsinspect'"
(when-let (package-dir (or
(haskell-tng--util-locate-dominating-file
haskell-tng--compile-dominating-project)
(haskell-tng--util-locate-dominating-file
haskell-tng--compile-dominating-package)))
(haskell-tng--hsinspect-cached-disk
- (lambda () (string-trim (shell-command-to-string
haskell-tng--hsinspect-which-hsinspect)))
+ #'haskell-tng--hsinspect-which-hsinspect
(concat "which" (expand-file-name package-dir) "hsinspect")
nil
flush-cache)))
+(defvar haskell-tng--hsinspect-which-hsinspect
+ "cabal exec -v0 which -- hsinspect")
+(defun haskell-tng--hsinspect-which-hsinspect ()
+ "Finds and checks the hsinspect binary for the current buffer.
+
+This is uncached, prefer `haskell-tng--hsinspect-exe'."
+ (let ((bin
+ (string-trim
+ (shell-command-to-string
+ haskell-tng--hsinspect-which-hsinspect))))
+ (if (file-executable-p bin)
+ (let ((version
+ (string-trim
+ (shell-command-to-string (concat bin " --version")))))
+ (if (member version '("0.0.7" "0.0.8"))
+ bin
+ (user-error "The hsinspect binary is the wrong version: %S"
version)))
+ ;; TODO from 0.0.8+ do a --ghc-version check (a common failure mode)
+ (user-error "The hsinspect binary is not executable: %S" bin))))
+
(defun haskell-tng--hsinspect (flush-cache &rest params)
(ignore-errors (kill-buffer "*hsinspect*"))
(when-let ((ghcflags (haskell-tng--hsinspect-ghcflags))
- [nongnu] elpa/haskell-tng-mode f56bd2a 256/385: prefer optimised hsinspect builds, (continued)
- [nongnu] elpa/haskell-tng-mode f56bd2a 256/385: prefer optimised hsinspect builds, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e84970b 263/385: rename -contrib to -extra, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode af443a1 269/385: fix a name clash in the tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode cce466c 271/385: hsinspect now has a compiler plugin, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d0cd9b9 252/385: documenting an annoying indentation bug, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode afbac7c 300/385: missing import, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7060573 286/385: moar work to do here, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 89db192 289/385: more thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b46dbd1 305/385: refactoring of the cache for more reuse later, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ff76e07 304/385: cache the index command, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2653ce7 312/385: checks on the hsinspect binary,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode da20f0d 314/385: note about limitations on nixos, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 52d984a 324/385: fix cache typo, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ae8ebbc 320/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode aca98c2 333/385: simplify import-symbol-at-point logic, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1e3c465 329/385: import types and data constructors, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3ab7495 342/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ef3cea6 340/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a14a2c2 332/385: allow dir locals for the -as lookups, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2050c16 323/385: bad parameter order, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2d50a06 358/385: enable CI, ELPA Syncer, 2021/10/06