From 9545d23cc4be39322296f94b8e5a7f3b5da611d8 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Thu, 9 Mar 2023 22:51:42 +0100 Subject: [PATCH] Enable unix protocol on Windows (#1516) --- appveyor.yml | 4 ++-- .../native-image/babashka/babashka/native-image.properties | 2 +- test-resources/domain_sockets.bb | 5 +++-- test/babashka/interop_test.clj | 3 +-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ff8a0464..fe3ec5a9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,7 +2,7 @@ version: "v-{build}" -image: Visual Studio 2017 +image: Visual Studio 2019 clone_folder: C:\projects\babashka @@ -55,7 +55,7 @@ build_script: # see https://github.com/quarkusio/quarkus/pull/7663 - cmd: >- - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" call script/uberjar.bat diff --git a/resources/META-INF/native-image/babashka/babashka/native-image.properties b/resources/META-INF/native-image/babashka/babashka/native-image.properties index 2e6e0571..7fd2654c 100644 --- a/resources/META-INF/native-image/babashka/babashka/native-image.properties +++ b/resources/META-INF/native-image/babashka/babashka/native-image.properties @@ -7,7 +7,7 @@ Args=-H:+ReportExceptionStackTraces \ -H:IncludeResources=src/babashka/.* \ -H:IncludeResources=SCI_VERSION \ -H:Log=registerResource:3 \ - -H:EnableURLProtocols=http,https,jar \ + -H:EnableURLProtocols=http,https,jar,unix \ --enable-all-security-services \ -H:+JNI \ --no-server \ diff --git a/test-resources/domain_sockets.bb b/test-resources/domain_sockets.bb index 1d64cd89..2d57eac5 100644 --- a/test-resources/domain_sockets.bb +++ b/test-resources/domain_sockets.bb @@ -2,10 +2,11 @@ java.net.StandardProtocolFamily [java.nio.channels ServerSocketChannel SocketChannel]) -(require '[clojure.java.io :as io]) +(require '[clojure.java.io :as io] + '[babashka.fs]) (def sockaddr (UnixDomainSocketAddress/of - (-> (doto (io/file "/tmp/sock") + (-> (doto (fs/file (fs/temp-dir) "server.socket") (.deleteOnExit)) str))) diff --git a/test/babashka/interop_test.clj b/test/babashka/interop_test.clj index 340a9242..a8e34824 100644 --- a/test/babashka/interop_test.clj +++ b/test/babashka/interop_test.clj @@ -21,5 +21,4 @@ [(.isVirtual t) (.isVirtual vt)])))))) (deftest domain-sockets-test - (when-not test-utils/windows? - (is (= :success (bb nil (slurp "test-resources/domain_sockets.bb")))))) + (is (= :success (bb nil (slurp "test-resources/domain_sockets.bb")))))