sci as submodule

This commit is contained in:
Michiel Borkent 2019-08-17 12:42:20 +02:00 committed by GitHub
parent d1ea9f8360
commit d4fee04df6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 91 additions and 59 deletions

View file

@ -13,6 +13,11 @@ jobs:
LEIN_ROOT: "true" LEIN_ROOT: "true"
steps: steps:
- checkout - checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --remote
- restore_cache: - restore_cache:
keys: keys:
- v1-dependencies-{{ checksum "project.clj" }} - v1-dependencies-{{ checksum "project.clj" }}
@ -51,6 +56,11 @@ jobs:
BABASHKA_TEST_ENV: native BABASHKA_TEST_ENV: native
steps: steps:
- checkout - checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --remote
- restore_cache: - restore_cache:
keys: keys:
- linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }} - linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
@ -107,6 +117,11 @@ jobs:
BABASHKA_TEST_ENV: native BABASHKA_TEST_ENV: native
steps: steps:
- checkout - checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --remote
- restore_cache: - restore_cache:
keys: keys:
- mac-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }} - mac-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
@ -161,6 +176,11 @@ jobs:
LEIN_ROOT: "true" LEIN_ROOT: "true"
steps: steps:
- checkout - checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --remote
- restore_cache: - restore_cache:
keys: keys:
- v1-dependencies-{{ checksum "project.clj" }} - v1-dependencies-{{ checksum "project.clj" }}

1
.gitignore vendored
View file

@ -12,4 +12,3 @@ pom.xml.asc
.hg/ .hg/
/bb /bb
.clj-kondo/.cache .clj-kondo/.cache
/src/sci

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "sci"]
path = sci
url = https://github.com/borkdude/sci

View file

@ -7,9 +7,9 @@
:url "https://github.com/borkdude/babashka"} :url "https://github.com/borkdude/babashka"}
:license {:name "Eclipse Public License 1.0" :license {:name "Eclipse Public License 1.0"
:url "http://opensource.org/licenses/eclipse-1.0.php"} :url "http://opensource.org/licenses/eclipse-1.0.php"}
:source-paths ["src"] :source-paths ["src" "sci/src"]
:dependencies [[org.clojure/clojure "1.9.0"] :resource-paths ["resources" "sci/resources"]
[borkdude/sci "0.0.7"]] :dependencies [[org.clojure/clojure "1.9.0"]]
:profiles {:clojure-1.9.0 {:dependencies [[org.clojure/clojure "1.9.0"]]} :profiles {:clojure-1.9.0 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:clojure-1.10.1 {:dependencies [[org.clojure/clojure "1.10.1"]]} :clojure-1.10.1 {:dependencies [[org.clojure/clojure "1.10.1"]]}
:test {:dependencies [[clj-commons/conch "0.9.2"]]} :test {:dependencies [[clj-commons/conch "0.9.2"]]}

1
sci Submodule

@ -0,0 +1 @@
Subproject commit 6f3a1882cd03cbba23a35e5bb657772c4a045615

View file

@ -11,11 +11,11 @@ fi
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION) BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
# We also need to AOT sci, else something didn't work in the Mac build on CircleCI # # We also need to AOT sci, else something didn't work in the Mac build on CircleCI
# See https://github.com/oracle/graal/issues/1613 # # See https://github.com/oracle/graal/issues/1613
( cd /tmp; git clone https://github.com/borkdude/sci 2> /dev/null || true ) # ( cd /tmp; git clone https://github.com/borkdude/sci 2> /dev/null || true )
mkdir -p src/sci # mkdir -p src/sci
cp -R /tmp/sci/src/* src # cp -R /tmp/sci/src/* src
lein with-profiles +clojure-1.10.1 do clean, uberjar lein with-profiles +clojure-1.10.1 do clean, uberjar
$GRAALVM_HOME/bin/native-image \ $GRAALVM_HOME/bin/native-image \

View file

@ -23,6 +23,9 @@
("--stream") (recur (rest options) ("--stream") (recur (rest options)
(assoc opts-map (assoc opts-map
:stream? true)) :stream? true))
("--time") (recur (rest options)
(assoc opts-map
:time? true))
("-i") (recur (rest options) ("-i") (recur (rest options)
(assoc opts-map (assoc opts-map
:raw-in true)) :raw-in true))
@ -125,10 +128,13 @@
[& args] [& args]
#_(binding [*out* *err*] #_(binding [*out* *err*]
(prn ">> args" args)) (prn ">> args" args))
(or (let [t0 (System/currentTimeMillis)
(let [{:keys [:version :raw-in :raw-out :println? {:keys [:version :raw-in :raw-out :println?
:help? :file :command-line-args :help? :file :command-line-args
:expression :stream?] :as _opts} (parse-opts args)] :expression :stream? :time?] :as _opts}
(parse-opts args)
exit-code
(or
#_(binding [*out* *err*] #_(binding [*out* *err*]
(prn ">>" _opts)) (prn ">>" _opts))
(second (second
@ -173,8 +179,11 @@
(when-let [msg (or (:stderr (ex-data e)) (when-let [msg (or (:stderr (ex-data e))
(.getMessage e))] (.getMessage e))]
(println (str/trim msg) ))) (println (str/trim msg) )))
[nil 1]))))) [nil 1]))))
1)) 1)
t1 (System/currentTimeMillis)]
(when time? (println "bb took" (str (- t1 t0) "ms.")))
exit-code))
(defn -main (defn -main
[& args] [& args]