Commit 9af4b2e8 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Replace ASDF-Binary-Locations with the newfangled ASDF-Output-Translations

parent 29e4b8e6
=====================
ASDF Output Locations
=====================
========================
ASDF Output Translations
========================
This file specifies how ASDF stores "binary" outputs for its operations,
typically Lisp FASL files, but also any other files
......@@ -11,33 +11,33 @@ Configurations
Configurations specify mappings from source locations to binary locations.
1- An application may explicitly initialize the binary-locations
1- An application may explicitly initialize the output-translations
configuration using the `Configuration API`_ below,
in which case this takes precedence.
It may itself compute this configuration from the command-line,
from a script, from its own configuration file, etc.
2- The source registry will be configured from
the environment variable ``ASDF_OUTPUT_LOCATIONS`` if it exists.
the environment variable ``ASDF_OUTPUT_TRANSLATIONS`` if it exists.
3- The source registry will be configured from
user configuration file
``~/.config/common-lisp/asdf-output-locations.conf``
``~/.config/common-lisp/asdf-output-translations.conf``
if it exists.
4- The source registry will be configured from
user configuration directory
``~/.config/common-lisp/asdf-output-locations.conf.d/``
``~/.config/common-lisp/asdf-output-translations.conf.d/``
if it exists.
5- The source registry will be configured from
system configuration file
``/etc/common-lisp/asdf-output-locations.conf``
``/etc/common-lisp/asdf-output-translations.conf``
if it exists.
6- The source registry will be configured from
system configuration directory
``/etc/common-lisp/asdf-output-locations.conf.d/``
``/etc/common-lisp/asdf-output-translations.conf.d/``
if it exists.
Each of these configurations is specified as a SEXP
......@@ -57,76 +57,117 @@ in configuration files, no matter if the last one inherits or not.
Backward Compatibility
======================
We purposefully do not provide backward compatibility with earlier versions of
We purposefully do NOT provide backward compatibility with earlier versions of
asdf-binary-locations (8 Sept 2009),
common-lisp-controller (6.17) or
common-lisp-controller (7.00) or
cl-launch (2.35),
each of which had similar general capabilities.
Future versions of same packages (if any)
will hopefully use the new ASDF API as defined below.
These previous programs' API was not designed
for easy configuration by the end-user
in an easy way with configuration files,
and their previous API didn't fit the new paradigm.
But this incompatibility won't inconvenience many people.
Indeed, few people use and customize these packages;
these people are experts who can trivially adapt to the new configuration.
Other people will experience software that "just works".
Most people are not experts, could not properly configure these features
(except inasmuch as the default configuration of
common-lisp-controller and/or cl-launch
might have been doing the right thing for some users),
and yet will experience software that "just works",
as configured by the system distributor, or by default.
Nevertheless, if you want to use the old ASDF-Binary-Locations
(the one available as an extension to load of top of ASDF,
not the one built into a few old versions of ASDF),
it may still work if you just make sure you do not configure the new
builtin ASDF-Output-Translations.
But if you configure both ASDF's new builtin and ASDF-Binary-Locations
(or an old common-lisp-controller or cl-launch),
you may experience "interesting" issues, so don't do it.
Configuration DSL
=================
Here is the grammar of the SEXP DSL for asdf-output-locations configuration:
Here is the grammar of the SEXP DSL for asdf-output-translations configuration:
;; A configuration is single SEXP starting with keyword :source-registry
;; followed by a list of directives.
CONFIGURATION := (:asdf-output-locations DIRECTIVE ...)
CONFIGURATION := (:output-translations DIRECTIVE ...)
;; A directive is one of the following:
DIRECTIVE :=
;; add a single directory to be scanned (no recursion)
(:map DIRECTORY-DESIGNATOR DIRECTORY-DESIGNATOR) |
(:include PATHNAME-DESIGNATOR)
;; include a configuration file or directory
(:include PATHNAME-DESIGNATOR) |
;; Your configuration expression MUST contain
;; exactly one of either of these:
(:inherit-configuration) | ; splices contents of inherited configuration
(:ignore-inherited-configuration) ; drop contents of inherited configuration
:inherit-configuration | ; splices contents of inherited configuration
:ignore-inherited-configuration | ; drop contents of inherited configuration
;; enable global cache in ~/.common-lisp/cache/sbcl-1.0.35-x86-64/ or something.
:enable-user-cache |
;; Disable global cache. Map / to /
:disable-cache |
;; add a single directory to be scanned (no recursion)
(DIRECTORY-DESIGNATOR DIRECTORY-DESIGNATOR)
DIRECTORY-DESIGNATOR :=
ABSOLUTE-COMPONENT-DESIGNATOR |
(ABSOLUTE-COMPONENT-DESIGNATOR RELATIVE-COMPONENT-DESIGNATOR ...)
ABSOLUTE-COMPONENT-DESIGNATOR :=
STRING ;; namestring (directory is assumed, better be absolute or bust)
PATHNAME ;; pathname (better be an absolute directory or bust)
:HOME ;; designates the user-homedir-pathname ~/
:USER-CACHE ;; designates the default location for the user cache
:SYSTEM-CACHE ;; designates the default location for the system cache
:ROOT ;; the root of the filesystem hierarchy
STRING | ;; namestring (directory is assumed, better be absolute or bust, **/*.*.* added)
PATHNAME | ;; pathname (better be an absolute directory or bust)
:HOME | ;; designates the user-homedir-pathname ~/
:USER-CACHE | ;; designates the default location for the user cache
:SYSTEM-CACHE | ;; designates the default location for the system cache
:ROOT | ;; the root of the filesystem hierarchy
:CURRENT-DIRECTORY ;; the current directory
RELATIVE-COMPONENT-DESIGNATOR :=
STRING ;; namestring (directory is assumed)
PATHNAME ;; pathname (better be a directory or bust)
:IMPLEMENTATION ;; a directory based on implementation, e.g. sbcl-1.0.32.30-linux-x86-64
STRING | ;; namestring, directory is assumed. If the last component, **/*.*.* is added
PATHNAME | ;; pathname unless last component, directory is assumed.
:IMPLEMENTATION | ;; a directory based on implementation, e.g. sbcl-1.0.32.30-linux-x86-64
:IMPLEMENTATION-TYPE | ;; a directory based on lisp-implementation-type only, e.g. sbcl
:CURRENT-DIRECTORY | ;; all components of the current directory, without the :absolute
:UID | ;; current UID -- not available on Windows
:USER ;; current USER name -- NOT IMPLEMENTED(!)
Relative components better be either relative
or subdirectories of the path before them, or bust.
You may use #+features to customize the configuration file.
The second designator of a mapping may be NIL, indicating that files are not mapped
to anything but themselves (same as if the second designator was the same as the first).
Include statements cause the search to recurse with the path specifications
from the file specified.
An inherit-configuration statement cause the search to recurse with the path
An :inherit-configuration statement cause the search to recurse with the path
specifications from the next configuration
(see section Configurations_ above).
:enable-user-cache is the same as (:root :user-cache).
:disable-cache is the same as (:root :root).
:user-cache uses the contents of variable asdf::*output-translations-user-cache*
which by default is the same as using (:home ".cache" "common-lisp" :implementation).
:system-cache uses the contents of variable asdf::*output-translations-system-cache*
which by default is the same as the user-cache.
Configuration Directories
=========================
Configuration directories consist in files each contains
a list of directives without any enclosing ``(:asdf-binary-locations ...)`` form.
a list of directives without any enclosing ``(:asdf-output-translations ...)`` form.
The files will be sorted by namestring as if by #'string< and
the lists of directives of these files with be concatenated in order.
An implicit ``:inherit-configuration`` will be included
......@@ -144,19 +185,19 @@ or namestring in an ``:include`` directive, e.g.::
Shell-friendly syntax for configuration
=======================================
When considering environment variable ``ASDF_OUTPUT_LOCATIONS``
When considering environment variable ``ASDF_OUTPUT_TRANSLATIONS``
ASDF will skip to next configuration if it's an empty string.
It will ``READ`` the string as a SEXP in the DSL
if it begins with a paren ``(``
and it will be interpreted as a colon-separated list of directories.
Directories should come in pairs, each pair indicating a :map directive.
The magic ``!`` entry indicates the splicing of inherited configuration
The magic empty entry indicates the splicing of inherited configuration
rather than one of entry in a mapping pair.
Semantics of Output Location Mappings
=====================================
Semantics of Output Translations
================================
From the specified configuration, a list of mappings is extracted
in a straightforward way:
......@@ -199,10 +240,10 @@ Output location API
The specified functions are exported from package ASDF.
(initialize-output-locations)
(initialize-output-translations)
will read the configuration and initialize all internal variables.
(clear-output-locations)
(clear-output-translations)
undoes any output location configuration
and clears any cache for the mapping algorithm.
You might want to call that before you
......@@ -212,18 +253,18 @@ The specified functions are exported from package ASDF.
systems defined in the current image, only about
where to look for systems not yet defined.
(ensure-output-locations)
checks whether output locations have been initialized.
(ensure-output-translations)
checks whether output translations have been initialized.
If not, initialize them.
This function will be called before any attempt to operate on a system.
If your application wants to override the provided defaults,
it will have to use the below function process-output-locations.
it will have to use the below function process-output-translations.
(process-output-locations X &key inherit collect)
(process-output-translations X &key inherit collect)
If X is a CONS, parse it as a SEXP in the configuration DSL,
and extend or override inheritted configuration.
If X is a STRING, first parse it into a SEXP
as for the ASDF_OUTPUT_LOCATIONS
as for the ASDF_OUTPUT_TRANSLATIONS
environment variable (see above) then process it.
If X is a PATHNAME, read the file as a single SEXP and process it.
The inheritted configuration is provided in keyword argument inherit,
......@@ -232,9 +273,9 @@ The specified functions are exported from package ASDF.
and defaulting to a list of functions
that implements the default behavior.
(translate-output-locations PATHNAME)
(translate-output-translations PATHNAME)
Applies the configured output location translations to PATHNAME
(calls ensure-output-locations for the locations).
(calls ensure-output-translations for the translations).
Credits
=======
......
......@@ -101,11 +101,11 @@ DIRECTIVE :=
;; Your configuration expression MUST contain
;; exactly one of either of these:
(:inherit-configuration) | ; splices contents of inherited configuration
(:ignore-inherited-configuration) ; drop contents of inherited configuration
:inherit-configuration | ; splices contents of inherited configuration
:ignore-inherited-configuration | ; drop contents of inherited configuration
;; This directive specifies that some default must be spliced.
(:default-registry)
:default-registry
PATTERN := a string without wildcards, that will be matched exactly
against the name of a any subdirectory in the directory component
......@@ -303,4 +303,4 @@ Thanks to Rommel Martinez for the initial implementation attempt.
All bad design ideas and implementation bugs are to mine, not theirs.
But so are good design ideas and elegant implementation tricks.
-- Francois-Rene Rideau <fare@tunes.org>, Sun, 31 Jan 2010 14:27:55 -0500
-- Francois-Rene Rideau <fare@tunes.org>, Mon, 1 Feb 2010 22:49:09 -0500
This diff is collapsed.
#+xcvb
(module
(:fullname "asdf"
(:fullname "/asdf"
:author ("Daniel Barlow and contributors")
:licence "MIT" ;; MIT-style license. See asdf.lisp
:description "ASDF"
:long-description "Another System Definition Facility."
:depends-on ("asdf")
:depends-on ("asdf" (:when (:featurep :ecl) "asdf-ecl"))
:build-image nil))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment