Re: Added get-env-var to asdf

Gary King <[email protected]> Thu, 5 Apr 2007 16:26:26 -0400
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
The particular problem I wanted to solve was a way to control what
configuration file was using during testing

>   :perform (test-op :after (op c)
> 		    (describe
> 		     (funcall
> 		      (intern (symbol-name '#:run-tests) :lift)
> 		      :config (or (asdf:get-env-var "foo_test_config")
> 				  (find-test-config-in-command-line)
> 				  (system-relative-pathname
> 				   'foo
> 				   "test.config")))))

This let me run different suites of automated tests from shell  
scripts. Features
aren't enough for exactly the reasons Robert mentioned.

I think we all agree on most of the issues. Here is my summary:

* get-env-var is a bad name (get-environment-variable would be  
preferable)
* it's nice to be able to read configuration files dynamically
* we don't want to pollute or dilute ASDF
* we don't want to support every possible configuration mechanism

I could solve my particular itch by moving configuration files around  
and then always
using the same one within my system definition. On the other hand,  
being able to specify
which one to use via the command line or an environment variable  
seems both nicer and
more natural.

I'm of the opinion that environment variables are standard across all  
OSs at this point
(which is what Robert pointed out) and think that they would be  
reasonable to include.

ASDF already has run-shell-command and has also always included

> #+sbcl
> (eval-when (:compile-toplevel :load-toplevel :execute)
>   (when (sb-ext:posix-getenv "SBCL_BUILDING_CONTRIB")
>     (pushnew :sbcl-hooks-require *features*)))

which, in my opinion, lends some weight to the idea that getting at  
environment variables
is a natural feature <smile>.

--
Gary Warren King, metabang.com
Cell: (413) 885 9127
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM





-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV