From 8473c1d4a8a5e081cc84521520b8dc7e700b9525 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 22 Jun 2017 12:40:09 -0600 Subject: [PATCH] raco pkg install: error message improvement When a package to be installed has a module that conflicts with an existing installed module, but the existing module isn't in a package, then say so explicitly in the error message. Also report the current collection and links paths. Error reporting could do even more work to figure out which path is relevant, but reporting a list of paths is relatively easy. Listing paths also seems likely to give a user enough hints for this rare case, especially if the user just needs to be reminded that collection links exist. --- racket/collects/pkg/private/install.rkt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/racket/collects/pkg/private/install.rkt b/racket/collects/pkg/private/install.rkt index cf15920bec..5739ba747c 100644 --- a/racket/collects/pkg/private/install.rkt +++ b/racket/collects/pkg/private/install.rkt @@ -311,10 +311,19 @@ "in different scopes " "") pkg conflicting-pkg (pretty-module-path mp)) - (pkg-error (~a "package conflicts with existing installed module\n" + (pkg-error (~a "package conflicts with existing installed module;\n" + " the existing installed module is not part of a package\n" " package: ~a\n" - " module path: ~s") - pkg (pretty-module-path mp))))] + " module path: ~s\n" + " potentially relevant paths:~a") + pkg + (pretty-module-path mp) + (format-list + (for/list ([p (in-list (append + (current-library-collection-paths) + (current-library-collection-links)))] + #:when (path? p)) + p)))))] [(and (not force?) (for/or ([ai (in-set additional-installs)])