Function: bazel--external-repository-dir

bazel--external-repository-dir is a natively compiled function defined in bazel.el.

Signature

(bazel--external-repository-dir ROOT)

Documentation

Return a directory name for the parent directory of the external repositories.

ROOT should be the name or file name of the main repository root directory as returned by ‘bazel--repository-root’. Return nil if the external repository directory can’t be determined for any reason; but a non-nil return value is no guarantee that the directory exists.

Source Code

;; Defined in /nix/store/ws8pkszjvcad1rgzqw6wja7qxacylfhn-emacs-packages-deps/share/emacs/site-lisp/elpa/bazel-20261002.1510/bazel.el
(defun bazel--external-repository-dir (root)
  "Return a directory name for the parent directory of the external repositories.
ROOT should be the name or file name of the main repository root
directory as returned by ‘bazel--repository-root’.  Return nil if the
external repository directory can’t be determined for any reason; but a
non-nil return value is no guarantee that the directory exists."
  (declare (ftype (function (string) (or string null))))
  (cl-check-type root string)
  ;; See the commentary in ‘bazel--external-repository’ for how to find external
  ;; repositories.
  (when-let* ((output-dir (file-chase-links (expand-file-name "bazel-out" root)))
              (main-exec-root (file-name-parent-directory output-dir))
              (exec-root (file-name-parent-directory main-exec-root))
              (output-base (file-name-parent-directory exec-root)))
    (file-name-as-directory (expand-file-name "external" output-base))))