From 0adf6e9b111be5ec698b853c3767ca0470249066 Mon Sep 17 00:00:00 2001 From: vyzo Date: Sun, 15 Oct 2023 21:32:19 +0300 Subject: [PATCH] A couple of fixes (#1015) 0. Kill version.ss, the v0.19 development cycle has started. 1. make clean should not try to delete things that don't exist and fail 2. normalize load-path order: 1. GERBIL_LOADPATH 2. GERBIL_PATH/lib 3. GERBIL_HOME/lib (2 is excluded during the build) --- .gitignore | 2 +- src/gerbil/runtime/init.ss | 22 ++++++++++++---------- src/gerbil/runtime/version.ss | 1 - src/std/make.ss | 5 +++-- 4 files changed, 16 insertions(+), 14 deletions(-) delete mode 100644 src/gerbil/runtime/version.ss diff --git a/.gitignore b/.gitignore index c0f4d11a8..fc2aeda5e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,7 @@ src/TAGS .build* doc/node_modules doc/.vuepress/dist -# src/gerbil/runtime/version.ss +src/gerbil/runtime/version.ss src/gerbil/boot-gxi src/bootstrap/static diff --git a/src/gerbil/runtime/init.ss b/src/gerbil/runtime/init.ss index 830b6163e..696626792 100644 --- a/src/gerbil/runtime/init.ss +++ b/src/gerbil/runtime/init.ss @@ -243,20 +243,22 @@ namespace: #f ;; initialize the load path (let* ((home (gerbil-home)) (libdir (path-expand "lib" home)) - (loadpath - (cond - ((getenv "GERBIL_LOADPATH" #f) - => (lambda (envvar) - (filter (lambda (x) (not (string-empty? x))) - (string-split envvar #\:)))) - (else '()))) (userpath (path-expand "lib" (gerbil-path))) (loadpath (if (getenv "GERBIL_BUILD_PREFIX" #f) - loadpath - (cons userpath loadpath)))) - (current-module-library-path (cons libdir loadpath))) + [libdir] + [userpath libdir])) + (loadpath + (cond + ((getenv "GERBIL_LOADPATH" #f) + => (lambda (envvar) + (append + (filter (lambda (x) (not (string-empty? x))) + (string-split envvar #\:)) + loadpath))) + (else loadpath)))) + (current-module-library-path loadpath)) ;; initialize the modue registry (let* ((registry-entry (lambda (m) (cons m 'builtin))) diff --git a/src/gerbil/runtime/version.ss b/src/gerbil/runtime/version.ss deleted file mode 100644 index fc9340e5f..000000000 --- a/src/gerbil/runtime/version.ss +++ /dev/null @@ -1 +0,0 @@ -(def (gerbil-version-string) "v0.18") diff --git a/src/std/make.ss b/src/std/make.ss index a53067e3e..0964e9873 100644 --- a/src/std/make.ss +++ b/src/std/make.ss @@ -513,8 +513,9 @@ TODO: (lambda (spec) (for-each (lambda (f) - (displayln "... remove " f) - (delete-file-or-directory f)) + (when (file-exists? f) + (displayln "... remove " f) + (delete-file-or-directory f))) (spec-outputs spec settings))) buildspec))