From cf32daf8ceb6f1f6fc7cdf22aa9415af8ccf1c67 Mon Sep 17 00:00:00 2001 From: Benson Chu Date: Sat, 4 Apr 2026 16:56:15 -0500 Subject: [PATCH] Let's not do tramp for now --- lisp/llvm-lib/lib-comp-dev.el | 37 ++++++------------- .../llvm-act-on-file/act-on-c-file.el | 6 +-- .../llvm-act-on-file/act-on-tablegen-file.el | 8 ++-- .../llvm-act-on-file/llvm-act-on-file.el | 36 +++++++++--------- 4 files changed, 36 insertions(+), 51 deletions(-) diff --git a/lisp/llvm-lib/lib-comp-dev.el b/lisp/llvm-lib/lib-comp-dev.el index 8858fbe..5b6b573 100644 --- a/lisp/llvm-lib/lib-comp-dev.el +++ b/lisp/llvm-lib/lib-comp-dev.el @@ -54,7 +54,7 @@ (defclass comp-dev-config () ((root-dir :initarg :root-dir :type string) (target :initarg :target :type string) - (tramp-connection :initarg :tramp :type list :initform nil) + ;; (tramp-connection :initarg :tramp :type list :initform nil) (aux-props :initarg :aux-props :type list :initform nil))) @@ -105,20 +105,6 @@ (setf (slot-value (comp-dev/get-config) key) val)) -(defun lls/tramp-connection () - (lls/conf-get 'tramp-connection)) - -(defun lls/trampify (path) - (if-let ((vec (lls/tramp-connection))) - (tramp-make-tramp-file-name vec path) - path)) - -(defun lls/un-trampify (path) - (if-let ((vec (lls/tramp-connection))) - (with-parsed-tramp-file-name path nil - localname) - path)) - (defun lls/default-initialize () (interactive) (let ((lls/target-init-fun #'lls/default-target-init)) @@ -200,17 +186,16 @@ collection nil nil initial-input))))) (defun lls/prompt-tool (tool-regexp &optional directories) - (lls/un-trampify - (let (;;(vertico-sort-function nil) - ) - (my/completing-read tool-regexp - (lls/get-tool tool-regexp - (or (and (eq 'string (type-of directories)) - (list directories)) - directories)) - (awhen (ti/current-tools-directory) - (concat (file-name-nondirectory it) - " ")))))) + (let (;;(vertico-sort-function nil) + ) + (my/completing-read tool-regexp + (lls/get-tool tool-regexp + (or (and (eq 'string (type-of directories)) + (list directories)) + directories)) + (awhen (ti/current-tools-directory) + (concat (file-name-nondirectory it) + " "))))) (defun lls/get-tool (tool-regexp &optional directories) (cl-mapcan #'(lambda (dir) diff --git a/lisp/llvm-lib/llvm-act-on-file/act-on-c-file.el b/lisp/llvm-lib/llvm-act-on-file/act-on-c-file.el index f3577af..52aa00e 100644 --- a/lisp/llvm-lib/llvm-act-on-file/act-on-c-file.el +++ b/lisp/llvm-lib/llvm-act-on-file/act-on-c-file.el @@ -134,8 +134,8 @@ (ediff-files "/tmp/no-option.asm" "/tmp/yes-option.asm"))) (defun ll/diff-on-compiler (file action) - (let ((comm (ll/build-clang-command (lls/un-trampify file) action)) - (second-command (ll/build-clang-command (lls/un-trampify file) action)) + (let ((comm (ll/build-clang-command file action)) + (second-command (ll/build-clang-command file action)) (pipe (if (y-or-n-p "Diff assembly (y) or debug (n)? ") ">" "2>"))) (when (save-window-excursion @@ -165,7 +165,7 @@ (t ".ll"))))) (if (eq action 'diff) (ll/diff-c-on-two-compilations file action) - (let ((comm (ll/build-clang-command (lls/un-trampify file) action output))) + (let ((comm (ll/build-clang-command file action output))) (aprog1 (compilation-start comm diff --git a/lisp/llvm-lib/llvm-act-on-file/act-on-tablegen-file.el b/lisp/llvm-lib/llvm-act-on-file/act-on-tablegen-file.el index 721338d..5be3679 100644 --- a/lisp/llvm-lib/llvm-act-on-file/act-on-tablegen-file.el +++ b/lisp/llvm-lib/llvm-act-on-file/act-on-tablegen-file.el @@ -33,14 +33,14 @@ (cons build-dir it) (reverse it) (cons (file-name-directory file) it) - (mapcar #'(lambda (x) (concat "-I" (lls/un-trampify x))) it) + (mapcar #'(lambda (x) (concat "-I" x)) it) (string-join it " "))) (defun ll-tblgen/gen-command (file flags output-file build-dir) (let ((bin (car (lls/get-tool "llvm-tblgen$" (list (expand-file-name "bin" build-dir)))))) (format "%s %s %s %s" bin - (lls/un-trampify file) + file (ll-tblgen/get-includes file build-dir) (string-join (list @@ -142,11 +142,11 @@ (setq comm (concat comm " --print-records"))) ((eq action ?c) (setq comm (concat (format "mkdir -p %s" - (lls/un-trampify (diredp-parent-dir out))) + (diredp-parent-dir out)) " && " comm (format " -o %s" - (lls/un-trampify out)))))) + out))))) (compilation-start comm diff --git a/lisp/llvm-lib/llvm-act-on-file/llvm-act-on-file.el b/lisp/llvm-lib/llvm-act-on-file/llvm-act-on-file.el index c01b15a..ff577df 100644 --- a/lisp/llvm-lib/llvm-act-on-file/llvm-act-on-file.el +++ b/lisp/llvm-lib/llvm-act-on-file/llvm-act-on-file.el @@ -46,24 +46,24 @@ (let ((file (or (buffer-file-name) (aprog1 (make-temp-file nil nil ".ll") (write-file it))))) - (when-let ((vec (lls/tramp-connection)) - ((not (file-remote-p file)))) - ;; If there's a cache entry, and the cache timestamp matches, - ;; then we just reuse the file - (--> - (if-let* ((cache (gethash file ll/buffer-map)) - (time (visited-file-modtime)) - ((equal time (car cache)))) - (cdr cache) - ;; Otherwise, generate a new tmp file, copy that over, and - ;; update the cache. - (let ((tmp (concat (tramp-make-tramp-temp-name vec) - "." (file-name-extension file)))) - (puthash file (cons time tmp) ll/buffer-map) - (copy-file file tmp) - tmp)) - (setq file it))) - ;; Let further compilation-commands be run over tramp + ;; (when-let ((vec (lls/tramp-connection)) + ;; ((not (file-remote-p file)))) + ;; ;; If there's a cache entry, and the cache timestamp matches, + ;; ;; then we just reuse the file + ;; (--> + ;; (if-let* ((cache (gethash file ll/buffer-map)) + ;; (time (visited-file-modtime)) + ;; ((equal time (car cache)))) + ;; (cdr cache) + ;; ;; Otherwise, generate a new tmp file, copy that over, and + ;; ;; update the cache. + ;; (let ((tmp (concat (tramp-make-tramp-temp-name vec) + ;; "." (file-name-extension file)))) + ;; (puthash file (cons time tmp) ll/buffer-map) + ;; (copy-file file tmp) + ;; tmp)) + ;; (setq file it))) + ;; ;; Let further compilation-commands be run over tramp (let ((default-directory (file-name-directory file))) (pcase (file-name-extension file) ((and _ (guard (ll/is-test-file file)))