This branch has patches that add the :here directive to Faré's configuration DSL. This allows for configuration files to have contents like:
(:source-registry (:tree (:here "src/lisp/")) (:tree (:here "extlib/lisp")) (:directory (:here "outlier/")))
... which means if, for instance, I have a source repo with a complex set of directories and .asd files, I can commit a .conf file into the repo and tell you just to "source" it through ASDF, and you'll automagically see all the .asd files in the directory.
This is particularly useful when you don't want people to have to have ASDF grovel over the entire source tree in their working directories. I have found this to be desirable, as I often work in source trees that contain not just lisp code, but Java code (which generates /very/ big trees to search) and data files.
I think this meets Faré's design principle that "everyone can specify what he knows, but doesn't have to specify what he doesn't know."
I am checking this in on a topic branch for easy inspection before inclusion (I hope). The new feature of the DSL is also documented in the texinfo manual.
Cheers, r
On 23 November 2010 23:24, Robert Goldman rpgoldman@sift.info wrote:
This branch has patches that add the :here directive to Faré's configuration DSL. This allows for configuration files to have contents like:
(:source-registry (:tree (:here "src/lisp/")) (:tree (:here "extlib/lisp")) (:directory (:here "outlier/")))
I like the idea, and your patch looks mostly good, but 1- you should probably be using (default-directory) instead of *default-pathname-defaults* 2- why not bind *default-pathname-defaults* instead of a new variable? NB: that would change the meaning of default-directory - may or may not be a good thing. 3- you can wrap the whole body of process-source-registry (pathname &key ...) in a (let ((*proper-variable* (pathname-directory-pathname pathname))) ...)
When you merge into master, don't forget to bump up the version number.
[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ] There are two distinct classes of men in the Nation, those who pay taxes and those who receive and live upon the taxes. — Thomas Paine
On 11/23/10 Nov 23 -11:54 PM, Faré wrote:
On 23 November 2010 23:24, Robert Goldman rpgoldman@sift.info wrote:
This branch has patches that add the :here directive to Faré's configuration DSL. This allows for configuration files to have contents like:
(:source-registry (:tree (:here "src/lisp/")) (:tree (:here "extlib/lisp")) (:directory (:here "outlier/")))
I like the idea, and your patch looks mostly good, but 1- you should probably be using (default-directory) instead of *default-pathname-defaults*
I will modify the code accordingly.
2- why not bind *default-pathname-defaults* instead of a new variable? NB: that would change the meaning of default-directory - may or may not be a good thing.
I'd rather not do that, unless you think it's really important. I like having the distinctive *here-directory* special because it's guaranteed not to mutate parts of the state that I don't understand. I am not confident that by modifying *d-p-d* I won't break something elsewhere.
I could be persuaded to kill the new variable in favor of using *d-p-d*, but I'm not persuaded yet...
3- you can wrap the whole body of process-source-registry (pathname &key ...) in a (let ((*proper-variable* (pathname-directory-pathname pathname))) ...)
I wasn't confident of what would happen in the third branch of the COND --- the one with
(inherit-source-registry inherit :register register)
if I did that. If you're sure I won't mess something up that way, I'll make the change. I'm looking at the test suite, and I'm pretty sure I could bork ASDF by messing up I-S-R without the test suite noticing.
When you merge into master, don't forget to bump up the version number.
Will do.
Happy Thanksgiving! Good luck on your travels!
R
On 24 November 2010 09:46, Robert Goldman rpgoldman@sift.info wrote:
1- you should probably be using (default-directory) instead of *default-pathname-defaults*
I will modify the code accordingly.
Scratch that. You should be using *default-pathname-defaults*, but to save work, bind it to (default-directory) around the call to inherit-source-registry in flatten-source-registry.
2- why not bind *default-pathname-defaults* instead of a new variable? NB: that would change the meaning of default-directory - may or may not be a good thing.
I'd rather not do that, unless you think it's really important. I like having the distinctive *here-directory* special because it's guaranteed not to mutate parts of the state that I don't understand. I am not confident that by modifying *d-p-d* I won't break something elsewhere.
I could be persuaded to kill the new variable in favor of using *d-p-d*, but I'm not persuaded yet...
3- you can wrap the whole body of process-source-registry (pathname &key ...) in a (let ((*proper-variable* (pathname-directory-pathname pathname))) ...)
I wasn't confident of what would happen in the third branch of the COND --- the one with
(inherit-source-registry inherit :register register)
if I did that. If you're sure I won't mess something up that way, I'll make the change. I'm looking at the test suite, and I'm pretty sure I could bork ASDF by messing up I-S-R without the test suite noticing.
You're totally right, my suggestion was wrong on point 2, because of your point 3 below. We probably want to a- distinguish "here" (relative to config file) from "default" (something global set by the user). b- reset "here" to "default" when processing something that's not a file, around the body of inherit-source-registry.
Happy Thanksgiving! Good luck on your travels!
Happy Turkeygeddon!
[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ] Comparing oneself with Galileo or Einstein is certainly good for the ego — provided one refrains from going into too much detail. — John McCarthy
On 11/24/10 Nov 24 -9:59 AM, Faré wrote:
On 24 November 2010 09:46, Robert Goldman rpgoldman@sift.info wrote:
1- you should probably be using (default-directory) instead of *default-pathname-defaults*
I will modify the code accordingly.
Scratch that. You should be using *default-pathname-defaults*, but to save work, bind it to (default-directory) around the call to inherit-source-registry in flatten-source-registry.
Done. Look for push to come, after I've checked to make sure these changes don't break the tests.
BTW, if there's a condition you think I ought to add to the tests, please let me know. I covered a reasonable set of cases, but there are certainly more. I'm not sure which are "interesting" --- i.e. likely to reveal bugs.
....
3- you can wrap the whole body of process-source-registry (pathname &key ...) in a (let ((*proper-variable* (pathname-directory-pathname pathname))) ...)
I wasn't confident of what would happen in the third branch of the COND --- the one with
(inherit-source-registry inherit :register register)
if I did that. If you're sure I won't mess something up that way, I'll make the change. I'm looking at the test suite, and I'm pretty sure I could bork ASDF by messing up I-S-R without the test suite noticing.
You're totally right, my suggestion was wrong on point 2, because of your point 3 below. We probably want to a- distinguish "here" (relative to config file) from "default" (something global set by the user). b- reset "here" to "default" when processing something that's not a file, around the body of inherit-source-registry.
That's what I was trying to do by taking :here to mean *default-pathname-defaults* when *here-directory* is unbound. That was the only expedient I could think of that would make :here do something sensible when it was used interactively....
Cheers, r
Robert Goldman rpgoldman@sift.info writes:
This branch has patches that add the :here directive to Faré's configuration DSL. This allows for configuration files to have contents like:
(:source-registry (:tree (:here "src/lisp/")) (:tree (:here "extlib/lisp")) (:directory (:here "outlier/")))
... which means if, for instance, I have a source repo with a complex set of directories and .asd files, I can commit a .conf file into the repo and tell you just to "source" it through ASDF, and you'll automagically see all the .asd files in the directory.
How can you "source" a file like that?
Zach
By that I meant "you tell the users who check out your repository to include your conf file in their input locations configuration."
My understanding is that this is done using :include ...
On Nov 24, 2010, at 4:38, Zach Beane xach@xach.com wrote:
Robert Goldman rpgoldman@sift.info writes:
This branch has patches that add the :here directive to Faré's configuration DSL. This allows for configuration files to have contents like:
(:source-registry (:tree (:here "src/lisp/")) (:tree (:here "extlib/lisp")) (:directory (:here "outlier/")))
... which means if, for instance, I have a source repo with a complex set of directories and .asd files, I can commit a .conf file into the repo and tell you just to "source" it through ASDF, and you'll automagically see all the .asd files in the directory.
How can you "source" a file like that?
Zach
"Robert P. Goldman" rpgoldman@sift.info writes:
By that I meant "you tell the users who check out your repository to include your conf file in their input locations configuration."
My understanding is that this is done using :include ...
So someone would copy the conf to e.g. ~/.config/common-lisp/source-source-registry.conf.d/ and then change *default-pathname-defaults* to the root of the project, and do an (asdf:initialize-source-registry)?
Zach
On 11/24/10 Nov 24 -7:21 AM, Zach Beane wrote:
"Robert P. Goldman" rpgoldman@sift.info writes:
By that I meant "you tell the users who check out your repository to include your conf file in their input locations configuration."
My understanding is that this is done using :include ...
So someone would copy the conf to e.g. ~/.config/common-lisp/source-source-registry.conf.d/ and then change *default-pathname-defaults* to the root of the project, and do an (asdf:initialize-source-registry)?
Zach
I was assuming that they would leave the conf where it was and add
(:include "/my/checkout/path/asdf.conf")
into one of his/her normal source registry .conf files.
The whole idea is not to have to do complicated monkeying around (as in your example of messing with *default-pathname-defaults*).
That way, all the user needs to know is the location of the .conf file, and all the provider of the repository has to know is the structure of his repository.
I may not fully follow questions about this mechanism, because I think I am working in a different style from others.
For lack of this :here mechanism, I have been sticking with the old style manipulation of asdf:*central-registry*. When I set up a source repo, I provide people who check it out with a simple, one-sexp way of configuring ASDF to use it. This typically uses an ASD-FINDER library of mine, which does directory tree search for .asd files in portable CL. Then, e.g., when I start up a lisp session typically the first thing I do will be to execute a function like
(hydra) (smite) (circa)
These are all names of projects I'm working on currently, and the effect of the command is to populate asdf:*central-registry* appropriately.
From there I can use ASDF normally, now having it set up with the proper
set of libraries for the project in question.
This is necessary because typically the source repositories for these projects contain different versions of different libraries. In order to get consistency across developers, we use no libraries except those in the source repo (well, with the exception of SBCL contribs sometimes, and we handle that by standardizing on a revision of SBCL to use). The source repositories are often clogged with Java code, in addition to lisp code, meaning that simply using one of Fare's :tree directives can be painful.
Hope that clarifies, r