From 016b8009c5c7f3665c4c89780b06611f8d1a18cb Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 9 Apr 2017 10:41:17 -0600 Subject: [PATCH] repair "info-cache.rktd" assumption of relative paths Fix for 459a74455c to handle the case that a path to record is not relative. The `raco pkg` tests exposed the problem. --- racket/collects/setup/setup-core.rkt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/racket/collects/setup/setup-core.rkt b/racket/collects/setup/setup-core.rkt index d169015920..2ee8c6c780 100644 --- a/racket/collects/setup/setup-core.rkt +++ b/racket/collects/setup/setup-core.rkt @@ -1278,10 +1278,12 @@ (let ([p (path->main-lib-relative (cc-path cc))]) (if (path? p) ;; Fall back to relative (with ".."s) to info root: - (encode-relative-path - (find-relative-path (cc-info-root cc) - p - #:more-than-root? #t)) + (let ([rp (find-relative-path (cc-info-root cc) + p + #:more-than-root? #t)]) + (if (relative-path? rp) + (encode-relative-path rp) + (path->bytes rp))) p))] [else (path->bytes (cc-path cc))]) (cons (domain) (cc-shadowing-policy cc)))))