Now with cross compilation of the windows installer : https://github.com/cark/clojure-cli-portable
@sogaiu i took your input and used NSIS for this one, so you can see the files being copied !
Now to put the whole thing in docker so the preparation steps to make these compilations is automated
@carkh so it looks like the scripts need to be run from the project root -- cd to script first is a no-no, i guess 🙂 i tried script/build_all, but at the mingw32 stuff, i see:
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: unrecognized option '-z'
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
Error: execution of an external program failed: '/usr/bin/x86_64-w64-mingw32-gcc -o /home/user/Desktop/src/clojure-cli-portable/clojure.exe /home/user/.cache/nim/clojure_r/stdlib_assertions.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_dollars.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_widestrs.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_io.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_system.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_parseutils.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_math.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_unicode.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_strutils.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_dynlib.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_winlean.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_pathnorm.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_times.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_os.nim.c.o /home/user/.cache/nim/clojure_r/parseArgs.nim.c.o /home/user/.cache/nim/clojure_r/compat_windows.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_streams.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_osproc.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_strformat.nim.c.o /home/user/.cache/nim/clojure_r/stdlib_md5.nim.c.o /home/user/.cache/nim/clojure_r/clojure.nim.c.o -s -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
!!!!!!!!!!!!! ERROR : COMPILE ERROR !!!!!!!!!!!!!
!!!!!!!!!!!!! ERROR : WINDOWS BUILD !!!!!!!!!!!!!
you need to install mingw i think
i have it
let me try from trhe script directory
ah indeed
i did cd back to the project directory before running the command, fwiw
may be my mingw32 installation is not quite correct
probably, i just installed as is and it worked for me
you're on ubuntu ?
no, i'm on an arch derivative called manjaro
linux is not my thing, i somehow managed to do this, but that's the extent of my knowledge there
np
check https://nim-lang.org/docs/nimc.html#cross-compilation the for windows part
anyways that's immaterial, i'll make a docker file and that at least should work everywhere
the goal is to make as easy as possible
thanks for the hints -- i'll investigate
(fixed the execution of scripts from script directory)
thanks -- did a windows compile on windows, have transferred the output to a linux environment and am about to try the nsis script
the installer .exe was built successfully -- transferred it to a windows 10 pro machine and ran it. saw the license agreement, tested the details button to see the performed steps. tested clojure.exe -r on a couple of projects successfully. uninstalling worked too via the uninstallation exe. looks pretty good 🙂
a few things i noticed: 1) the details in the install / uninstall dialog do not appear to be selectable all-at-once -- that is, i only seem to be able to select one line at a time. i guess that's not a big deal unless you want to copy some / all of the output. 2) i tried running an alias w/ clj and i think i'm hitting a problem with an overly long command line -- do you know how one works around this sort of thing?
oh, i think they advise to move your local maven repository
to a shorter path
but that's a shaky workaround
I seem to remember they're working on maybe using "classpath jars"
that's another workaround, but this one may be a definitive solution
my own solution is : don't use so many libraries !
we're starting to look like the npm ecosystem =)
@sogaiu thanks for your continued testing
thanks for the hints and your continued efforts on this project 🙂
1) i don't know how to make the file output any different, I'll look into it at some point
i'll add a script windows side to build the installer
@sogaiu right click in the detail window, a menu appears with "copy details to clipboard"
@carkh ah great! just tried it successfully 🙂
nice !
@carkh once we are at java 9+, may be we can use the following to work around command line length limitations: https://docs.oracle.com/javase/9/tools/java.htm#JSWOR-GUID-4856361B-8BFD-4964-AE84-121F5F6CF111
mhh, i wonder how many are below java 9 still
perhaps the clojure survey can give some hints on this
wow majority is on java 8
yes, like 70%, right?
err, i guess you can answer multiple versions?
i don't know !
if we are referring to q16 -- it must be unless addition has changed 🙂
https://clojure.atlassian.net/browse/TDEPS-120 they're on it
thanks for digging that up
i think it's possible to do something about it without even involving alex miller
i'll experiment with it tomorrow
looking forward to what you find out 🙂
do you have an example project ?
@carkh in this project: https://github.com/sogaiu/adorn -- invoking clj -A:native-image leads to problems on windows
setting that one up may be quite a bit of work though
thanks i'll try it here
i mentioned this before, but fwiw, here's a summary of what i needed to do for doing native-image building on windows: https://gist.github.com/sogaiu/e079cd770051685c46ab24b6658effcf
yes i've got this in my notes
hum, so this exposes the classpath command line too long issue right ?
i get an error involving processbuilder which i believe has to do with the length limitation, but i am not sure
allright thanks
@carkh here is the detailed message i get for clj -A:native-image: https://pastebin.com/XvsBfknx -- if it seems it is not the length issue, please disregard the case so you don't waste your time on it
allright, maybe i can make a dummy project with a big bag of libs
https://github.com/cark/clojure-cli-portable Now with automated building of a docker image with all the necessary tools to do cross-compilation, and the scripts to make it happen.
and a pretty windows installer
FWIW, I wrote that TDEPS-120 patch, but it's implemented via the ps1
side of the current Windows tools.deps stuff, so the same logic would need to be replicated inside of @carkh's nim launcher code in order to work
Er, well there's a Clojure-side tools.deps patch that would need to be merged, then the other patch is to the .ps1 file to have it use that argument.
@timgilbert i haven't yet fully investigated this, but wouldn't it be possible to leave tools.deps work as usual and only build the jar (on windows only) depending on the size of the cp file ?
from the external tool i mean
ps1 or otherwise
It would be possible, but the Clojure-side patch in the tdeps-120 ticket has it generating the pathing jar on the clojure side and then keeping it around as part of the classpath cache
Alternately you could manage that on the nim / <thing that calls tools.deps> side of things, but it made more sense to me to keep it inside of tools.deps
But yeah, you could manage it externally too
mhh i think i disagree on that, that's platform specific, and the keeping around is done by the external tool anyways
The way I came to think of it is that the function of tools.deps is basically to calculate and cache classpaths, and this is essentially just a different serialization format for classpaths along with the *.cp
files
yes there is something to be said about that
though we both have facilities to create zip files
to me the caching decisions are outside tools.Deps
it's just filling the data for the decision we took outside it
we're doing the hashing, we decide to call it
anyways i'll run with it later today and see how it goes
Cool