ASDF is confused by empty entries in XDG_DATA_DIRS

Bug #1649888 reported by 3b on 2016-12-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ASDF
Medium
Faré

Bug Description

reported by jean377 on IRC, using asdf 3.1.5, sbcl 1.3.12.53, ubuntu 16.04:

;; while loading quicklisp

debugger invoked on a ASDF/SOURCE-REGISTRY:INVALID-SOURCE-REGISTRY in thread
#<THREAD "main thread" RUNNING {1001BB6703}>:
  Invalid source registry (:DIRECTORY (NIL "systems/")) (will be skipped)

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [RETRY ] Retry ASDF operation.
  1: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  2: [RETRY ] Retry EVAL of current toplevel form.
  3: [CONTINUE ] Ignore error and continue loading file "/home/jeantbm/quicklisp/setup.lisp".
  4: [ABORT ] Abort loading file "/home/jeantbm/quicklisp/setup.lisp".
  5: Exit debugger, returning to top level.

(UIOP/CONFIGURATION:REPORT-INVALID-FORM ASDF/SOURCE-REGISTRY:INVALID-SOURCE-REGISTRY :FORM (:DIRECTORY (NIL "systems/
")) :LOCATION NIL)
0] back

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1001BB6703}>
0: (UIOP/CONFIGURATION:REPORT-INVALID-FORM ASDF/SOURCE-REGISTRY:INVALID-SOURCE-REGISTRY :FORM (:DIRECTORY (NIL "syste
ms/")) :LOCATION NIL)
1: (UIOP/CONFIGURATION:VALIDATE-CONFIGURATION-FORM (:SOURCE-REGISTRY (:DIRECTORY (NIL . #1=("systems/"))) (:TREE (NIL
 . #2=("source/"))) (:DIRECTORY (#3=#P"/var/lib/snapd/desktop/common-lisp/" . #1#)) (:TREE (#3# . #2#)) :INHERIT-CONF
IGURATION) :SOURCE-REGISTRY ASDF/SOURCE-REGISTRY:VALIDATE-SOURCE-REGISTRY-DIRECTIVE :LOCATION NIL :INVALID-FORM-REPOR
TER ASDF/SOURCE-REGISTRY:INVALID-SOURCE-REGISTRY)
2: ((:METHOD ASDF/SOURCE-REGISTRY:PROCESS-SOURCE-REGISTRY (CONS)) (:SOURCE-REGISTRY (:DIRECTORY (NIL . #1=("systems/"
))) (:TREE (NIL . #2=("source/"))) (:DIRECTORY (#3=#P"/var/lib/snapd/desktop/common-lisp/" . #1#)) (:TREE (#3# . #2#)
) :INHERIT-CONFIGURATION) :INHERIT NIL :REGISTER #<CLOSURE (LAMBDA (DIRECTORY &KEY :RECURSE :EXCLUDE) :IN ASDF/SOURCE
-REGISTRY:FLATTEN-SOURCE-REGISTRY) {10020C9E6B}>) [fast-method]
3: (ASDF/SOURCE-REGISTRY::PROCESS-SOURCE-REGISTRY-DIRECTIVE :INHERIT-CONFIGURATION :INHERIT (ASDF/SOURCE-REGISTRY:DEF
AULT-SYSTEM-SOURCE-REGISTRY) :REGISTER #<CLOSURE (LAMBDA (DIRECTORY &KEY :RECURSE :EXCLUDE) :IN ASDF/SOURCE-REGISTRY:
FLATTEN-SOURCE-REGISTRY) {10020C9E6B}>)

caused by XDG_DATA_DIRS=:/var/lib/snapd/desktop

Not sure if this is technically a bug in ASDF, since I can't tell if empty entries are valid or what they should mean if so (spec doesn't mention the possibility that i can see), but it is a problem currently due to https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1575014 (snapd is included by default on ubuntu 16.04 as far as i can tell)

Would be nice to at least have a better (and continuable) error in that case, optionally try to handle it transparently (not sure if it should ignore the empty entry or replace it with the XDG default dirs in that case).

Faré (fahree) wrote :

One workaround would be in uiop/configuration.lisp to edit functions xdg-data-dirs and xdg-config-dirs to (remove nil ...) inside the outer (mapcar ...).

I don't know what is the Right Thing™ to do, though.

Robert, what do you think?

Faré (fahree) wrote :

OK, thinking about it a bit more, I believe that getenv-pathnames should (1) take an argument specifying what to do when an invalid pathname is specified, and (2) if the errors were ignored, remove nil entries. The xdg-data-dirs would warn but not error when an invalid pathname is specified.

Faré (fahree) wrote :

We should try to fix that for ASDF 3.3

Changed in asdf:
importance: Undecided → Medium
milestone: none → 3.3
status: New → Confirmed
Faré (fahree) wrote :

Please try https://gitlab.common-lisp.net/asdf/asdf/merge_requests/63 and tell me if the proposed fix works for you.

Changed in asdf:
assignee: nobody → Faré (fahree)
status: Confirmed → Fix Committed
Changed in asdf:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers