if anyone feels adventurous, i need some real world use ...
"works on my computer", but how about yours ?
I tried to get away with light parsing, but i'm ready to go deeper if necessary
There is a pre-compiled release too https://github.com/cark/clojure-win-cli-wrap/releases
@carkh got nim installed and compiled with some success -- simple tests such as clj.exe -Spath and clj.exe -r seem to work
hmm...actually, i had the unofficial clj windows installed -- it worked with that, but when i uninstalled that and installed the official clj on windows, the wrapper appears to hang
ah, may be it was the installation location -- i reinstalled the official clj on windows with a different choice, and now am having more luck
oh
thanks for trying
actually i discovered that by calling the cmdlet directly, and if you have the exe in the path, it would call the exe rather than the cmdlet
we have a good fortune though, the clojure and clj commands are only aliases to Invoke-Clojure
long story short, this hanging bug is fixed and pushed
the strange thing is that that bug was not apparent with the exe in the same directory, only when it is in the path
why woudl powershell give precedence to path commands over cmdlets is anybody's guess
pulled and rebuilt -- seems to be working
@sogaiu thanks !
from a command prompt, I get this:
>powershell "clj -Sdeps '{:deps {nrepl {:mvn/version """0.6.0"""}}}' -m nrepl.cmdline"
Error while parsing option "--config-data {:deps {nrepl {:mvn/version 0.6.0}}}": java.lang.NumberFormatException: Invalid number: 0.6.0
what's the right quote parsing magic to get this to work from command prompt?
attempt 2:
>powershell clj -Sdeps "{:deps {nrepl {:mvn/version ^"0.6.0^"}}}" -m nrepl.cmdline
Unknown option: "-i"
Unknown option: "-n"
Unknown option: "-p"
Unknown option: "-u"
Unknown option: "-t"
Unknown option: "-F"
Unknown option: "-o"
Unknown option: "-r"
Unknown option: "-m"
Unknown option: "-a"
Unknown option: "-t"
Unknown option: "-o"
Unknown option: "-u"
Unknown option: "-t"
Unknown option: "-p"
Unknown option: "-u"
Unknown option: "-t"
Unknown option: "-F"
Unknown option: "-o"
Unknown option: "-r"
Unknown option: "-m"
Unknown option: "-a"
Unknown option: "-t"
some light reading: https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
you could : the official way is start from powershell itself, tripple double quotes your version numbers... the unofficial way : start from cmd, use https://github.com/frericksm/clj-windows
starting from cmd and invoking clojure in powershell is hard
I think the simple answer is: don't do that -- use Powershell instead of cmd.
that's if you can... I'll never give up on this =)
@seancorfield have a look at this wrapper i'm exploring
nice neat command lines just like on linux
I'm not interested and you know that. I'm going to use the official clj
and I'm going to use PS when I'm on Windows.
I want to help Clojure/core make the official PS client better -- and that's what this channel is for.
but you're advertising it as the only way, it isn't and makes several uses impossible
anyways that exploratory project makes use of the ps tools
I'm not "advertising" it. I'm using the official client and discussing issues in the "official" channel for that official client.
so am i
Coming in here and telling people to use a different, unofficial tool is not appropriate for this channel.
that's why i'm trying to make it work with the official tool
sometimes you're on windows, and have to use cmd
there is no way around it
i would gladly dump it in favor of ps if it was possible at all
anyways too bad, i really was looking forward to your feedback as a knowledgable cli user
When you say "that exploratory project", which one are you referring to? That frericks project is not a wrapper for the official tooling.
i posted it this morning
just calls powershell with a twist
I didn't see that (and I was not responding to that).
light parsing/rebuilding of the command line, makes use of the poweshell tools, encodes the command line to base64 and makes use of powershell's encodedcommand feature to avoid further escaping issues
probably not good enough but a first step
I also want to make a proper installer, but only if there is any traction
then dump it all on cognitect =)
Interesting approach. I know @alexmiller has pushed back on bringing other languages into the mix, as far as officially supported tools are concerned, but that isn't very much code and as you note could be written in any language -- with the target being a small, self-contained .exe
.
yes i don't care about language, i'm just not comfortable enough to go with c
I wonder whether it could be written in Clojure and a Graalvm binary produced? Maybe @borkdude might have some thoughts, given his work on clj-kondo?
reading though the graalvm channel, it looks like there are still issues with dll missing
So not totally self-contained
i also wrote the tables comparing different solutions as requested by Alex Miller, but wasn't comfortable showing that yet, but he's been busy and couldn't have a look at it yet, so here it goes: https://github.com/cark/clojure-windows-cli-issues
yes, Windows is the platform I can't really target succesfully with graalvm yet...
in theory it should work, but there are some issues
https://github.com/oracle/graal/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+clojure+windows
also this one: https://github.com/oracle/graal/issues/1407
@borkdude how does the command line work with graalvm executables ? can you pass it a naked command line to be parsed by your main ? That is can it be used as a clj replacement ?
or is it more like a java command line
you just write a (defn -main [& args])
and you receive the arguments as strings
no access to the full command line then ?
i mean unparsed
I'm not not sure what you mean
see how you receive a seq of args as your main parameters ? that means there is at least some parsing to separate the args
in the exploratory wrapper i posted, i sidestep that by just parsing the full command line myself, in order to avoid some of those pesky escaping issues
@carkh I have a script\compile.bat
in clj-kondo, so if you're using Windows, just clone the repo and try it out I'd say
i might just do that =)
@carkh Here's the full instructions for Windows: https://github.com/borkdude/clj-kondo/blob/master/doc/build.md#windows
thanks
this is a bit simpler CLI built with GraalVM: https://github.com/borkdude/jet but I don't have a Windows build script for that yet. should be easy to port from clj-kondo
It's good to have some people look at this who are really using Windows and know it more than I do
i'm merely a user
Windows support for GraalVM is probably a bit early days. I'm hoping it will catch on in a few months
yes looks like it
@carkh you’ve clearly put some real effort in here! 👍
bit shy about showing it though =)
feedback is usually friendly and constructive from this community so I don’t think you have too much to worry about