diff --git a/.gitignore b/.gitignore index 9034d506e..826667704 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,7 @@ rust/jank # secrets .github_access_token + +# CI thingies +/llvm.sh +/linux-install.sh diff --git a/bin/jank/test_everything.clj b/bin/jank/test_everything.clj index a08657476..fe6a69596 100755 --- a/bin/jank/test_everything.clj +++ b/bin/jank/test_everything.clj @@ -33,7 +33,8 @@ (do ; Install deps required for running our tests. (util/quiet-shell {} "sudo apt-get install -y default-jdk software-properties-common lsb-release npm lcov leiningen") - (util/quiet-shell {} "sudo npm install --global @chrisoakman/standard-clojure-style") + ; TODO: Enable once we're linting Clojure/jank again. + ;(util/quiet-shell {} "sudo npm install --global @chrisoakman/standard-clojure-style") ; Install jank's build deps. (util/quiet-shell {} (os->deps-cmd "Linux")) @@ -58,7 +59,7 @@ (defn -main [{:keys [install-deps? validate-formatting? compiler+runtime]}] (summary/initialize) - (util/log-boundary "Environment") + (util/log-boundary "Show environment") (show-env) (util/log-boundary "Install dependencies") @@ -72,6 +73,6 @@ :build? (:build? compiler+runtime)})) (when (= *file* (System/getProperty "babashka.file")) - (-main {:install-deps? (parse-boolean (or (System/getenv "JANK_INSTALL_DEPS") "true")) - :validate-formatting? (parse-boolean (or (System/getenv "JANK_LINT") "true")) - :compiler+runtime {:build? (some? (System/getenv "JANK_BUILD_TYPE"))}})) + (-main {:install-deps? (parse-boolean (util/get-env "JANK_INSTALL_DEPS" "true")) + :validate-formatting? (parse-boolean (util/get-env "JANK_LINT" "true")) + :compiler+runtime {:build? (some? (util/get-env "JANK_BUILD_TYPE"))}})) diff --git a/bin/jank/util.clj b/bin/jank/util.clj index 80fc72e8d..2a1708932 100644 --- a/bin/jank/util.clj +++ b/bin/jank/util.clj @@ -7,6 +7,15 @@ (def llvm-version 19) +(defn get-env + ([s] + (get-env s nil)) + ([s fallback] + (let [raw (System/getenv s)] + (if-not (empty? raw) + raw + fallback)))) + (defn log-boundary [title] (println "\n────────────────" title "────────────────") (summary/boundary title)) diff --git a/compiler+runtime/bin/jank/compiler+runtime/bash_test.clj b/compiler+runtime/bin/jank/compiler+runtime/bash_test.clj index 7b1bf9a19..1769da95a 100755 --- a/compiler+runtime/bin/jank/compiler+runtime/bash_test.clj +++ b/compiler+runtime/bin/jank/compiler+runtime/bash_test.clj @@ -14,7 +14,7 @@ (util/log-info "Not enabled") (let [bash-test-dir (str compiler+runtime-dir "/test/bash") test-files (b.f/glob bash-test-dir "**/{pass,fail}-test") - extra-env {"PATH" (str compiler+runtime-dir "/build" ":" (System/getenv "PATH"))}] + extra-env {"PATH" (str compiler+runtime-dir "/build" ":" (util/get-env "PATH"))}] (doseq [test-file test-files] (let [expect-pass? (clojure.string/ends-with? (str test-file) "pass-test") dirname (b.f/parent test-file) diff --git a/compiler+runtime/bin/jank/compiler+runtime/core.clj b/compiler+runtime/bin/jank/compiler+runtime/core.clj index 4552b9002..dccaae7c1 100755 --- a/compiler+runtime/bin/jank/compiler+runtime/core.clj +++ b/compiler+runtime/bin/jank/compiler+runtime/core.clj @@ -15,16 +15,16 @@ ; Compile and test (jank.compiler+runtime.build+test/-main {:enabled? build? - :build-type (or (System/getenv "JANK_BUILD_TYPE") "Debug") - :analyze (or (System/getenv "JANK_ANALYZE") "off") - :sanitize (or (System/getenv "JANK_SANITIZE") "none") - :coverage (or (System/getenv "JANK_COVERAGE") "off")}) + :build-type (util/get-env "JANK_BUILD_TYPE" "Debug") + :analyze (util/get-env "JANK_ANALYZE" "off") + :sanitize (util/get-env "JANK_SANITIZE" "none") + :coverage (util/get-env "JANK_COVERAGE" "off")}) ; Bash tests (jank.compiler+runtime.bash-test/-main {:enabled? build?}) ; Codecov (merge results) - (jank.compiler+runtime.coverage/-main {:enabled? (= "on" (or (System/getenv "JANK_COVERAGE") "off"))})) + (jank.compiler+runtime.coverage/-main {:enabled? (= "on" (System/getenv "JANK_COVERAGE" "off"))})) (when (= *file* (System/getProperty "babashka.file")) (-main {:validate-formatting? true