Commit graph

442 commits

Author SHA1 Message Date
Michiel Borkent
b9308eddcc
Fix #1456: allow dyn vars to be set in socket REPL (#1461) 2023-01-04 21:23:29 +01:00
Michiel Borkent
3aca505790
Partial fix for #1456 (nREPL issue) (#1460)
Co-authored-by: axks <alexander.kaiser@blockinfinity.com>
2023-01-04 20:46:04 +01:00
Matthew Downey
62916fa292
Fix #1451: Allow passing explicit file and line number to clojure.test 2022-12-20 19:41:36 +01:00
Michiel Borkent
69db7105e5
Support new syntax in babashka.deps/clojure (#1440) 2022-12-07 10:04:40 +01:00
Michiel Borkent
bd857ae3e1 Partially revert, will revisit 2022-12-05 17:46:43 +01:00
Michiel Borkent
43375d49a2 Allow deps/clojure to be called with new syntax 2022-12-05 15:14:52 +01:00
ikappaki
6e00354053
Fix 1430: empty tasks names display list (#1431)
Co-authored-by: ikappaki <ikappaki@users.noreply.github.com>
2022-11-28 10:51:39 +01:00
Michiel Borkent
99f1e948d3 Fix pREPL tests 2022-11-19 11:50:14 +01:00
Michiel Borkent
40e0087b59 Fix socket repl tests 2022-11-19 11:21:23 +01:00
Michiel Borkent
b458d79b29 Switch to use ctx-store for global context 2022-11-19 11:00:35 +01:00
Michiel Borkent
9ed3cb6a31 Fix #1414: preserve metadata on exec task function argument map 2022-11-11 17:34:44 +01:00
Michiel Borkent
ac1b16bfc8 SCI: preserve more stacktrace, e.g. on throw 2022-11-10 21:04:01 +01:00
Michiel Borkent
bca3f28e28
Graalvm 22.3.0 (#1408) 2022-10-25 22:56:57 +02:00
Michiel Borkent
351723fdb6 Fix #1384: allow .indexOf on LazySeq 2022-10-18 17:32:22 +02:00
Michiel Borkent
b6f19b03dc Fix #1397: clojure.lang.Namespace 2022-10-18 17:27:17 +02:00
Baishampayan Ghose
77768cec67
feat: Honor *print-namespace-maps* in pprint (#1387)
We can now use the dynamic var `*print-namespace-maps*` to control how
maps with namespaced keys are printed using `pprint`.

Fixes: #1381
2022-10-04 19:11:59 +02:00
Michiel Borkent
020d42a94f Fix #808: -Sdeps 2022-09-24 13:25:06 +02:00
Bob
78cbdd1d82
#1336: --force as global opt (#1374) 2022-09-24 10:59:34 +02:00
Michiel Borkent
42ebb92c5d exec tests 2022-09-23 21:26:37 +02:00
Michiel Borkent
7b563dd802 exec-test [skip ci] 2022-09-23 21:18:52 +02:00
Michiel Borkent
3110dde2ab Fix #1368: -x: do not pick up on aliases in user ns 2022-09-22 20:05:22 +02:00
Michiel Borkent
3b5dbb7c66 Fix #1367: line number in clojure.test output 2022-09-22 14:03:48 +02:00
Michiel Borkent
2f146bd712 Fix #1364: Be tolerant of unknown tags in bb.edn 2022-09-18 12:29:16 +02:00
Eero Helenius
4926aaf85f
Add and expose babashka.classes/all-classes (#1362)
* Add and expose babashka.classes/all-classes

* Add test for babashka.classes/all-classes
2022-09-13 10:54:30 +02:00
Michiel Borkent
267646fbe7 Fix gc test 2022-09-09 18:13:40 +02:00
Crispin Wellington
ea4f56886d
Expose a subset of java.lang.ref to enable hooking into the destruction/GC of objects (#1359)
* reify java.lang.Object with optional toString and finalize

* reify java.lang.Runnable

* reflection support for java.lang.Runnable

* java.lang.ref.* class exposure

* test for detection of garbage collection of Object

* added change to changelog
2022-09-09 17:25:32 +02:00
Michiel Borkent
cd54d2a911
Improve reify error messages (#1352)
Co-authored-by: Crispin Wellington <retrogradeorbit@gmail.com>
2022-09-06 10:24:15 +02:00
Michiel Borkent
18e19934d1 Fix #1350: map clojure.lang.Var to sci.lang.Var 2022-09-05 20:59:37 +02:00
Michiel Borkent
9ed705f8db Pod namespaces come before namespaces from source 2022-06-20 12:14:48 +02:00
Michiel Borkent
4bfe0eec89 Convey print-length to pprint and allow set! 2022-04-16 11:37:14 +02:00
Michiel Borkent
d8db9eee63
fix #1231: missing methods in reify should fall back to default interface methods (#1240) 2022-04-14 18:14:31 +02:00
Bob
3d0befb52b
update some SciVar names (metadata-wise) to align with babashka name (#1236)
* update SciVar names to align with the symbols in the namespace maps

* make test using a bb script more consistent with others

* update changelog
2022-04-07 14:02:06 +02:00
Stel Abrego
d2278835f1
Fix #1041: Improve error message when regex literal in EDN config (#1230)
* Improve error message when regex literal in EDN config (#1041)

Regex literal syntax (example: #"^foo") is not allowed in EDN. With the
ability to write tasks in the config file, users may mistakenly try to
include regex literals. This patch improves the error message by
informing the user that literal regex syntax is not allowed and
recommends using re-pattern instead.

* Update changelog

* Fixup main.clj

* Fixup changelog
2022-04-05 11:03:39 +02:00
Michiel Borkent
f09e085c75 Move bb.edn in uberjar to META-INF 2022-04-03 13:36:00 +02:00
Michiel Borkent
e81ef4aac0
Declarative pod support for uberscript (#1227) 2022-04-02 23:41:04 +02:00
Michiel Borkent
7af93adf15 Fix test 2022-04-02 17:47:27 +02:00
Michiel Borkent
ea4c4eae77 windows fix 2022-04-02 17:09:34 +02:00
Wes Morgan
963bd7957a
Feature: declarative pods support in uberjars (#1217)
* Store bb.edn in uberjar & load when run from there

* Sync resources deps.edn w/ root

* Throw error if --config arg doesn't exist

...instead of silently falling back on ./bb.edn

* Fix jar file arg parsing

Moving all arg parsing up above bb.edn ingestion made tasks turn into files to load. But this is a chicken-and-egg problem w/ uberjars b/c the bb.edn is inside the jar file, so we need that first. So I extracted the file parsing out into its own fn and put the full arg parsing back where it was after ingesting bb.edn.

* Fix local pod key in error message

* Ensure resources dir exists when copying bb.edn into it

* Copy bb.edn to temp dir when building uberjar

..and add that dir to the classpath for the jar

* Only put :pods in uberjar bb.edn

* Small readability fix

* Add ret val type hints for classpath/resource

Got a reflection warning on one of my calls

* Add a test for uberjars with bb.edn-declared pods

* Only run uberjar-with-pods-test on amd64 for now
2022-04-02 16:51:08 +02:00
Michiel Borkent
4d24cdca2a
Proxy support for PipedInputStream and PipedOutputStream
* Spire requires proxy support for java.io.PipedInputStream and java.io.PipedOutputStream

* proxy support for java.io.PipedInputStream and java.io.PipedOutputStream

* proxy tests for PipedInputStream and PipedOutputStream

Co-authored-by: Crispin Wellington <retrogradeorbit@gmail.com>
2022-03-31 10:00:16 +02:00
Michiel Borkent
1ad93077c1 fix #1216: fix core.async alts example with polyfill 2022-03-23 23:49:09 +01:00
Wes Morgan
e602286799
feat #863: Load pods from bb.edn (#1205)
Co-authored-by: Michiel Borkent <michielborkent@gmail.com>
2022-03-23 17:08:59 +01:00
mknoszlig
f9451f5de0
feat #1204: add babashka.config property 2022-03-11 11:03:42 +01:00
Michiel Borkent
3f49ad3b89
fix #1199: print-method impls on records (#1200) 2022-03-05 17:11:11 +01:00
Michiel Borkent
61e47555f9 feat #1187: Add :result key to (current-task) map that can be used in :leave task hook 2022-02-27 12:10:33 +01:00
Michiel Borkent
141881376d
fix #1190: task dependencies resolve as core.async channels (#1191) 2022-02-27 11:49:40 +01:00
Michiel Borkent
83c610ca0f fix #1180: limit bb tasks output to first line of docstring 2022-02-24 12:28:54 +01:00
Michiel Borkent
19e87a545d
fix #1181: clojure.test report does not respect *test-out* correctly (#1182) 2022-02-18 22:54:10 +01:00
Michiel Borkent
b461925981
SCI: use mutable arrays for bindings (#1177) 2022-02-14 11:52:32 +01:00
Roger Lam
9969b83341
Ensure leading zeros are not trimmed for algorithm "SHA-256", so that hash string size is always 64. (#1176) 2022-02-12 11:06:49 +01:00
Michael Glaesemann
ca59f3890e
fix #1143: allow optional (ignored) -- when using using --main (#1147)
Permits previously-accepted behavior broken in 19415f6363
2022-01-20 14:53:54 +01:00
Michiel Borkent
da31e9c61c
fix #1144: cannot create multidimensional arrays (#1145) 2022-01-16 12:42:10 +01:00
Michiel Borkent
061bc528ae this test wasn't supposed to be in master! 2022-01-05 20:21:19 +01:00
Michiel Borkent
d050e7d58d deps.clj: update to clojure CLI 1.10.3.1058 2022-01-05 20:11:23 +01:00
Michiel Borkent
34f9997df4 [#1123, #1124] Do not require java for bb tasks without deps 2021-12-30 16:32:15 +01:00
Michiel Borkent
ddf03c50ae [#1116] Missing error message when exception happens in REPL print 2021-12-29 16:10:30 +01:00
Michiel Borkent
1912b921df Fixes for issue reported by @thiagokokada 2021-12-27 21:31:13 +01:00
Michiel Borkent
fb7f984389
[#1110] Load tasks and deps from other bb.edn file (#1117)
Co-authored-by: Bob <highpressurecarsalesman@gmail.com>
2021-12-26 17:26:35 +01:00
Michiel Borkent
93fb4379ff
[#584, #1037] Uberscript in bb (#1115) 2021-12-23 21:23:11 +01:00
Michiel Borkent
86c67af49c
[#1105] Include native elements in printed stacktrace (#1113) 2021-12-22 13:04:29 +01:00
Michiel Borkent
73d466e7d6
Fix SCI#649 aget reflection (#1100)
Fix issue with aget reported in babashka/sci#649 by @MrEbbinghaus
2021-12-09 22:38:38 +01:00
Michiel Borkent
2079f0a554 Add print-deps test 2021-11-29 23:42:36 +01:00
Michiel Borkent
4566905a5c
Add compatibility with hato and clj-http-lite insecure feature (#1080)
Added classes:

- java.net.CookiePolicy
- java.net.http.HttpTimeoutException
- javax.net.ssl.HostnameVerifier
- javax.net.ssl.HttpsURLConnection
- javax.net.ssl.KeyManagerFactory
- javax.net.ssl.SSLSession
- javax.net.ssl.TrustManagerFactory
- java.security.KeyStore
- java.util.zip.Inflater
- java.util.zip.ZipException
2021-11-27 15:58:24 +01:00
Michiel Borkent
e419c569a8
Support satisfies? on protocol values (#1076) 2021-11-24 17:38:38 +01:00
Michiel Borkent
a95c51998f
limit space of InetAddress4/6 2021-11-23 11:34:30 +01:00
Michael Glaesemann
5940b95cd2
Add javax.crypto classes necessary for calculating hmac shas. (#1066)
* Add javax.crypto classes necessary for calculating hmac shas.

* Add hmac-256-sha test for javax.crypto.
2021-11-18 08:49:59 +01:00
Michiel Borkent
948c38c035 Add support for BasicFileAttributes 2021-11-13 11:05:21 +01:00
Michiel Borkent
321c47297d [#1061] Calling close on DirectoryStream fails 2021-11-13 10:38:21 +01:00
Michiel Borkent
2bb7499fd5 [#1055] Segfault when reifying FileVisitor with visitFileFailed 2021-11-07 12:05:16 +01:00
Michiel Borkent
19415f6363 Fix remaining args when invoking -m 2021-11-02 13:46:51 +01:00
Michiel Borkent
11379deca1
[#999] Support Object.toString override on defrecords (#1050) 2021-11-02 10:29:52 +01:00
Bob
5a80e1603e
- correct --init to be a global option (#1036)
- test --init before subcommands and task names
2021-10-18 15:39:08 +02:00
Bob
bf3b6d2dca
add support for --init as a file to be loaded before evaluation actions (#1033) 2021-10-17 10:44:31 +02:00
Michiel Borkent
ce6d4aaf34 Fix test 2021-10-08 14:43:57 +02:00
Bob
d4ac7365e0
[#1015] print locals only when debug option is enabled (#1021) 2021-09-29 09:24:51 +02:00
Bob
7df81f1273
make core.async and rewrite-clj integral (#1014)
* make core.async integral (not a feature)

tasks (in particular, parallel tasks) require core.async

* make rewrite_clj integral (not a feature)

* cleanup mistakes
2021-09-23 18:15:01 +02:00
Bob
407bd74a00
[#1004] XML edn reading and populating *data-readers* for feature deps (#1012)
* add XML edn reading and make *data-readers* closer to Clojure

- initial value of *data-readers*: empty map
- add XML readers to feature-flagged edn-readers for parsing *input*
- add edn-readers to *data-readers* to emulate data_readers.clj handling

* add YAML round-trip testing

* set root val of *data-readers* at top level
2021-09-20 18:31:57 +02:00
Michiel Borkent
0f723a1e7c
Fix aarch64 test (#1007) 2021-09-11 18:13:12 +02:00
Michiel Borkent
a43e75ffd6
Add PipedInput/OutputStream (#1001) 2021-09-07 11:30:52 +02:00
Michiel Borkent
e915e14612 Upgrade deps.clj, fix flaky test 2021-09-01 17:34:19 +02:00
Michiel Borkent
c832819a76 Fix test 2021-09-01 13:45:23 +02:00
Michiel Borkent
cddd4ce581 [#995] Add clojure.data.xml/alias-uri 2021-09-01 13:34:47 +02:00
Michiel Borkent
23ba52a813
[#979] More java net http tests and tweaks (#996) 2021-09-01 11:36:24 +02:00
Michael Glaesemann
125e227976
Java http insecure context (#994)
* Add support for creating insecure context.

* Add BABASHKA_FEATURE_JAVA_NET_HTTP flag.

* Clean up java.net.http tests
2021-08-31 17:37:11 +02:00
Michiel Borkent
b71278cc68
[#979] JDK 11 Http Client
Co-authored-by: Michael Glaesemann <grzm@seespotcode.net>
2021-08-31 11:13:11 +02:00
Michiel Borkent
cebdd19c00
Upgrade to GraalVM 21.2.0 2021-08-30 20:16:18 +02:00
Bob
242c3d442f
Logging feature flag and tools.logging.readable (#981) (#987)
* put tools.logging behind a feature flag

* add tools.logging.readable

- move logging namespace to feature folder
- add logging.readable namespace
- add tests for logging.readable

* cleanup logging changes

- add logging env var to compile script
- remove unconditional require of logging namespace

* move old-config capture to before alter

* remove feature check from logging tests
2021-08-29 23:43:53 +02:00
Bob
4ee84947c9
use tagged-literal for unknown EDN tags when creating *input* (#975) (#976)
* use tagged-literal as default for unknown tags when using -I (or --stream without -i)

* use tagged-literal as default for unknown tags
2021-08-25 17:57:17 +02:00
Bob
a85d593767
make the REPL requires available to command-line scripts (#972) 2021-08-22 23:20:41 +02:00
Michiel Borkent
d4f5e57866 [#959] Add *print-readably* and *flush-on-newline* 2021-08-16 22:57:59 +02:00
Bob
bb57d220d0
test that var metadata matches containing ns (#967)
* - change namespace on 'quick-check' to match clojure version
- add test for var meta->namespace alignment

* - add ns to with-transaction macro
2021-08-08 21:23:58 +02:00
Bob
116d73f0b0
- add :ns meta to more vars (#966)
- add a couple more tests for Coercions
2021-08-08 15:38:56 +02:00
Bob
ffd66d514a
add META-INF resource to windows compilation (to mirror linux compilation) (fixes #963) (#964) 2021-08-04 14:20:59 +02:00
Michiel Borkent
bda2017d0d Skip print-deps-test on Windows for now 2021-08-03 10:36:56 +02:00
Michiel Borkent
be29d791a8 [#733] print-deps tests 2021-08-02 23:34:38 +02:00
Michiel Borkent
3f72507f77
[#957] Repair ns meta 2021-07-31 14:44:26 +02:00
Michiel Borkent
f5125a6f37 nREPL server: get rid of SCI internals 2021-07-27 13:46:53 +02:00
Michiel Borkent
8387109166 Fix flaky test on Windows 2021-07-23 11:51:39 +02:00
Michiel Borkent
294cfe403c Fix flaky bb-edn test 2021-07-23 11:15:03 +02:00
Bob
2863dce99c
add windows-specific clojure test (#950) 2021-07-22 12:34:07 +02:00
Michiel Borkent
7b76eaf956 Disable task test for Windows 2021-07-15 13:16:38 +02:00