diff --git a/cli/zilch-rust.scm b/cli/zilch-rust.scm index e8c1b66..ae89d0e 100644 --- a/cli/zilch-rust.scm +++ b/cli/zilch-rust.scm @@ -79,7 +79,13 @@ executables in the crate, if unspecified) (define crate-dir (let ((m (assoc 'crate-dir options))) (if m (cdr m) (current-directory)))) -(define root-vfs (vfs-from-directory crate-dir)) +(define (remove-target-dir vfs) + (vfs-dir-filter-all + (lambda (dirname) + (not (string=? dirname "target"))) + vfs)) + +(define root-vfs (remove-target-dir (vfs-from-directory crate-dir))) (define-values (cargo-toml cargo-workspace) (parse-cargo-toml root-vfs (read-file (string-append crate-dir "/Cargo.toml")) #f)) (define projects '()) @@ -94,7 +100,7 @@ executables in the crate, if unspecified) (let* ((root (if (and (pair? path) (eq? (car path) 'workspace)) crate-dir dirname)) (new-path (string-append root "/" (if (pair? path) (cdr path) path)))) - (append-dir new-path (vfs-from-directory new-path) workspace)))) + (append-dir new-path (remove-target-dir (vfs-from-directory new-path)) workspace)))) (for-each check-dep (cargo-crate-dependencies crate)) (for-each check-dep (cargo-crate-build-dependencies crate))) @@ -122,7 +128,7 @@ executables in the crate, if unspecified) (for-each (lambda (kv) (when (eq? (car kv) 'replace) - (append-dir (cdr kv) (vfs-from-directory (cdr kv)) #f))) + (append-dir (cdr kv) (remove-target-dir (vfs-from-directory (cdr kv))) #f))) options) (define lockfile (parse-lockfile (read-file (string-append crate-dir "/Cargo.lock"))))