Compare commits

...

17 commits

Author SHA1 Message Date
Michiel Borkent
8052618fa8
Fix #1818: wrong argument order in clojure.java.io/resource (#1819)
* Fix #1818: wrong argument order in clojure.java.io/resource

* fix
2025-05-13 11:28:44 +02:00
Michiel Borkent
238a98d9b2
Add java.text.BreakIterator (#1817) 2025-05-07 19:58:37 +02:00
Michiel Borkent
57b799e63d Add odoyle-rules to tested libs 2025-05-07 11:06:22 +02:00
Gert Goet
dad646ce38
Make install-script wget-compatible (#1816) 2025-05-04 10:27:03 +02:00
Michiel Borkent
35696b7c0b Bump edamame 2025-05-03 15:35:58 +02:00
Michiel Borkent
00d56900e8
Bump jsoup to 1.20.1 (#1814) 2025-05-02 16:34:03 +02:00
Michiel Borkent
1fc8ef6adb Bump fs 2025-04-30 14:24:49 +02:00
Michiel Borkent
158b36c645 Version bump 2025-04-26 17:27:17 +02:00
Michiel Borkent
b5c65f46e1 changelogs 2025-04-26 17:27:12 +02:00
Michiel Borkent
7e64ce5dd1 export variable 2025-04-26 17:05:55 +02:00
Michiel Borkent
73b806dbd2 v1.12.200 2025-04-26 16:25:47 +02:00
Michiel Borkent
0579d6a0ec disable bulkhead tests 2025-04-26 13:23:02 +02:00
Michiel Borkent
cfee65101f Bump fusefox 2025-04-26 13:03:00 +02:00
Michiel Borkent
4da643cf63 artifact despite failing tests 2025-04-26 12:47:18 +02:00
Michiel Borkent
aa15e5212a disable flaky tests 2025-04-26 12:39:26 +02:00
Michiel Borkent
e23a222fdb
fusebox tests fixed with SCI interop improvements (#1813) 2025-04-26 12:16:36 +02:00
Michiel Borkent
6c0cfde92f Bump process and fs in print-deps 2025-04-21 12:50:20 +02:00
22 changed files with 143 additions and 45 deletions

View file

@ -179,10 +179,13 @@ java -jar \"$jar\" --config .build/bb.edn --deps-root . release-artifact \"$refl
(run "Build binary" (if (= "aarch64" arch)
"script/uberjar\nscript/compile -H:PageSize=64K # --pgo=default.iprof"
"script/uberjar\nscript/compile # --pgo=default.iprof") "30m")
(run "Run tests" "script/test\nscript/run_lib_tests")
(run "Release" ".circleci/script/release")
{:persist_to_workspace {:root "/tmp"
:paths ["release"]}}
(run "Run tests" "script/test\nscript/run_lib_tests")
(run "Release + publish"
(str/join "\n" ["export BABASHKA_RELEASE=true"
".circleci/script/release"]))
{:save_cache
{:paths ["~/.m2" "~/graalvm"]
:key cache-key}}

View file

@ -29,7 +29,9 @@ tar zcvf "$archive" bb # bbk
cd -
./bb --config .build/bb.edn --deps-root . release-artifact "/tmp/release/$archive"
if [ "$BABASHKA_RELEASE" = "true" ]; then
./bb --config .build/bb.edn --deps-root . release-artifact "/tmp/release/$archive"
fi
## cleanup

View file

@ -84,6 +84,11 @@ jobs:
bb --config .build/bb.edn --deps-root . release-artifact %zip%
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: bb.exe
name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-amd64
- name: Test binary and libs
shell: cmd
@ -92,9 +97,3 @@ jobs:
set BABASHKA_TEST_ENV=native
call script/test.bat :windows
call script/run_lib_tests.bat
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: bb.exe
name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-amd64

View file

@ -172,14 +172,6 @@ jobs:
BABASHKA_MUSL: "true"
run: script/compile
- name: Test binary and libs
run: |
script/test
script/run_lib_tests
- name: Release
run: .circleci/script/release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
@ -193,6 +185,14 @@ jobs:
path: bb
name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-static-amd64
- name: Test binary and libs
run: |
script/test
script/run_lib_tests
- name: Release
run: .circleci/script/release
docker:
if: ${{ false }} # Disabled
# if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name == 'push' && github.ref == 'refs/heads/master'"

View file

@ -9,9 +9,27 @@ A preview of the next release can be installed from
## Unreleased
- [#1818](https://github.com/babashka/babashka/issues/1818): wrong argument order in `clojure.java.io/resource` implementation
- Add `java.text.BreakIterator`
- Bump `fs` to `0.5.25`
- Bump `jsoup` to `1.20.1`
- Bump `edamame` to `1.4.30`
- [#1815](https://github.com/babashka/babashka/issues/1815): Make install-script wget-compatible ([@eval](https://github.com/eval))
## 1.12.200 (2025-04-26)
- Improve Java reflection based on provided type hints (read blog post [here](https://blog.michielborkent.nl/babashka-java-reflection-type-hints.html))
- Add compatibility with the [fusebox](https://github.com/potetm/fusebox) library
- Fix virtual `ThreadBuilder` interop
- Add `java.util.concurrent.ThreadLocalRandom`
- Add `java.util.concurrent.locks.ReentrantLock`
- Add classes:
- `java.time.chrono.ChronoLocalDate`
- `java.time.temporal.TemporalUnit`
- `java.time.chrono.ChronoLocalDateTime`
- `java.time.chrono.ChronoZonedDateTime`
- `java.time.chrono.Chronology`
## 1.12.199 (2025-04-18)

View file

@ -232,6 +232,8 @@ Install via the installer script for linux and macOS:
``` shell
$ curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
# or
$ wget -qO install https://raw.githubusercontent.com/babashka/babashka/master/install
$ chmod +x install
$ ./install
```

View file

@ -52,7 +52,7 @@
org.babashka/cli {:mvn/version "0.8.65"}
org.babashka/http-client {:mvn/version "0.4.22"}
org.flatland/ordered {:mvn/version "1.15.12"}
org.jsoup/jsoup {:mvn/version "1.19.1"}}
org.jsoup/jsoup {:mvn/version "1.20.1"}}
:aliases {:babashka/dev
{:main-opts ["-m" "babashka.main"]}
:profile
@ -174,7 +174,11 @@
prismatic/plumbing {:git/url "https://github.com/plumatic/plumbing",
:git/sha "424bc704f2db422de34269c139a5494314b3a43b"}
org.clj-commons/hickory {:git/url "https://github.com/clj-commons/hickory"
:git/sha "9385b6708ef35f161732d8464b3a3aa57dd79f30"}}
:git/sha "9385b6708ef35f161732d8464b3a3aa57dd79f30"}
com.potetm/fusebox {:git/url "https://github.com/potetm/fusebox"
:git/sha "ac6d6a0a69510b009b3c1bb2247cd110fd9f7246"}
net.sekao/odoyle-rules {:git/url "https://github.com/oakes/odoyle-rules"
:git/sha "0b1d825ec45a998c4d3481dfb292e08ce6a47f0b"}}
:classpath-overrides {org.clojure/clojure nil
org.clojure/spec.alpha nil}}
:clj-nvd

2
fs

@ -1 +1 @@
Subproject commit 64b1c198576fe7babea5500ce6c7cfe6cc92f37b
Subproject commit fdd5780bc4df4931332b56082c6c3a5c3c85066d

36
install
View file

@ -29,6 +29,32 @@ print_help() {
exit 1
}
has() {
command -v "$1" >/dev/null 2>&1
}
fetch() {
local url=$1
local outfile=${2:-}
if has wget; then
if [[ -n $outfile ]]; then
wget -qO "$outfile" "$url"
else
wget -qO - "$url"
fi
elif has curl; then
if [[ -n $outfile ]]; then
curl -fsSL "$url" -o "$outfile"
else
curl -fsSL "$url"
fi
else
>&2 echo "Either 'wget' or 'curl' needs to be on PATH!"
exit 1
fi
}
while [[ $# -gt 0 ]]
do
key="$1"
@ -80,9 +106,9 @@ fi
if [[ "$version" == "" ]]; then
if [[ "$dev_build" == "true" ]]; then
version="$(curl -sL https://raw.githubusercontent.com/babashka/babashka/master/resources/BABASHKA_VERSION)"
version="$(fetch https://raw.githubusercontent.com/babashka/babashka/master/resources/BABASHKA_VERSION)"
else
version="$(curl -sL https://raw.githubusercontent.com/babashka/babashka/master/resources/BABASHKA_RELEASED_VERSION)"
version="$(fetch https://raw.githubusercontent.com/babashka/babashka/master/resources/BABASHKA_RELEASED_VERSION)"
fi
fi
@ -144,9 +170,9 @@ download_url="https://github.com/babashka/$repo/releases/download/v$version/$fil
# macOS only have shasum available by default
# Some Linux distros (RHEL-like) only have sha256sum available by default (others have both)
if command -v sha256sum >/dev/null; then
if has sha256sum; then
sha256sum_cmd="sha256sum"
elif command -v shasum >/dev/null; then
elif has shasum; then
sha256sum_cmd="shasum -a 256"
else
>&2 echo "Either 'sha256sum' or 'shasum' needs to be on PATH for '--checksum' flag!"
@ -159,7 +185,7 @@ mkdir -p "$download_dir" && (
cd "$download_dir"
echo -e "Downloading $download_url to $download_dir"
curl -o "$filename" -sL "$download_url"
fetch "$download_url" "$filename"
if [[ -n "$checksum" ]]; then
if ! echo "$checksum *$filename" | $sha256sum_cmd --check --status; then
>&2 echo "Failed checksum on $filename"

View file

@ -22,11 +22,11 @@
:flaky :flaky}
:jvm-opts ["--enable-preview"]
:dependencies [[org.clojure/clojure "1.12.0"]
[borkdude/edamame "1.4.29"]
[borkdude/edamame "1.4.30"]
[org.clojure/tools.cli "1.0.214"]
[cheshire "6.0.0"]
[nrepl/bencode "1.2.0"]
[borkdude/sci.impl.reflector "0.0.3"]
[borkdude/sci.impl.reflector "0.0.4"]
[org.babashka/sci.impl.types "0.0.2"]
[org.babashka/babashka.impl.java "0.1.10"]
[org.clojure/core.async "1.8.741"]
@ -36,7 +36,7 @@
[insn/insn "0.5.2"]
[org.babashka/cli "0.8.65"]
[org.babashka/http-client "0.4.22"]
[org.jsoup/jsoup "1.19.1"]
[org.jsoup/jsoup "1.20.1"]
[borkdude/graal.locking "0.0.2"]]
:plugins [[org.kipz/lein-meta-bom "0.1.1"]]
:metabom {:jar-name "metabom.jar"}

View file

@ -1 +1 @@
1.12.199
1.12.200

View file

@ -1 +1 @@
1.12.200-SNAPSHOT
1.12.201-SNAPSHOT

View file

@ -52,7 +52,7 @@
org.babashka/cli {:mvn/version "0.8.65"}
org.babashka/http-client {:mvn/version "0.4.22"}
org.flatland/ordered {:mvn/version "1.15.12"}
org.jsoup/jsoup {:mvn/version "1.19.1"}}
org.jsoup/jsoup {:mvn/version "1.20.1"}}
:aliases {:babashka/dev
{:main-opts ["-m" "babashka.main"]}
:profile
@ -174,7 +174,11 @@
prismatic/plumbing {:git/url "https://github.com/plumatic/plumbing",
:git/sha "424bc704f2db422de34269c139a5494314b3a43b"}
org.clj-commons/hickory {:git/url "https://github.com/clj-commons/hickory"
:git/sha "9385b6708ef35f161732d8464b3a3aa57dd79f30"}}
:git/sha "9385b6708ef35f161732d8464b3a3aa57dd79f30"}
com.potetm/fusebox {:git/url "https://github.com/potetm/fusebox"
:git/sha "ac6d6a0a69510b009b3c1bb2247cd110fd9f7246"}
net.sekao/odoyle-rules {:git/url "https://github.com/oakes/odoyle-rules"
:git/sha "0b1d825ec45a998c4d3481dfb292e08ce6a47f0b"}}
:classpath-overrides {org.clojure/clojure nil
org.clojure/spec.alpha nil}}
:clj-nvd

2
sci

@ -1 +1 @@
Subproject commit bb544b70ecdf3574bb7600f9203b08041e9d50d0
Subproject commit e85433a0214114fdceb4ca896e1b9c27b1bdf713

View file

@ -435,6 +435,7 @@
java.text.ParsePosition
;; adds about 200kb, same functionality provided by java.time:
java.text.SimpleDateFormat
java.text.BreakIterator
~@(when features/java-time?
`[java.time.format.DateTimeFormatter
java.time.Clock
@ -476,7 +477,12 @@
java.time.temporal.TemporalAccessor
java.time.temporal.TemporalAdjuster
java.time.temporal.TemporalQuery
~(symbol "[Ljava.time.temporal.TemporalQuery;")])
~(symbol "[Ljava.time.temporal.TemporalQuery;")
java.time.chrono.ChronoLocalDate
java.time.temporal.TemporalUnit
java.time.chrono.ChronoLocalDateTime
java.time.chrono.ChronoZonedDateTime
java.time.chrono.Chronology])
java.util.concurrent.atomic.AtomicInteger
java.util.concurrent.atomic.AtomicLong
java.util.concurrent.atomic.AtomicReference
@ -819,6 +825,8 @@
(and thread-builder
(instance? thread-builder v))
thread-builder
(instance? java.text.BreakIterator v)
java.text.BreakIterator
;; keep commas for merge friendliness
,)]
;; (prn :res res)

View file

@ -84,8 +84,8 @@
cp)))
(defn resource
(^URL [path] (resource @the-url-loader path))
(^URL [loader path]
(^URL [path] (resource path @the-url-loader))
(^URL [path loader]
(if (str/starts-with? path "/") nil ;; non-relative paths always return nil
(getResource loader [path] true))))

View file

@ -14,11 +14,11 @@
edn/read-string)
deps (:deps deps)
deps (assoc deps
'babashka/fs {:mvn/version "0.5.22"}
'babashka/fs {:mvn/version "0.5.25"}
'babashka/babashka.curl {:mvn/version "0.1.2"}
'babashka/babashka.core {:git/url "https://github.com/babashka/babashka.core"
:git/sha "52a6037bd4b632bffffb04394fb4efd0cdab6b1e"}
'babashka/process {:mvn/version "0.5.22"})
'babashka/process {:mvn/version "0.6.23"})
deps (dissoc deps
'borkdude/sci
'org.babashka/sci

View file

@ -1190,7 +1190,7 @@ Use bb run --help to show this help output.
(println "[babashka] WARNING: config file does not exist:" config))
nil))
jar (let [jar (resolve-symbolic-link jar)]
(some-> [jar] cp/new-loader (cp/resource "META-INF/bb.edn") .toString))
(some->> [jar] cp/new-loader (cp/resource "META-INF/bb.edn") .toString))
:else (if (and file (fs/exists? file))
;; file relative to bb.edn
(let [file (abs-path file) ;; follow symlink

View file

@ -75,8 +75,6 @@
(doseq [p test-paths]
(add-classpath (str (fs/file git-dir p)))))
(when-not (and skip-windows (windows?))
(prn :branch (current-branch))
(prn (System/getenv))
(if (and flaky (#{"main" "master"} (current-branch)))
(println "Skipping" tns "for main branch because it's marked flaky")
(swap! test-nss into tns))))

View file

@ -201,4 +201,20 @@
hickory.test.render
hickory.test.select
hickory.test.zip]}
cheshire/cheshire {:git-url "https://github.com/dakrone/cheshire", :test-namespaces [cheshire.test.core], :manually-added true}}
cheshire/cheshire {:git-url "https://github.com/dakrone/cheshire", :test-namespaces [cheshire.test.core], :manually-added true}
com.potetm/fusebox {:git-url "https://github.com/potetm/fusebox"
:git-sha "ac6d6a0a69510b009b3c1bb2247cd110fd9f7246"
:test-paths ["test"]
:test-namespaces [#_com.potetm.fusebox.bulkhead-test
com.potetm.fusebox.bulwark-test
com.potetm.fusebox.circuit-breaker-test
com.potetm.fusebox.fallback-test
com.potetm.fusebox.memoize-test
#_com.potetm.fusebox.rate-limit-test
com.potetm.fusebox.registry-test
com.potetm.fusebox.retry-test
#_com.potetm.fusebox.timeout-test]}
net.sekao/odoyle-rules {:git-url "https://github.com/oakes/odoyle-rules"
:git-sha "0b1d825ec45a998c4d3481dfb292e08ce6a47f0b"
:test-paths ["test"]
:test-namespaces [odoyle.rules-test]}}

View file

@ -341,7 +341,7 @@
(is (= ::response r))))
(try (get "https://httpbin.org/gzip" {:timeout 1000})
(catch java.net.http.HttpTimeoutException _
(catch Exception _
(doseq [v (vals (ns-publics *ns*))]
(when (:integration (meta v))
(println "Removing test from" v "because httpbin is slow.")

View file

@ -245,6 +245,24 @@
(deftest cached-thread-pool
(is (= 3 (bb nil "(import '(java.util.concurrent Executors ExecutorService))
(let [fut (.submit ^ExecutorService (Executors/newCachedThreadPool)
^Callable (fn [] 3))]
(.get fut))"))))
(let [fut (.submit ^ExecutorService (Executors/newCachedThreadPool) ^Callable (fn [] 3))]
(.get fut))")))
(is (nil? (bb nil "(import '(java.util.concurrent Executors ExecutorService))
(let [fut (.submit ^ExecutorService (Executors/newCachedThreadPool) ^Runnable (fn [] 3))]
(.get fut))"))))
(deftest break-iterator-test
(is (= 1 (bb nil "(ns dude
(:import [java.text BreakIterator]))
(defn count-characters
[^String text]
(let [it (BreakIterator/getCharacterInstance)]
(.setText it text)
(loop [count 0]
(if (= (.next it) BreakIterator/DONE)
count
(recur (inc count))))))
(prn
(count-characters \"🇨🇦\"))"))))