leiningen icon indicating copy to clipboard operation
leiningen copied to clipboard

lein.bat trampoline is constrained by command-line string limitation

Open yuanmai opened this issue 12 years ago • 12 comments

I got "The input line is too long." on windows.

See: http://support.microsoft.com/kb/830473

yuanmai avatar Feb 05 '13 06:02 yuanmai

What was the line you were trying to use? Windows XP? Looks like this should occur only on older systems.

kumarshantanu avatar Feb 05 '13 07:02 kumarshantanu

It's XP, in my case. On the page, it says it APPLIES TO Microsoft Windows Server 2003, Datacenter Edition (32-bit x86) Microsoft Windows Server 2003, Enterprise Edition (32-bit x86) Microsoft Windows Server 2003, Standard Edition (32-bit x86) Microsoft Windows Server 2003, Web Edition Microsoft Windows XP Home Edition Microsoft Windows XP Professional Microsoft Windows 2000 Advanced Server Microsoft Windows 2000 Professional Edition Microsoft Windows 2000 Server Microsoft Windows NT Server 4.0 Standard Edition Microsoft Windows NT Workstation 4.0 Developer Edition

yuanmai avatar Feb 05 '13 08:02 yuanmai

What was the line that caused "The input line is too long"? The sample may help others think how to break it down into smaller chunks.

kumarshantanu avatar Feb 05 '13 08:02 kumarshantanu

It happened right after copying resource files using lein-resource plugin. Here is the project file: https://gist.github.com/yuanmai/4713058

yuanmai avatar Feb 05 '13 08:02 yuanmai

I'm not sure how far we should go when it comes to backward compatibility. In addition, someone's working on a PowerShell implementation of the bat file, which will likely fix this issue.

hypirion avatar Feb 05 '13 13:02 hypirion

The trampoline handling in lein.bat was rewritten, so this is probably fixed. If it's still an issue we can reopen it.

technomancy avatar Mar 26 '13 00:03 technomancy

This is still an issue on windows, because with 'call' the part that is longer then 8191 chars will silently get dropped instead of an 'input line is too long'.

With some manual hackery, trampolining with Powershell seems to be a solution. I am not sure about backwards compatibillity, but Leiningen already has a dependency on Powershell for installation, so is it ok to convert it?

ekroon avatar Jan 10 '14 13:01 ekroon

Does https://github.com/technomancy/grenchman work with trampoline on Windows?

kumarshantanu avatar Jan 10 '14 13:01 kumarshantanu

@ekroon: IIRC @technomancy has said that converting the lein.bat to Powershell is a goal, so feel free to work on an implementation if that's what you asked. :)

hypirion avatar Jan 10 '14 13:01 hypirion

@kumarshantanu I am not completely sure about the Grenchman hint, but there isn't a binary for Windows available.

@hyPiRion that is my question indeed :smile:

ekroon avatar Jan 10 '14 13:01 ekroon

Grenchman uses libraries that haven't been ported to Windows.

Porting to Powershell would be fine; happy to take a patch for that.

technomancy avatar Jan 10 '14 17:01 technomancy

Just noting I'm almost positive that this issue appeared for me with figwheel like this and this.

I think this because I can see a file lein-trampoline-33.bat was left in my tmp dir and the dependency which I'm failing to resolve occurs at position ~8192 in the command line. So it appears that lein figwheel does not work on Windows once you reach a certain number of dependencies.

I'm almost entirely unfamiliar with leiningen but perhaps this could be worked around by creating one directory in %TEMP% and filling it with symlinks to each .jar file then passing that directory as -cp. I might experiment with this though I'm a bit short on time at the moment.

alexnixon avatar Apr 30 '18 20:04 alexnixon