We were debugging some problems with an internal system and happened to run across this:
(defun make-pathname* (&rest keys &key (directory nil) host (device () #+allegro devicep) name type version defaults #+scl &allow-other-keys) "Takes arguments like CL:MAKE-PATHNAME in the CLHS, and tries hard to make a pathname that will actually behave as documented, despite the peculiarities of each implementation" ;; TODO: reimplement defaulting for MCL, whereby an explicit NIL should override the defaults. (declare (ignorable host device directory name type version defaults)) (apply 'make-pathname (append #+allegro (when (and devicep (null device)) `(:device :unspecific)) keys)))
which is kind of curious, adding :device :unspecific only for Allegro. Tracking it down to see if there were comments in the commit that added the change yielded nothing:
commit 1e4bafdbd4200d3a19722699d6a332316b082b2b Author: Francois-Rene Rideau tunes@google.com Date: Wed Feb 6 04:23:13 2013 +0100
2.28.1: various upgrade issues
1- To make life easier on Xach, stop requiring asdf.lisp to be loaded as source before it's compiled. Instead, wrap each and every single form in an eval-when, most of the time via the with-upgradability macro that also transforms defun into defun* and defgeneric into defgeneric*. Causes massive reindentation :-(
2- Have a proper :version for fallback systems. Will make systems that check the version happier.
3- protect a condition with #+sb-eval. Fixes lp#1116408.
4- Protect warnings-file methods with dynamic when *warnings-file-type* rather than static #+.
Does anyone know why this change was made and what problem it fixed?
Thanks.
Kevin
On Tue, Nov 17, 2015 at 1:11 PM, Kevin Layer layer@franz.com wrote:
We were debugging some problems with an internal system and happened to run across this:
(defun make-pathname* (&rest keys &key (directory nil) host (device () #+allegro devicep) name type version defaults #+scl &allow-other-keys) "Takes arguments like CL:MAKE-PATHNAME in the CLHS, and tries hard to make a pathname that will actually behave as documented, despite the peculiarities of each implementation" ;; TODO: reimplement defaulting for MCL, whereby an explicit NIL should override the defaults. (declare (ignorable host device directory name type version defaults)) (apply 'make-pathname (append #+allegro (when (and devicep (null device)) `(:device :unspecific)) keys)))
which is kind of curious, adding :device :unspecific only for Allegro. Tracking it down to see if there were comments in the commit that added the change yielded nothing:
commit 1e4bafdbd4200d3a19722699d6a332316b082b2b
[...]
Does anyone know why this change was made and what problem it fixed?
Dear Kevin,
That change was just a reindentation. If you keep going along the git blame ${VER}^ -- pathname.lisp history, you find that the commit that introduced this line is 96cecd29 (2.26.85, citing "More pathname madness for allegro"), but it only generalizes 21594070 (2.26.82, citing just testing concerns).
So I suppose this change was born in making asdf run at all and pass its tests.
Since these changes predate the introduction of pathname-equal and of caching file information based on namestring rather than pathname, my guess is that I was desperately trying to eliminate the discrepancy between two ways of generating a "same" pathname (say by merging pathnames and by getting a truename, or using translate-logical-pathname, or directory, etc.). I remember having to deal with a LOT of aggravation in this respect, until I found that semi-portable workaround.
You could remove those lines and see if ASDF still passes its test suite (make t l=allegro). I'd weakly bet that it does, now that it has stopped its quixotic quest to normalize pathnames in a portable way.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org Democracy is but government of the busy, by the bully, for the bossy. — Arthur Seldon, "The Dilemma of Democracy"
Faré wrote:
Dear Kevin,
That change was just a reindentation. If you keep going along the git blame ${VER}^ -- pathname.lisp history, you find that the commit that introduced this line is 96cecd29 (2.26.85, citing "More pathname madness for allegro"), but it only generalizes 21594070 (2.26.82, citing just testing concerns).
Thanks for tracing it back further.
My current theory is that it was done to regularize the device slot on Windows and non-Windows, where Allegro's default is different (nil on Windows and :unspecific on non-Windows). Unfortunately, the reason for this difference is lost in time (oh, the 90's).
If I find I have time, I may do tests you suggest. Thanks.
Kevin
On Tue, Nov 17, 2015 at 1:51 PM, Kevin Layer layer@franz.com wrote:
Faré wrote:
Dear Kevin,
That change was just a reindentation. If you keep going along the git blame ${VER}^ -- pathname.lisp history, you find that the commit that introduced this line is 96cecd29 (2.26.85, citing "More pathname madness for allegro"), but it only generalizes 21594070 (2.26.82, citing just testing concerns).
Thanks for tracing it back further.
My current theory is that it was done to regularize the device slot on Windows and non-Windows, where Allegro's default is different (nil on Windows and :unspecific on non-Windows). Unfortunately, the reason for this difference is lost in time (oh, the 90's).
My first commit 2.26.82 was Unix-only, which is consistent with my running the ASDF tests on Linux first. The 2.26.85 commit made it Windows-too.
I ran the tests after gutting make-pathname* from any non-trivial wrapping around make-pathname, and make t l=allegro still passes.
I gutted this function, with a complete explanation in the commit message. Thanks!
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org Only presidents, editors, and people with tapeworms have the right to use the editorial "we." — Mark Twain
If I find I have time, I may do tests you suggest. Thanks.
Kevin