diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-07-19 23:48:09 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-07-20 01:32:17 +0200 |
commit | a2a94b6e58e5120462d6861bdf72efa2170bfd73 (patch) | |
tree | f676bd14b7ed98f6bdb2e0eaaeeaefd058c77235 /guix/discovery.scm | |
parent | ddc586ea5c1fd65e29d626c54da1d192c71b6750 (diff) | |
download | patches-a2a94b6e58e5120462d6861bdf72efa2170bfd73.tar patches-a2a94b6e58e5120462d6861bdf72efa2170bfd73.tar.gz |
ui: 'warn-about-load-error' warns about file/module name mismatches.
* guix/discovery.scm (scheme-modules): Rename the inner 'file' to
'relative'. Pass FILE as an addition argument to WARN.
* guix/ui.scm (warn-about-load-error): Add 'module' argument (actually,
what was called 'file' really contained a module name.) Call
'check-module-matches-file' in the catch-all error case.
(check-module-matches-file): New procedure.
* tests/guix-build.sh: Test it.
Diffstat (limited to 'guix/discovery.scm')
-rw-r--r-- | guix/discovery.scm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/guix/discovery.scm b/guix/discovery.scm index 86f20ec344..468b6c59de 100644 --- a/guix/discovery.scm +++ b/guix/discovery.scm @@ -106,14 +106,14 @@ name and the exception key and arguments." (string-length directory)) (filter-map (lambda (file) - (let* ((file (substring file prefix-len)) - (module (file-name->module-name file))) + (let* ((relative (string-drop file prefix-len)) + (module (file-name->module-name relative))) (catch #t (lambda () (resolve-interface module)) (lambda args ;; Report the error, but keep going. - (warn module args) + (warn file module args) #f)))) (scheme-files (if sub-directory (string-append directory "/" sub-directory) |