From 9d574fcdd195baed2e1674fb1661f38d04b08350 Mon Sep 17 00:00:00 2001 From: Davie Li Date: Sun, 4 Feb 2024 19:08:34 +0100 Subject: [PATCH] rust: Check if environment already mounted --- env/rust.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/env/rust.scm b/env/rust.scm index f6b55f2..a268188 100644 --- a/env/rust.scm +++ b/env/rust.scm @@ -180,13 +180,14 @@ function." (let* ((target (string-append (@@ (env) %env-directory) "/" (symbol->string target-sym))) - ;; TODO should actually detect if overlay is mounted not that the - ;; directory exists. - (mnt (mount-environment env #:tag onto #:target target)) + (mnt (if (environment-mounted? env) + (or (environment->overlay-mount-maybe env) + (throw 'wrong-mount?)) + (mount-environment env #:tag onto #:target target))) (mappings (append (map (remap #f) expose) (map (remap #t) share)))) (exec-in-rustup-environment '("./.cargo/bin/rust-analyzer") - #:home mnt + #:home (overlay-mount-merged mnt) #:mappings mappings) (sync) (system* "umount" target)