Re: [code] Unable to run Textadept on Docker container

From: Emil Axelsson <78emil.att.gmail.com>
Date: Wed, 10 May 2017 22:58:59 +0200

Den 2017-05-10 kl. 22:18, skrev Mitchell:
> Hi Emil,
>
> On Wed, 10 May 2017, Emil Axelsson wrote:
>
>> Den 2017-05-10 kl. 15:28, skrev Mitchell:
>>> Hi Emil,
>>>
>>> On Wed, 10 May 2017, Emil Axelsson wrote:
>>>
>>>> Den 2017-05-10 kl. 04:10, skrev Mitchell:
>>>>> Hi Emil,
>>>>>
>>>>> On Tue, 9 May 2017, Emil Axelsson wrote:
>>>>>
>>>>>> [Trying again without +help in the address.]
>>>>>>
>>>>>> Hi!
>>>>>>
>>>>>> I'd like to use Textadept on an Ubuntu Docker container, but it
>>>>>> doesn't work.
>>>>>>
>>>>>> I start with a clean container:
>>>>>>
>>>>>> sudo docker run -it --rm ubuntu
>>>>>>
>>>>>> Inside the container I run the following commands:
>>>>>>
>>>>>> apt-get update
>>>>>> apt-get install -y wget
>>>>>> wget
>>>>>> https://foicica.com/textadept/download/textadept_LATEST.x86_64.tgz
>>>>>> tar zxvf textadept_LATEST.x86_64.tgz
>>>>>>
>>>>>> Then when I try to run `textadept_9.4.x86_64/textadept-curses`, I get
>>>>>> a blank terminal. If I press enter I get this message:
>>>>>>
>>>>>> [Message Buffer] - Textadept ([Message Buffer])attempt to index a nil
>>>>>> value
>>>>>> /textadept_9.4.x86_64/themes/term.lua:76: attempt to index a nil
>>>>>> value
>>>>>> (field 'run')
>>>>>>
>>>>>> But it's working to some extent: I can move around and type in the
>>>>>> message buffer.
>>>>>>
>>>>>> Any idea what went wrong?
>>>>>
>>>>> Textadept uses `/proc/self/exe` to determine its location and thus the
>>>>> location of its `modules/` directory, which contains the
>>>>> `textadept.run`
>>>>> module among others.
>>>>>
>>>>> I would venture a guess that docker does not supply a similar
>>>>> mechanism,
>>>>> so Textadept has no idea where it is. I did not account for this, so
>>>>> there is no workaround. Sorry :(
>>>>
>>>> Hm.. It seems that `/proc/self/exe` is working fine. Here is what I
>>>> get from inside the container:
>>>>
>>>> # ls -l proc/self/exe
>>>> lrwxrwxrwx 1 root root 0 May 10 07:36 proc/self/exe -> /bin/ls
>>>>
>>>> Any other ideas?
>>>
>>> In your ~/.textadept/init.lua add:
>>>
>>> local f = io.open('/tmp/foo', 'w')
>>> f:write(_HOME)
>>> f:close()
>>>
>>> The contents of /tmp/foo should be the directory of textadept-curses,
>>> and that directory should also contain Textadept's core files and
>>> folders (including "modules/").
>>
>> Just so I'm not misunderstanding, are you saying /tmp/foo should be a
>> text file with one line giving the path to the unpacked Textadept
>> tarball? Or that /tmp/foo should be that directory?
>
> /tmp/foo should be a text file whose contents are Textadept's "home"
> directory.

OK, yeah, that didn't work.

>> I'm afraid neither option helps though -- same result.
>
> Hmm, so Textadept has no idea where it is. The application attempts to
> read from "/proc/self/exe" (note the leading '/'). Perhaps that is
> causing the problem. I noticed in your "ls" example, you read from
> "proc/self/exe".

Sorry, that was a confusing example. I ran `ls -l proc/self/exe` from
the root directory, so I omitted the leading /.

> Cheers,
> Mitchell

-- 
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 Wed 10 May 2017 - 16:58:59 EDT

This archive was generated by hypermail 2.2.0 : Thu 11 May 2017 - 06:42:22 EDT