[code] [textadept] a struggle across 32/64 toolchains

From: Gennadiy Poryev <core.att.barvinok.net>
Date: Sun, 7 Aug 2016 19:45:07 +0300

Dear TextAdept developers!
I'm new to this excellent editor but I've already liked it for the
customization abilities.
However I encountered a problem described below and I need your advice.

The project I'm working on (uses Rust language) requires its source
files to be stored on a Linux build server over CIFS share. I then would
SSH to the server and build/run using Rust's cargo tool. Target platform
is Linux. Everything works if I do that manually, i.e. I've set up SSH
keys for password-less login to the build server, also I'm working in
Windows 10 Anniversary Update which includes WSL (Windows Services for
Linux) so I have native OpenSSH client ready without mingw/cygwin/etc.
But then I tried to bring the build/run command to the TextAdept and
this is where circus started.
It turned out that since my Windows is 64-bit, the WSL is exclusively
64-bit only. 32-bit version of its native CMD shell does not know
anything about WSL, bash, ssh etc. So I can't just write something like

textadept.run.run_commands.rust = 'bash.exe --verbose -c "ssh
root.att. \'cd myproject; cargo run\'"'

Because bash.exe is exclusively 64-bit, and by MS design it cannot be
found from 32-bit cmd.exe.
Apparently TextAdept just calls Lua spawn() function for that; I
suppose, Lua then just starts what's in COMSPEC environment with "/c"
and whatever follows. For Win32 TextAdept on Win64 host this would
obviously be 32-bit cmd.exe hence the first problem.
Second problem happened when I tried to cross the gap by using neat
little trick of starting Win64 cmd.exe from Win32 cmd.exe thus:

textadept.run.run_commands.rust = 'c:\windows\sysnative\cmd.exe /c
bash.exe --verbose -c "ssh root.att. \'cd myproject; cargo run\'"'

Sysnative here refers to Win64, so I thought It would run fine from
local 32-bit cmd.exe shell. But it didn't work for TextAdept, which
would call Lua spawn() which would start 32-bit cmd.exe which would then
start 64-bit cmd.exe which would then try to start 64-bit bash.exe and
all that follows but instead I've got

Error: 0x8007057

in TextAdept message buffer. I guess, all the required options got lost
somewhere in this horrible four-tier nesting.
Hence my attempt to minimize the usage of third-party utilities failed.
It seems I'd have to resort to OpenSSH from MinGW for Win32 for a while.

Having said all that, my questions are:
1. Is it too bold to anticipate Win64 builds of TextAdept? That would
solve all the problems instantly. We're in 2016 after all...
2. Is it possible to override which and how command interpreter is
called in Lua spawn()?

Thanks in advance,

You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sun 07 Aug 2016 - 12:45:07 EDT

This archive was generated by hypermail 2.2.0 : Mon 08 Aug 2016 - 06:52:23 EDT