diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml index 3680f28..cffd01e 100644 --- a/.github/workflows/nix.yaml +++ b/.github/workflows/nix.yaml @@ -34,3 +34,8 @@ jobs: -L \ -o ./imgTarball \ '.#ociImg' + - run: | + nix build \ + -L \ + -o ./imgTarball \ + '.#ociImgSppl' diff --git a/.gitignore b/.gitignore index 37bce73..596c82c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ pom.xml.asc /cljs-test-runner-out/ /.direnv/ /.shadow-cljs/ + +result diff --git a/README.md b/README.md index 047baea..91e804b 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ The command-line application currently supports GenSQL-strict and GenSQL-permiss If you would like to use `GenSQL.query` to query SPPL models you will need to ensure that SPPL is on the classpath, and that [libpython-clj](https://github.com/clj-python/libpython-clj) can find a Python where SPPL is installed. The easiest way to accomplish this is to use [Nix](https://nixos.org/): ```shell -nix develop github:OpenGen/GenSQL.gpm.sppl -c clj -Sdeps '{:deps {io.github.OpenGen/GenSQL.gpm.sppl {:git/sha "718de40878766bb8d08acc2b429a76ed662a1352"}}}' -M -m gensql.query.main --help +nix develop '.#sppl' --command clj -M:query-sppl --help ``` ### Clojure interface @@ -150,7 +150,18 @@ If you forget, a CI job will check it for you when you make a pull request. ```shell nix build '.#uber' -o gensql.jar +# or +nix build '.#uberGpmSppl' -o gensql-sppl.jar ``` +#### Building an OCI image (docker container) + +```shell +nix build '.#ociImg' -o gensql.tgz +# or +nix build '.#ociImgSppl' -o gensql-sppl.tgz +``` + + [codecov-url]: https://codecov.io/github/OpenGen/GenSQL.query [codecov]: https://img.shields.io/codecov/c/github/OpenGen/GenSQL.query/main.svg?maxAge=3600 diff --git a/build.clj b/build.clj index 1b35d32..0b92582 100644 --- a/build.clj +++ b/build.clj @@ -7,7 +7,7 @@ (def uber-file (format "target/%s-%s-standalone.jar" (name lib) version)) ;; delay to defer side effects (artifact downloads) -(def basis (delay (build/create-basis {:project "deps.edn"}))) +(def basis (delay (build/create-basis {:aliases [ :query-sppl ]}))) ;; clean build artifacts (excludes test artifacts) (defn clean [_] diff --git a/deps-lock.json b/deps-lock.json index dc83e2a..062f771 100644 --- a/deps-lock.json +++ b/deps-lock.json @@ -1,6 +1,13 @@ { "lock-version": 3, "git-deps": [ + { + "lib": "io.github.OpenGen/GenSQL.gpm.sppl", + "url": "https://github.com/OpenGen/GenSQL.gpm.sppl.git", + "rev": "718de40878766bb8d08acc2b429a76ed662a1352", + "git-dir": "https/github.com/OpenGen/GenSQL.gpm.sppl", + "hash": "sha256-mAOKu6KU6naFA0ykqUfvz5WA0DlhwXm/2Ze5MAruJDE=" + }, { "lib": "io.github.OpenGen/GenSQL.inference", "url": "https://github.com/OpenGen/GenSQL.inference.git", @@ -86,6 +93,16 @@ "mvn-repo": "https://repo.clojars.org/", "hash": "sha256-JezOPysastKFP6SSVze/8ZvwYnbr/uu5PhHvdTc7ea8=" }, + { + "mvn-path": "camel-snake-kebab/camel-snake-kebab/0.4.2/camel-snake-kebab-0.4.2.jar", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-p7hxVjg5GmkjD1D8Nh6W+zt/vAWXj5zMdO+veamBdrs=" + }, + { + "mvn-path": "camel-snake-kebab/camel-snake-kebab/0.4.2/camel-snake-kebab-0.4.2.pom", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-q0kp6YUZCevRFA1J6OSnV3922+u4eHSlO/wa65suEyc=" + }, { "mvn-path": "cheshire/cheshire/5.10.0/cheshire-5.10.0.pom", "mvn-repo": "https://repo.clojars.org/", @@ -116,6 +133,16 @@ "mvn-repo": "https://repo.clojars.org/", "hash": "sha256-B71Nb2N/jk0TljOexdQI0xDc4OLCs17Wet0qWkDKh7Q=" }, + { + "mvn-path": "clj-python/libpython-clj/2.023/libpython-clj-2.023.jar", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-EE9di3S5qYku7A5hIDtW0x26yFfEoBqAVoE0CtlJHqo=" + }, + { + "mvn-path": "clj-python/libpython-clj/2.023/libpython-clj-2.023.pom", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-bcM6b2zDs4IX9iZQKHurWJeRVemmuHu8+PVuuaW4jmk=" + }, { "mvn-path": "clj-time/clj-time/0.15.2/clj-time-0.15.2.jar", "mvn-repo": "https://repo.clojars.org/", @@ -136,6 +163,16 @@ "mvn-repo": "https://repo.clojars.org/", "hash": "sha256-ahZELYfCkwwDImtKo9KYkVfVi5TtPnyNZ2aLDrZYOJs=" }, + { + "mvn-path": "cljs-bean/cljs-bean/1.7.0/cljs-bean-1.7.0.jar", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-mfia1lyVNncZL4WSMo7CMGwUKY0bILaXUU/s4j2vPzs=" + }, + { + "mvn-path": "cljs-bean/cljs-bean/1.7.0/cljs-bean-1.7.0.pom", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-D/xuvTuPmNwI4tT6OBFRmeMTKV7p/rKzi5PTvVchBbg=" + }, { "mvn-path": "cljs-bean/cljs-bean/1.8.0/cljs-bean-1.8.0.jar", "mvn-repo": "https://repo.clojars.org/", @@ -146,11 +183,6 @@ "mvn-repo": "https://repo.clojars.org/", "hash": "sha256-xMtL7gH6hnrFu8XPdgT+g+022A6zpQD9+qkuObEW7nQ=" }, - { - "mvn-path": "clojure-msgpack/clojure-msgpack/1.2.1/clojure-msgpack-1.2.1.pom", - "mvn-repo": "https://repo.clojars.org/", - "hash": "sha256-idvV+CLoAQw/kJd78R2E2DKXecl1eE5jn+7yezZdmRw=" - }, { "mvn-path": "cloverage/cloverage/1.2.4/cloverage-1.2.4.jar", "mvn-repo": "https://repo.clojars.org/", @@ -161,6 +193,16 @@ "mvn-repo": "https://repo.clojars.org/", "hash": "sha256-n0sJ40YL4OFuAt7ol6BjL0JF9zbVo+Z+y7URF6IzUkc=" }, + { + "mvn-path": "cnuernber/dtype-next/10.000-beta-20/dtype-next-10.000-beta-20.jar", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-FdD4leseGnfZsfiLtFm/XI8cct80yq3V/isw/SdUFY4=" + }, + { + "mvn-path": "cnuernber/dtype-next/10.000-beta-20/dtype-next-10.000-beta-20.pom", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-k675IGYC39vFhNXIJ8Ikp1P71J6OpSRD/eohQXx4zp0=" + }, { "mvn-path": "com/andrewmcveigh/cljs-time/0.5.2/cljs-time-0.5.2.jar", "mvn-repo": "https://repo.clojars.org/", @@ -191,6 +233,16 @@ "mvn-repo": "https://repo.clojars.org/", "hash": "sha256-OZif4zTZYVoDj6UC8jRyaviBTyMlitPTxHdSmEeV0t8=" }, + { + "mvn-path": "com/cnuernber/ham-fisted/1.000-beta-74/ham-fisted-1.000-beta-74.jar", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-QEswSpdd2Bb+EchKfH8TAbPm+vR9jUQE0SzyY40QydA=" + }, + { + "mvn-path": "com/cnuernber/ham-fisted/1.000-beta-74/ham-fisted-1.000-beta-74.pom", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-HsiUDD98kr7OhUy2aDGDaHOVWTrpKyT6xCvcLMkIBNY=" + }, { "mvn-path": "com/cognitect/aws/api/0.8.612/api-0.8.612.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -356,6 +408,26 @@ "mvn-repo": "https://repo.clojars.org/", "hash": "sha256-k3tSiy5LHiJc2cC3o6zxlB/BOVqFe/0MPTUQGNUHdF8=" }, + { + "mvn-path": "com/github/ben-manes/caffeine/caffeine/2.9.3/caffeine-2.9.3.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-Hgp7vvHdeRZTFD8/BdDkiZNL9UgeWKh8nmGc1Gtocps=" + }, + { + "mvn-path": "com/github/ben-manes/caffeine/caffeine/2.9.3/caffeine-2.9.3.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-b6TxwQGSgG+O8FtdS+e9n1zli4dvZDZNTpDD/AkjI9w=" + }, + { + "mvn-path": "com/github/wendykierp/JTransforms/3.1/JTransforms-3.1.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-2d/6Pid5MEDcy5ewVNlSZ99G5mnDlr8cpPOwhQabwtU=" + }, + { + "mvn-path": "com/github/wendykierp/JTransforms/3.1/JTransforms-3.1.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-lrWRq517j7FFnPq0Mo/XSwI/G+7ecE1Wuk7PlF70Wrc=" + }, { "mvn-path": "com/google/auto/auto-parent/6/auto-parent-6.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -466,6 +538,11 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-chYh8BUxLnop8NtXDQi7NjJ/vUpTo+6T3zIUNjzlOXE=" }, + { + "mvn-path": "com/google/guava/guava-parent/31.1-jre/guava-parent-31.1-jre.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-RDliZ4O0StJe8F/wdiHdS7eWzE608pZqSkYf6kEw4Pw=" + }, { "mvn-path": "com/google/guava/guava/30.0-jre/guava-30.0-jre.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -491,6 +568,16 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-ZikplWROlVN+6XqJ6JkBcdjzwmrPmEgwp3kZlwc9RR0=" }, + { + "mvn-path": "com/google/guava/guava/31.1-jre/guava-31.1-jre.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-pC7cnKt5Ljn+ObuU8/ymVe0Vf/h6iveOHWulsHxKAKs=" + }, + { + "mvn-path": "com/google/guava/guava/31.1-jre/guava-31.1-jre.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-kZPQe/T2YBCNc1jliyfSG0TjToDWc06Y4hkWN28nDeI=" + }, { "mvn-path": "com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -526,16 +613,36 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-X6yoJLoRW+5FhzAzff2y/OpGui/XdNQwTtvzD6aj8FU=" }, + { + "mvn-path": "com/google/javascript/closure-compiler-main/v20220502/closure-compiler-main-v20220502.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-7F9PqbsQeH4xxX0tdPqSmZyaTo/MwiDhMUhsvcY461w=" + }, { "mvn-path": "com/google/javascript/closure-compiler-main/v20230802/closure-compiler-main-v20230802.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-xchbVGIcwXAKcFg5OtoTa+GKdC8AY6jRg351j/37QfY=" }, + { + "mvn-path": "com/google/javascript/closure-compiler-parent/v20220502/closure-compiler-parent-v20220502.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-6L656nzyQchrdH9r55W/fsGQ6okKjDyJLpj/TbwehJY=" + }, { "mvn-path": "com/google/javascript/closure-compiler-parent/v20230802/closure-compiler-parent-v20230802.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-xWtaS/2dPJCpZr6NA6tkgO7NdBMyRXMv2Q8bPCJf4R8=" }, + { + "mvn-path": "com/google/javascript/closure-compiler-unshaded/v20220502/closure-compiler-unshaded-v20220502.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-WQx5QFep/7SBikqg0UD5G8GqCv57QhtijJV+wXMtmk0=" + }, + { + "mvn-path": "com/google/javascript/closure-compiler-unshaded/v20220502/closure-compiler-unshaded-v20220502.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-M2wDJLOXG4JktHHYZNSBH0X3IQi7MWCi87DSzdwK4MY=" + }, { "mvn-path": "com/google/javascript/closure-compiler-unshaded/v20230802/closure-compiler-unshaded-v20230802.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -626,6 +733,11 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-wecUDR3qj981KLwePFRErAtUEpcxH0X5gGwhPsPumhA=" }, + { + "mvn-path": "commons-codec/commons-codec/1.12/commons-codec-1.12.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-I99Y+unIPRvNJ3uZ+UKenYwTTwYAtz4uhrI4XteTyB4=" + }, { "mvn-path": "commons-codec/commons-codec/1.12/commons-codec-1.12.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -761,6 +873,16 @@ "mvn-repo": "https://repo.clojars.org/", "hash": "sha256-+yb7uKcebqzMaUdiSNSQrWKtXKxEmqpvi2o6bRW0RoM=" }, + { + "mvn-path": "insn/insn/0.5.2/insn-0.5.2.jar", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-n6t9hk+ogtoP9yv+8ctdSxKRJPg0KVJhGYMNVmQB3zk=" + }, + { + "mvn-path": "insn/insn/0.5.2/insn-0.5.2.pom", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-ID+WmZJwrx65tlWOhylt40no6d1x4AJJH653mcOvaU0=" + }, { "mvn-path": "instaparse/instaparse/1.4.12/instaparse-1.4.12.jar", "mvn-repo": "https://repo.clojars.org/", @@ -806,6 +928,16 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-tFTJn/nVuMaSbzEMvP2pN8PS1j0haZ6nE5dcfoRvAKI=" }, + { + "mvn-path": "it/unimi/dsi/fastutil-core/8.5.8/fastutil-core-8.5.8.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-kzd8lW4A3XphCNE94GeZpWte2pWn47QUGgid/XVUkd4=" + }, + { + "mvn-path": "it/unimi/dsi/fastutil-core/8.5.8/fastutil-core-8.5.8.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-L6jSY7LefSHwf6e6cCp5Ui9Zd50TJJ5VQQDuXFcRD6A=" + }, { "mvn-path": "it/unimi/dsi/fastutil/8.3.0/fastutil-8.3.0.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -901,6 +1033,11 @@ "mvn-repo": "https://repo.clojars.org/", "hash": "sha256-/jSrgs700JyDFCohcxafaOxDfpS4ysyqWKa5g/RelE4=" }, + { + "mvn-path": "medley/medley/1.3.0/medley-1.3.0.pom", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-Mxqk/EXddj1j66qFXJAZxBPMI0qw402OnP+Id0Gbk8E=" + }, { "mvn-path": "medley/medley/1.4.0/medley-1.4.0.jar", "mvn-repo": "https://repo.clojars.org/", @@ -941,6 +1078,16 @@ "mvn-repo": "https://repo.clojars.org/", "hash": "sha256-pOKMydh8sWSV4JAgpctfTqjwZfgCAnR9kb+mRpY+6t8=" }, + { + "mvn-path": "net/cgrand/macrovich/0.2.0/macrovich-0.2.0.jar", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-6gdZEjM/nqP40CWa3Fls6vAJTYyGJ45ImSnD5pl4znU=" + }, + { + "mvn-path": "net/cgrand/macrovich/0.2.0/macrovich-0.2.0.pom", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-eJZwv8mcMp2YLbFQGT48VScindycRHCJw51apOfxtNw=" + }, { "mvn-path": "net/cgrand/macrovich/0.2.1/macrovich-0.2.1.jar", "mvn-repo": "https://repo.clojars.org/", @@ -1471,6 +1618,26 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-d1t6425iggs7htwao5rzfArEuF/0j3/khakionkPRrk=" }, + { + "mvn-path": "org/checkerframework/checker-qual/3.19.0/checker-qual-3.19.0.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-qCfEkYPzpjInfSegpGc2hss0FQdEe51XAmEJS9dIqmg=" + }, + { + "mvn-path": "org/checkerframework/checker-qual/3.19.0/checker-qual-3.19.0.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-KbqcXOGpS3AL2CPE7WEvWCe1kPGaSXdf1+uPmX+Ko3E=" + }, + { + "mvn-path": "org/clj-commons/primitive-math/1.0.0/primitive-math-1.0.0.jar", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-jf43Wpf+4h86ri7BjxNoQVQNzyOUAIzUv6hTA39pXK4=" + }, + { + "mvn-path": "org/clj-commons/primitive-math/1.0.0/primitive-math-1.0.0.pom", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-v10eGdhEPOwecFfDEJu78iLmKYzOq8MPjfz18e7/bzQ=" + }, { "mvn-path": "org/clojure/clojure/1.10.3/clojure-1.10.3.jar", "mvn-repo": "https://repo1.maven.org/maven2/", @@ -1511,6 +1678,16 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-P/01QSpDDIx0FX5fIzu6zESw+qfVcPLeaWAbFvLsalc=" }, + { + "mvn-path": "org/clojure/clojurescript/1.11.51/clojurescript-1.11.51.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-1OawkZ64DYR+PnsHwUhN31EnKv4C5WcUcT/pe1+8Fx4=" + }, + { + "mvn-path": "org/clojure/clojurescript/1.11.51/clojurescript-1.11.51.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-6hMGtK+OR0befcBDNuNqddas3T5A+PluRiTN3WrCSCA=" + }, { "mvn-path": "org/clojure/core.async/1.5.648/core.async-1.5.648.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -1621,6 +1798,16 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-8T2ZaEbW16cCQ2JlqjhjKmdGkgJaQYpWaVxQKBPd2ng=" }, + { + "mvn-path": "org/clojure/data.csv/1.0.0/data.csv-1.0.0.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-khcKPKULbI2QMi3er0YvyzyDzULeyW24XyFzxQJ2UZA=" + }, + { + "mvn-path": "org/clojure/data.csv/1.0.0/data.csv-1.0.0.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-JaOXio9lS2BC7sqK+qxI9NeWEXrdLtEAi9JxtELmKI8=" + }, { "mvn-path": "org/clojure/data.csv/1.0.1/data.csv-1.0.1.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -1631,6 +1818,11 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-1cESYLiumGM6l3FThM8ENeAknrIhTi7VPaTMGMkToAE=" }, + { + "mvn-path": "org/clojure/data.json/1.0.0/data.json-1.0.0.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-FIwv5rXvLug2zwbzgn3z6pQrFDYpP76KbRjXQcdbOKA=" + }, { "mvn-path": "org/clojure/data.json/2.4.0/data.json-2.4.0.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -1671,6 +1863,16 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-r27O5bMSGWJukB2Gja+zp/raf7xHaOrvDnvngPOtstI=" }, + { + "mvn-path": "org/clojure/google-closure-library-third-party/0.0-20211011-0726fdeb/google-closure-library-third-party-0.0-20211011-0726fdeb.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-/FNsq/SBL0h93J70nHuIdoznIm4DoAbBgrpJ6ykgiFo=" + }, + { + "mvn-path": "org/clojure/google-closure-library-third-party/0.0-20211011-0726fdeb/google-closure-library-third-party-0.0-20211011-0726fdeb.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-TJdXE8WPrjKHZxAbUWZsk8k5/8uDLiwQ+xjEUOPGQmA=" + }, { "mvn-path": "org/clojure/google-closure-library-third-party/0.0-20230227-c7c0a541/google-closure-library-third-party-0.0-20230227-c7c0a541.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -1681,6 +1883,16 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-dhVz7jVV7/WzITGoKz7ul+l3tR+XvnR6TKhDwupC8FU=" }, + { + "mvn-path": "org/clojure/google-closure-library/0.0-20211011-0726fdeb/google-closure-library-0.0-20211011-0726fdeb.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-KjPFSw8nqZPRjcBeGXuRRyw8kIIA4NDYISm94QexZOI=" + }, + { + "mvn-path": "org/clojure/google-closure-library/0.0-20211011-0726fdeb/google-closure-library-0.0-20211011-0726fdeb.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-xLwwLiNcKsr4EXURo9sOO50S6mqBKdlauJJ7m6iIYJg=" + }, { "mvn-path": "org/clojure/google-closure-library/0.0-20230227-c7c0a541/google-closure-library-0.0-20230227-c7c0a541.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -1851,6 +2063,16 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-230HS84slEV+bsKwUSg+Typ4oayhZNhPjYFhelVCkZ0=" }, + { + "mvn-path": "org/clojure/tools.logging/1.1.0/tools.logging-1.1.0.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-ZTEN++LnNziP8KllagxxmuNkU1w88dlpOuGjYXf8X3Q=" + }, + { + "mvn-path": "org/clojure/tools.logging/1.1.0/tools.logging-1.1.0.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-C4+IR3G2LL7q02f6F2FxV5oEzIIUG7XTzam+wpPwciQ=" + }, { "mvn-path": "org/clojure/tools.logging/1.2.4/tools.logging-1.2.4.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", @@ -2232,74 +2454,74 @@ "hash": "sha256-g2Bpyp6O48VuSDdiItopEmPxN70/0W2E/dR+/MPyhuI=" }, { - "mvn-path": "org/junit/jupiter/junit-jupiter-api/5.7.1/junit-jupiter-api-5.7.1.pom", + "mvn-path": "org/kohsuke/pom/14/pom-14.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-1Vvisj13FDKXB3IEMgey5mpnJK4CvVGStyFuS3AbxiM=" + "hash": "sha256-FQ9F/ISliYf7KGU9+SntI5krV0Y24HoLPmXsu+LT7oM=" }, { - "mvn-path": "org/junit/jupiter/junit-jupiter-engine/5.7.1/junit-jupiter-engine-5.7.1.pom", + "mvn-path": "org/msgpack/msgpack/0.6.12/msgpack-0.6.12.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-gRF+OjoCDf3W8wkcXseU0stJhAcxrPQogxxWmQEvTLs=" + "hash": "sha256-4JymXYUgSI6ApdxCaEior8z9QPSi6zuWRgQlldO9m14=" }, { - "mvn-path": "org/junit/jupiter/junit-jupiter-params/5.7.1/junit-jupiter-params-5.7.1.pom", + "mvn-path": "org/msgpack/msgpack/0.6.12/msgpack-0.6.12.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-UIPD5bw9OhjVY6M0fVPi3f35ONdh60TbsL9PQgX+6Sw=" + "hash": "sha256-lEl9jwL43oFZpbfVE24BD1f12axliGES7O2GlcUFbe4=" }, { - "mvn-path": "org/junit/jupiter/junit-jupiter/5.7.1/junit-jupiter-5.7.1.pom", + "mvn-path": "org/ow2/asm/asm/9.0/asm-9.0.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-YLUGfK3Mb/tfqS6OJJiKgMbDYEaPJj0mmLKIHI4PfJE=" + "hash": "sha256-Dfl1dJFK7pL9NJ0MtOAPM0XUWywjngu1DwqQ6tR4iOA=" }, { - "mvn-path": "org/junit/platform/junit-platform-commons/1.7.1/junit-platform-commons-1.7.1.pom", + "mvn-path": "org/ow2/asm/asm/9.0/asm-9.0.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-t8GENMTUsn5yO9SKr5ercK7IwMra1MFTkvvdFEykpQo=" + "hash": "sha256-3gNVWQ3Rv8zNyNeQJK6ZKXLoVSaKztua1oLQheA6lK0=" }, { - "mvn-path": "org/junit/platform/junit-platform-engine/1.7.1/junit-platform-engine-1.7.1.pom", + "mvn-path": "org/ow2/asm/asm/9.2/asm-9.2.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-dmAvWZVKo9+mjjHIDKibb7ouoAG0+wbLUfoV6tfIWjA=" + "hash": "sha256-udT+TXGTjfOIOfDspCqqpkz4sxPWeNoDbwyzyhmbR/U=" }, { - "mvn-path": "org/kohsuke/pom/14/pom-14.pom", + "mvn-path": "org/ow2/asm/asm/9.2/asm-9.2.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-FQ9F/ISliYf7KGU9+SntI5krV0Y24HoLPmXsu+LT7oM=" + "hash": "sha256-37EqGyJL8Bvh/WBAIEZviUJBvLZF3M45Xt2M1vilDfQ=" }, { - "mvn-path": "org/msgpack/msgpack/0.6.12/msgpack-0.6.12.jar", + "mvn-path": "org/ow2/ow2/1.5/ow2-1.5.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-4JymXYUgSI6ApdxCaEior8z9QPSi6zuWRgQlldO9m14=" + "hash": "sha256-D4obEW52C4/mOJxRuE5LB6cPwRCC1Pk25FO1g91QtDs=" }, { - "mvn-path": "org/msgpack/msgpack/0.6.12/msgpack-0.6.12.pom", + "mvn-path": "org/roaringbitmap/RoaringBitmap/0.9.0/RoaringBitmap-0.9.0.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-lEl9jwL43oFZpbfVE24BD1f12axliGES7O2GlcUFbe4=" + "hash": "sha256-E2ZU+QMXWmEuMMZ/NvqXVVLtR1VsYbMJkWvSu8d96pQ=" }, { - "mvn-path": "org/ow2/asm/asm/9.2/asm-9.2.jar", + "mvn-path": "org/roaringbitmap/RoaringBitmap/0.9.0/RoaringBitmap-0.9.0.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-udT+TXGTjfOIOfDspCqqpkz4sxPWeNoDbwyzyhmbR/U=" + "hash": "sha256-aJR2e+FkDD7+IKLfoff76nVIav/2h2yaaofbQvpcFXw=" }, { - "mvn-path": "org/ow2/asm/asm/9.2/asm-9.2.pom", + "mvn-path": "org/roaringbitmap/RoaringBitmap/0.9.25/RoaringBitmap-0.9.25.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-37EqGyJL8Bvh/WBAIEZviUJBvLZF3M45Xt2M1vilDfQ=" + "hash": "sha256-c/jiT2NqG6ZQneysu1YFyDPrXq1ts5cXIv/MJUOz45M=" }, { - "mvn-path": "org/ow2/ow2/1.5/ow2-1.5.pom", + "mvn-path": "org/roaringbitmap/RoaringBitmap/0.9.25/RoaringBitmap-0.9.25.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-D4obEW52C4/mOJxRuE5LB6cPwRCC1Pk25FO1g91QtDs=" + "hash": "sha256-z17GLVqzwo+OVHBPgP3ZNDvKr3HC2SGWkBqVqkiFs9Y=" }, { - "mvn-path": "org/roaringbitmap/RoaringBitmap/0.9.25/RoaringBitmap-0.9.25.jar", + "mvn-path": "org/roaringbitmap/shims/0.9.0/shims-0.9.0.jar", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-c/jiT2NqG6ZQneysu1YFyDPrXq1ts5cXIv/MJUOz45M=" + "hash": "sha256-dA9WoUa1ggorP9JrpkYGS7mXBfqYY2jmJf4dTFHoALA=" }, { - "mvn-path": "org/roaringbitmap/RoaringBitmap/0.9.25/RoaringBitmap-0.9.25.pom", + "mvn-path": "org/roaringbitmap/shims/0.9.0/shims-0.9.0.pom", "mvn-repo": "https://repo.maven.apache.org/maven2/", - "hash": "sha256-z17GLVqzwo+OVHBPgP3ZNDvKr3HC2SGWkBqVqkiFs9Y=" + "hash": "sha256-TLeQqxftMV3pY8fX4bzqA9DhKQHD9B5kPquGAzRP/fM=" }, { "mvn-path": "org/roaringbitmap/shims/0.9.25/shims-0.9.25.jar", @@ -2386,6 +2608,36 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-5uGiImN0fokpANH1Aj4dDf6LFtZe/shy8gV3oGl+01c=" }, + { + "mvn-path": "org/xerial/larray/larray-buffer/0.4.1/larray-buffer-0.4.1.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-UqUnKmXPw24p3rfV/UUhlYKaJ1nFg+/cRggXR7CDdY0=" + }, + { + "mvn-path": "org/xerial/larray/larray-buffer/0.4.1/larray-buffer-0.4.1.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-G0OoAJmdB/Y2AVGmJiZv1n9VWI0cW4o9OyvYKL4RSUU=" + }, + { + "mvn-path": "org/xerial/larray/larray-mmap/0.4.1/larray-mmap-0.4.1.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-o8wN71698lc5zqxqpohzV13KBcy8NJ073x/AaSIw1Ls=" + }, + { + "mvn-path": "org/xerial/larray/larray-mmap/0.4.1/larray-mmap-0.4.1.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-OHrgA3P2W31jN3ba2//Lbo4govEqxh1rPpAGSPfuKus=" + }, + { + "mvn-path": "pl/edu/icm/JLargeArrays/1.5/JLargeArrays-1.5.jar", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-bcpasj4f25GQolfARoep6hkRHDa27JR4vOayoSjKGus=" + }, + { + "mvn-path": "pl/edu/icm/JLargeArrays/1.5/JLargeArrays-1.5.pom", + "mvn-repo": "https://repo.maven.apache.org/maven2/", + "hash": "sha256-LWIBDpiLwiRk/6gN5/RBOwhT023cosYAfXvGr967vJ0=" + }, { "mvn-path": "potemkin/potemkin/0.4.5/potemkin-0.4.5.jar", "mvn-repo": "https://repo.clojars.org/", @@ -2456,11 +2708,6 @@ "mvn-repo": "https://repo.clojars.org/", "hash": "sha256-SZCg3bNUDE1Ed6GtqP1mP62RSRScmaYGL7/XSKXwGJo=" }, - { - "mvn-path": "ring/ring-codec/1.1.2/ring-codec-1.1.2.pom", - "mvn-repo": "https://repo.clojars.org/", - "hash": "sha256-sl/LVYL/wFWem+BnzQXP13SAm5IocZz8HqVojsnKH+c=" - }, { "mvn-path": "ring/ring-codec/1.1.3/ring-codec-1.1.3.jar", "mvn-repo": "https://repo.clojars.org/", @@ -2526,6 +2773,16 @@ "mvn-repo": "https://repo.maven.apache.org/maven2/", "hash": "sha256-VX8IP5FuXZWDfFW1oEl06Bwr7uDkAv/Z7H+8/8FXkZ0=" }, + { + "mvn-path": "techascent/tech.resource/5.07/tech.resource-5.07.jar", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-UJfczqA4o28YVaFF2Vj5U9UZwvu8SZXuP4FSlQ1UbCI=" + }, + { + "mvn-path": "techascent/tech.resource/5.07/tech.resource-5.07.pom", + "mvn-repo": "https://repo.clojars.org/", + "hash": "sha256-Qzbpb6UnNqc//IXcBi2CJHzMChNdxCjoYonqaHnxbtM=" + }, { "mvn-path": "thheller/shadow-client/1.3.3/shadow-client-1.3.3.jar", "mvn-repo": "https://repo.clojars.org/", diff --git a/deps.edn b/deps.edn index 9072571..a1e6aae 100644 --- a/deps.edn +++ b/deps.edn @@ -27,6 +27,9 @@ org.clojure/test.check {:mvn/version "1.1.1"}}} :build {:deps {io.github.clojure/tools.build {:git/sha "8e78bccc35116f6b6fc0bf0c125dba8b8db8da6b"}} :ns-default build} + :build-with-sppl {:deps {io.github.clojure/tools.build {:git/sha "8e78bccc35116f6b6fc0bf0c125dba8b8db8da6b"} + io.github.OpenGen/GenSQL.gpm.sppl {:git/sha "718de40878766bb8d08acc2b429a76ed662a1352"}} + :ns-default build} :cljs {:extra-deps {thheller/shadow-cljs {:mvn/version "2.27.5"}}} :clj-test {:extra-deps {io.github.cognitect-labs/test-runner {:git/sha "7284cda41fb9edc0f3bc6b6185cfb7138fc8a023"}} :main-opts ["--main" "cognitect.test-runner"] @@ -41,6 +44,12 @@ criterium/criterium {:mvn/version "0.4.6"}} :jvm-opts ["-Djdk.attach.allowAttachSelf"]} + :query-sppl { :extra-deps { io.github.OpenGen/GenSQL.gpm.sppl {:git/sha "718de40878766bb8d08acc2b429a76ed662a1352"}} + :jvm-opts ["--add-modules" "jdk.incubator.foreign,jdk.incubator.vector" + "--enable-native-access=ALL-UNNAMED"] + :main-opts ["-m" "gensql.query.main"] + } + :coverage ;; Invoke with clj -M:test:coverage {:main-opts ["-m" "cloverage.coverage" diff --git a/flake.lock b/flake.lock index 8e88082..1c74361 100644 --- a/flake.lock +++ b/flake.lock @@ -4,7 +4,29 @@ "inputs": { "devshell": "devshell", "nix-fetcher-data": "nix-fetcher-data", - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714381494, + "narHash": "sha256-zz6GAnDODuB1apPoRE2qLC6J37feHixep3Cdd3fRQsE=", + "owner": "jlesquembre", + "repo": "clj-nix", + "rev": "545e7f55c9cb014123b2b3261385f1561d308402", + "type": "github" + }, + "original": { + "owner": "jlesquembre", + "repo": "clj-nix", + "type": "github" + } + }, + "clj-nix_2": { + "inputs": { + "devshell": "devshell_2", + "nix-fetcher-data": "nix-fetcher-data_2", + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1713172900, @@ -42,6 +64,30 @@ "type": "github" } }, + "devshell_2": { + "inputs": { + "nixpkgs": [ + "opengen", + "gensqlquery", + "clj-nix", + "nixpkgs" + ], + "systems": "systems_2" + }, + "locked": { + "lastModified": 1700815693, + "narHash": "sha256-JtKZEQUzosrCwDsLgm+g6aqbP1aseUl1334OShEAS3s=", + "owner": "numtide", + "repo": "devshell", + "rev": "7ad1c417c87e98e56dcef7ecd0e0a2f2e5669d51", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "flake-part": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -60,6 +106,24 @@ "type": "github" } }, + "flake-part_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_4" + }, + "locked": { + "lastModified": 1685546676, + "narHash": "sha256-XDbjJyAg6odX5Vj0Q22iI/gQuFvEkv9kamsSbQ+npaI=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "6ef2707776c6379bc727faf3f83c0dd60b06e0c6", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib_2" @@ -81,6 +145,41 @@ "inputs": { "nixpkgs-lib": "nixpkgs-lib_3" }, + "locked": { + "lastModified": 1714641030, + "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_5" + }, + "locked": { + "lastModified": 1685546676, + "narHash": "sha256-XDbjJyAg6odX5Vj0Q22iI/gQuFvEkv9kamsSbQ+npaI=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "6ef2707776c6379bc727faf3f83c0dd60b06e0c6", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_6" + }, "locked": { "lastModified": 1712014858, "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", @@ -95,6 +194,27 @@ "type": "github" } }, + "gensqlquery": { + "inputs": { + "clj-nix": "clj-nix_2", + "flake-parts": "flake-parts_4", + "nixpkgs": "nixpkgs_3", + "systems": "systems_3" + }, + "locked": { + "lastModified": 1714492402, + "narHash": "sha256-y/Hi90+fr0RXrnIA1+flhE7qhRT2124BGWQLTKsB/Z0=", + "owner": "OpenGen", + "repo": "GenSQL.query", + "rev": "32adb67ff07c1bba67255384adbe30d80d4e0f9f", + "type": "github" + }, + "original": { + "owner": "OpenGen", + "repo": "GenSQL.query", + "type": "github" + } + }, "nix-fetcher-data": { "inputs": { "flake-part": "flake-part", @@ -118,18 +238,43 @@ "type": "github" } }, + "nix-fetcher-data_2": { + "inputs": { + "flake-part": "flake-part_2", + "flake-parts": "flake-parts_3", + "nixpkgs": [ + "opengen", + "gensqlquery", + "clj-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1685572850, + "narHash": "sha256-lYKEqFG9F84xu51H1rM1u+Ip88cINL0+W26sT+vFEZc=", + "owner": "jlesquembre", + "repo": "nix-fetcher-data", + "rev": "f14967db6c92c79b77419f52c22a698518c91120", + "type": "github" + }, + "original": { + "owner": "jlesquembre", + "repo": "nix-fetcher-data", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1701253981, - "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", + "lastModified": 1714971268, + "narHash": "sha256-IKwMSwHj9+ec660l+I4tki/1NRoeGpyA2GdtdYpAgEw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", + "rev": "27c13997bf450a01219899f5a83bd6ffbfc70d3c", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } @@ -171,6 +316,54 @@ } }, "nixpkgs-lib_3": { + "locked": { + "lastModified": 1714640452, + "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + } + }, + "nixpkgs-lib_4": { + "locked": { + "dir": "lib", + "lastModified": 1682879489, + "narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_5": { + "locked": { + "dir": "lib", + "lastModified": 1682879489, + "narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_6": { "locked": { "dir": "lib", "lastModified": 1711703276, @@ -189,6 +382,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1701253981, + "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1713725259, "narHash": "sha256-9ZR/Rbx5/Z/JZf5ehVNMoz/s5xjpP0a22tL6qNvLt5E=", @@ -204,12 +413,51 @@ "type": "github" } }, + "nixpkgs_4": { + "locked": { + "lastModified": 1714253743, + "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "opengen": { + "inputs": { + "flake-parts": [ + "flake-parts" + ], + "gensqlquery": "gensqlquery", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1715014658, + "narHash": "sha256-+Lr57sudQgTFbTO+RbabMsF07dxxLY7YRhoa6R79H18=", + "owner": "OpenGen", + "repo": "nix", + "rev": "051fd3ead2ac8098e8ff3cf718c7fc6ed40df791", + "type": "github" + }, + "original": { + "owner": "OpenGen", + "repo": "nix", + "type": "github" + } + }, "root": { "inputs": { "clj-nix": "clj-nix", "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_2", - "systems": "systems_2" + "nixpkgs": "nixpkgs", + "opengen": "opengen", + "systems": "systems_4" } }, "systems": { @@ -241,6 +489,36 @@ "repo": "default", "type": "github" } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index bc986ee..7458aca 100644 --- a/flake.nix +++ b/flake.nix @@ -1,14 +1,21 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - systems.url = "github:nix-systems/default"; - clj-nix.url = "github:jlesquembre/clj-nix"; flake-parts = { url = "github:hercules-ci/flake-parts"; }; + opengen = { + url = "github:OpenGen/nix"; + inputs.flake-parts.follows = "flake-parts"; + }; + systems.url = "github:nix-systems/default"; + clj-nix = { + url = "github:jlesquembre/clj-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = inputs@{ flake-parts, systems , ... }: + outputs = inputs@{ flake-parts, systems , opengen, ... }: flake-parts.lib.mkFlake { inherit inputs; } { systems = import systems; @@ -22,10 +29,15 @@ }; depsCache = pkgsWithCljNixOverlay.callPackage ./nix/depsCache {}; - uber = pkgs.callPackage ./nix/uber {inherit depsCache;}; + uber = pkgs.callPackage ./nix/uber {inherit depsCache; buildTool="build";}; + uberGpmSppl = pkgs.callPackage ./nix/uber {inherit depsCache; buildTool="build-with-sppl";}; pname = "gensql"; bin = pkgs.callPackage ./nix/bin { inherit uber pname; }; + binGpmSppl = pkgs.callPackage ./nix/bin/gpm-sppl.nix { + inherit pname opengen; + uber = uberGpmSppl; + }; basicToolsFn = pkgs: with pkgs; [ coreutils @@ -43,7 +55,17 @@ # packages (derived from inputs.nixpkgs automatically by # flake-parts), but ... ociImg = pkgs.callPackage ./nix/oci { - inherit uber pname basicToolsFn depsCache; + inherit uber pname basicToolsFn depsCache opengen; + # ... we still must pass in the original nixpkgs because + # we need access to a different system's set of packages + # when compiling for linux while remaining agnostic of + # the workstation platform we are running this on. + nixpkgs = inputs.nixpkgs; + }; + + ociImgSppl = pkgs.callPackage ./nix/oci/gpm-sppl.nix { + inherit pname opengen basicToolsFn depsCache; + uber = uberGpmSppl; # ... we still must pass in the original nixpkgs because # we need access to a different system's set of packages # when compiling for linux while remaining agnostic of @@ -51,34 +73,42 @@ nixpkgs = inputs.nixpkgs; }; + mutableCacheHook = '' + echo "Setting up default dev shell..." + + DEPS_CACHE_TMP="/tmp/clojure_cache_gensql_query" + echo "Using read-write clojure cache at:" + echo "$DEPS_CACHE_TMP" + + cache_signature_file="/tmp/clojure_cache_gensql_query_signature" + cache_signature="$(echo ${depsCache} | tr -d '\n')" + last_cache_signature="$(cat $cache_signature_file | tr -d '\n')" + + if [[ $cache_signature != $last_cache_signature ]]; then + echo -n $cache_signature > $cache_signature_file + + mkdir -p $DEPS_CACHE_TMP + echo "Copying readonly clojure cache to read-write location" + rsync -LrltgoD --chmod=ug+w ${depsCache}/ $DEPS_CACHE_TMP/ + fi + + export CLJ_CONFIG="$DEPS_CACHE_TMP/.clojure" + export GITLIBS="$DEPS_CACHE_TMP/.gitlibs" + export JAVA_TOOL_OPTIONS="-Duser.home=$DEPS_CACHE_TMP" + ''; + in { # development shell devShells.default = pkgs.mkShell { buildInputs = [ pkgs.openjdk21 pkgs.clojure pkgs.babashka pkgs.nodejs_20 depsCache ] ++ (basicToolsFn pkgs); - shellHook = '' - echo "Setting up default dev shell..." - - DEPS_CACHE_TMP="/tmp/clojure_cache_gensql_query" - echo "Using read-write clojure cache at:" - echo "$DEPS_CACHE_TMP" - - cache_signature_file="/tmp/clojure_cache_gensql_query_signature" - cache_signature="$(echo ${depsCache} | tr -d '\n')" - last_cache_signature="$(cat $cache_signature_file | tr -d '\n')" - - if [[ $cache_signature != $last_cache_signature ]]; then - echo -n $cache_signature > $cache_signature_file + shellHook = mutableCacheHook; + }; - mkdir -p $DEPS_CACHE_TMP - echo "Copying readonly clojure cache to read-write location" - rsync -LrltgoD --chmod=ug+w ${depsCache}/ $DEPS_CACHE_TMP/ - fi + devShells.sppl = pkgs.mkShell { + buildInputs = [ pkgs.openjdk21 pkgs.clojure pkgs.babashka depsCache inputs.opengen.packages.${system}.sppl ] ++ (basicToolsFn pkgs); - export CLJ_CONFIG="$DEPS_CACHE_TMP/.clojure" - export GITLIBS="$DEPS_CACHE_TMP/.gitlibs" - export JAVA_TOOL_OPTIONS="-Duser.home=$DEPS_CACHE_TMP" - ''; + shellHook = mutableCacheHook; }; # development shell with readonly dependencies @@ -106,7 +136,7 @@ }; packages = { - inherit uber bin ociImg; + inherit uber bin ociImg uberGpmSppl ociImgSppl binGpmSppl; default = bin; }; }; diff --git a/nix/bin/default.nix b/nix/bin/default.nix index a88f3a2..22ca475 100644 --- a/nix/bin/default.nix +++ b/nix/bin/default.nix @@ -1,4 +1,5 @@ { pkgs, + system, uber, pname }: pkgs.stdenv.mkDerivation { diff --git a/nix/bin/gpm-sppl.nix b/nix/bin/gpm-sppl.nix new file mode 100644 index 0000000..dcb97d4 --- /dev/null +++ b/nix/bin/gpm-sppl.nix @@ -0,0 +1,20 @@ +{ pkgs, + system, + uber, + opengen, + pname +}: pkgs.stdenv.mkDerivation { + name = "gensql.query"; + inherit pname; + src = ./.; + nativeBuildInputs = [ pkgs.makeWrapper ]; + buildInputs = [ pkgs.openjdk17 ]; + propagatedBuildInputs = with opengen; [ + opengen.packages.${system}.sppl + opengen.packages.${system}.sppl.runtimePython + ]; + installPhase = '' + makeWrapper ${pkgs.openjdk17}/bin/java $out/bin/${pname} \ + --add-flags "-jar ${uber}" + ''; +} diff --git a/nix/oci/default.nix b/nix/oci/default.nix index a1c6f91..79990ca 100644 --- a/nix/oci/default.nix +++ b/nix/oci/default.nix @@ -1,5 +1,6 @@ { pkgs, nixpkgs, + opengen, system, uber, pname, @@ -13,24 +14,15 @@ # TODO: This can be factored out into an gensql/nix # shared package. - baseImg = pkgs.dockerTools.buildLayeredImage { - name = "gensql.base"; - contents = - (basicToolsFn crossPkgsLinux) ++ (with crossPkgsLinux; [ - bashInteractive - ]); - config = { - Cmd = [ "${crossPkgsLinux.bashInteractive}/bin/bash" ]; - }; - }; + baseImg = opengen.packages.${system}.ociImgBase; - ociBin = crossPkgsLinux.callPackage ./../bin {inherit uber pname;}; -in pkgs.dockerTools.buildImage { + ociBin = crossPkgsLinux.callPackage ./../bin {inherit uber pname;}; +in pkgs.dockerTools.buildLayeredImage { name = "probcomp/gensql.query"; tag = systemWithLinux; fromImage = baseImg; # architecture - copyToRoot = [ ociBin depsCache crossPkgsLinux.clojure ]; + contents = [ ociBin depsCache crossPkgsLinux.clojure ]; config = { Cmd = [ "${ociBin}/bin/${pname}" ]; Env = [ diff --git a/nix/oci/gpm-sppl.nix b/nix/oci/gpm-sppl.nix new file mode 100644 index 0000000..300d85f --- /dev/null +++ b/nix/oci/gpm-sppl.nix @@ -0,0 +1,48 @@ +{ pkgs, + nixpkgs, + system, + opengen, + uber, + pname, + basicToolsFn, + depsCache, +}: let + # in OCI context, whatever our host platform we want to build same arch but linux + systemWithLinux = builtins.replaceStrings [ "darwin" ] [ "linux" ] system; + + crossPkgsLinux = nixpkgs.legacyPackages.${systemWithLinux}; + + # TODO: This can be factored out into an gensql/nix + # shared package. + baseImg = opengen.packages.${system}.ociImgBase; + + sppl = opengen.packages.${systemWithLinux}.sppl; + python = opengen.packages.${systemWithLinux}.sppl.runtimePython; + + ociBin = crossPkgsLinux.callPackage ./../bin/gpm-sppl.nix { + inherit + uber + opengen + pname + ; + }; +in pkgs.dockerTools.buildLayeredImage { + name = "probcomp/gensql.query"; + tag = systemWithLinux; + fromImage = baseImg; + # architecture + contents = [ ociBin depsCache crossPkgsLinux.clojure sppl python]; + config = { + Cmd = [ "${ociBin}/bin/${pname}" ]; + Env = [ + "CLJ_CONFIG=${depsCache}/.clojure" + "GITLIBS=${depsCache}/.gitlibs" + "JAVA_TOOL_OPTIONS=-Duser.home=${depsCache}" + "JDK_JAVA_OPTIONS=--add-modules jdk.incubator.foreign,jdk.incubator.vector --enable-native-access=ALL-UNNAMED" + "PYTHONPATH=${python.sitePackages}" + ]; + }; +} + + + diff --git a/nix/uber/default.nix b/nix/uber/default.nix index 8316b8b..416925f 100644 --- a/nix/uber/default.nix +++ b/nix/uber/default.nix @@ -1,6 +1,7 @@ { stdenv, pkgs, depsCache, + buildTool }: stdenv.mkDerivation { name = "gensql.query-uberjar"; version = "unstable"; @@ -19,7 +20,7 @@ nativeBuildInputs = with pkgs; [ clojure git ]; buildPhase = '' cp -R $src . - clojure -T:build uber + clojure -T:${buildTool} uber ''; installPhase = '' cp -R target/*.jar $out