chdir seems not to work on ABCL with run-program

Bug #1452481 reported by Robert P. Goldman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ASDF
Fix Released
Medium
Faré

Bug Description

For me (Mac OS X), test-run-program.script fails on ABCL.

I believe that I have found that it is an unsuccessful interaction between run-shell-command on that platform and UIOP:CHDIR:

ASDF-TEST(4): (chdir *test-directory*)
"/Users/rpg/lisp/asdf"
;;; note that the echoed value here does not agree with what we're setting...
ASDF-TEST(5): (run-shell-command "./good-shell-command")
; $ ./good-shell-command
127

The internal program doesn't work, either, and is more forthcoming about the cause of error:
ASDF-TEST(7): (ext:run-shell-command "./good-shell-command")
/bin/sh: ./good-shell-command: No such file or directory
127

I check that the "current working directory" is what's expected:
ASDF-TEST(8): *test-directory*
#P"/Users/rpg/lisp/asdf/test/"
ASDF-TEST(9): (getcwd)
#P"/Users/rpg/lisp/asdf/test/"

Looking into UIOP:CHDIR, I see that it sets something internal to the JVM:
(java:jstatic "setProperty" "java.lang.System" "user.dir" (namestring x))

presumably this property does not align with the OS notion of working directory, and doesn't get passed through to running the shell command?

Revision history for this message
Faré (fahree) wrote :

Indeed, I used the user.dir system property by following online recipes. But that wasn't enough for run-program, and now that I tested it a bit more, it looks like it didn't work with probe-file, either.

The underlying problem is that the JVM doesn't give access to native chdir without some extensions (using Java Native foo) that aren't available with ABCL. There's a user.dir system property whereby some Java programs kind of fake it, that I tried to use previously, but ABCL apparently doesn't play nice with it.

Therefore, I committed a change whereby ABCL uses *default-pathname-defaults* as our "current directory". I make sure to chdir to it before to run commands with run-program. I try to make the run-program chdir feature work on Windows, but that's untested.

Changed in asdf:
assignee: nobody → Faré (fahree)
importance: Undecided → Medium
milestone: none → asdf3.1.5
status: New → Fix Committed
Changed in asdf:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.