From cce6e8ae10b0a69da7c72b444eae802e7a8120a5 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" <rpgoldman@gmail.com> Date: Mon, 24 Feb 2014 09:19:10 -0600 Subject: [PATCH] Check for use of obsolete "FEATURE" syntax in dependencies. The dependency parser (used to put dependencies in canonical form), now raises an error if obsolete FEATURE syntax is used. This should direct programmers to an easy fix. A test is also added. --- parse-defsystem.lisp | 2 ++ test/test-cache-for-introspection.script | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/parse-defsystem.lisp b/parse-defsystem.lisp index 1c66dae5..496486c8 100644 --- a/parse-defsystem.lisp +++ b/parse-defsystem.lisp @@ -141,6 +141,8 @@ (sysdef-error "Ill-formed feature dependency: ~s" dd)) (let ((embedded (parse-dependency-def (third dd)))) `(:feature ,(second dd) ,embedded))) + (feature + (sysdef-error "`feature' has been removed from the dependency spec language of ASDF. Use :feature instead in ~s." dd)) (:require (unless (= (length dd) 2) (sysdef-error "Ill-formed require dependency: ~s" dd)) diff --git a/test/test-cache-for-introspection.script b/test/test-cache-for-introspection.script index 058453b4..e866e4c2 100644 --- a/test/test-cache-for-introspection.script +++ b/test/test-cache-for-introspection.script @@ -38,6 +38,9 @@ (:file "file4" :if-feature (:not :common-lisp)))))) + + + (DBG "The weakly-depends-on information is properly cached") (assert (equal '("file3-only") (system-weakly-depends-on (find-system "test-weakly-depends-on")))) (assert (null (system-weakly-depends-on (find-system "test-no-weakly-depends-on")))) @@ -55,3 +58,18 @@ (assert (equalp '((:version "test-asdf/2" "2.1") "file3-only" (:feature :foo (:require "blort"))) (system-depends-on (find-system :test-structured-depends)))) + +(DBG "Test removal of non-orthogonal feature syntax.") +(assert (typep + (catch 'error + (handler-bind ((system-definition-error + #'(lambda (e) + (throw 'error e)))) + (def-test-system :test-structured-depends-with-obsolete-feature-syntax + :depends-on ((:version test-asdf/2 "2.1") :file3-only (feature :foo (:require "blort"))) + :components + ((:file "file2" :depends-on ("foo")) + (:module "foo" :pathname "" + :components ((:file "file1") + (:file "file4" :if-feature (:not :common-lisp)))))))) + 'system-definition-error)) -- GitLab