From 5ef1508942ee083ed22b844f5291e59320016b79 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 15 Oct 2020 16:41:14 +0200 Subject: ui: Only suggest modules that export the unbound variable identifier. Fixes . Reported by Tobias Geerinckx-Rice . * guix/ui.scm (known-variable-definition): Check for variables in the public interface of HEAD, not in HEAD itself. * tests/guix-build.sh: Add test. --- guix/ui.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guix/ui.scm') diff --git a/guix/ui.scm b/guix/ui.scm index 8213e8ebab..8d7bc238bc 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -297,7 +297,8 @@ VARIABLE and return it, or #f if none was found." (hash-map->list (lambda (name module) module) (module-submodules head))))) - (match (module-local-variable head variable) + (match (and=> (module-public-interface head) + (cut module-local-variable <> variable)) (#f (loop next suggestions visited)) (_ (match (module-name head) -- cgit v1.2.3