diff --git a/collects/setup/parallel-build.rkt b/collects/setup/parallel-build.rkt index dd311faf7f..5fd1969710 100644 --- a/collects/setup/parallel-build.rkt +++ b/collects/setup/parallel-build.rkt @@ -3,6 +3,7 @@ (require racket/future racket/list racket/match + racket/path setup/collects unstable/generics) @@ -21,6 +22,12 @@ (define executable (parameterize ([current-directory (find-system-path 'orig-dir)]) (find-executable-path (find-system-path 'exec-file) #f))) + (define collects-dir (let ([p (find-system-path 'collects-dir)]) + (if (complete-path? p) + p + (path->complete-path p (or (path-only executable) + (find-system-path 'orig-dir)))))) + (define (send/msg x ch) (write x ch) (flush-output ch)) @@ -28,7 +35,7 @@ (let-values ([(s o in e) (subprocess #f #f (current-error-port) executable "-X" - (path->string (find-system-path 'collects-dir)) + (path->string collects-dir) "-l" process-worker-library)]) (send/msg i in) diff --git a/src/racket/src/file.c b/src/racket/src/file.c index ede9f768f6..3a893b57b4 100644 --- a/src/racket/src/file.c +++ b/src/racket/src/file.c @@ -3570,10 +3570,16 @@ static char *do_path_to_complete_path(char *filename, long ilen, const char *wrt if (!wrt) { Scheme_Object *wd; - wd = CURRENT_WD(); - wrt = SCHEME_PATH_VAL(wd); - wlen = SCHEME_PATH_LEN(wd); - scheme_security_check_file("path->complete-path", NULL, SCHEME_GUARD_FILE_EXISTS); + if (scheme_current_thread) { + wd = CURRENT_WD(); + wrt = SCHEME_PATH_VAL(wd); + wlen = SCHEME_PATH_LEN(wd); + scheme_security_check_file("path->complete-path", NULL, SCHEME_GUARD_FILE_EXISTS); + } else { + int actlen; + wrt = scheme_os_getcwd(NULL, 0, &actlen, 1); + wlen = actlen - 1; + } } if (kind == SCHEME_WINDOWS_PATH_KIND) { @@ -3614,7 +3620,7 @@ static char *do_path_to_complete_path(char *filename, long ilen, const char *wrt } memcpy(naya + wlen, filename, ilen); naya[wlen + ilen] = 0; - + return naya; }