zsh-workers
 help / color / mirror / code / Atom feed
From: Coden <codenb@protonmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Portable rootless ZSH
Date: Sun, 13 Oct 2019 23:51:25 +0000	[thread overview]
Message-ID: <4XeMR-DaD1iuP2o6WRImZHS7lhiCE95A9Aq9OXj7DJPBwz6XC_6Lpxvw5m1VFfqgEDYSlRjPU01kXfBpHbv58VaUtsfUiD1788YZhpmBdOc=@protonmail.com> (raw)
In-Reply-To: <CAH+w=7Ynb1vL99y3tULgB8cXE_Le=1Tiwx5EReW5-RARXQprMQ@mail.gmail.com>

Thank you for details! I'll try again.


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, October 13, 2019 8:59 AM, Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Sat, Oct 12, 2019 at 5:13 PM Coden codenb@protonmail.com wrote:
>
> > I don't understand one thing. I want to build rootless binary.
> >
> > -   When I wrote that there is a way to build the binary on old version of packages I mean that library version checking raises the error only if the current packages version is older than used when compile. This workaround allows me to imitate "rootless" and I've tested my binary on modern linux distros versions and it works.
>
> "Your mileage may vary" but typically if you want a fully portable
> binary you need to static link everything. Otherwise you're
> eventually going to run into some kind of dynamic linkage problem,
> even it it seems currently to work to compile with an older shared
> object and then run with a newer one.
>
> > -   But when you wrote about prefix-like flags I think you understand that prefix-like flags requres absolute path from root like /usr/share. It's not rootless behaviour. Yes we can change prefixes for lib paths on building but we can't make it relative. I'm wrong?
>
> Only a couple of them require an absolute path, and ultimately that
> only matters to "make install" (it changes $module_path but all of
> your modules are static). Some variation of this seems to work:
>
> ./configure --disable-dynamic --prefix=$PWD/run --bindir=$PWD/run
> --enable-etcdir=./run/etc --enable-scriptdir=./run/scripts
> --enable-fndir=./run/functions --enable-function-subdirs
> --disable-site-fndir
> (edit config.modules)
> make
> make install
> cd run
> ln -s . run
> mkdir etc
> cd ..
>
> Now you can move the "run" directory anywhere, even rename it provided
> it contains the symlink "run" pointing to itself, and when you cd into
> it and then execute "./zsh", everything works. There is one other
> step needed: After moving/copying/whatever the "run" directory to its
> final location, you have to create a zshenv file in that "etc" subdir
> and assign fpath. You could also assign module_path for completeness,
> but as noted nothing will ever use it. To assign the fpath you can
> just do:
>
> ./zsh -fc 'typeset -p fpath' | sed "s,./run,$PWD,g" > etc/zshenv
>
> and now you're all set.
>
> > What step in your way gives us relativity?
>
> The problem with your scheme is that anything loaded at run time --
> such as the completion functions -- HAS to be loaded by absolute path,
> in order for the shell to ever be able to change directory. That's
> why normally one would instead create a zsh package that was intended
> always to be installed in a predetermined fixed location, and use the
> configure options to set the default paths to that fixed place. This
> is the procedure my previous message was describing.



  reply	other threads:[~2019-10-13 23:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08 18:44 Coden
2019-10-08 20:47 ` Peter A. Castro
2019-10-09 20:07   ` Coden
2019-10-11 11:54     ` Coden
2019-10-11 19:32       ` Coden
2019-10-12 21:22         ` Coden
2019-10-12 23:22           ` Bart Schaefer
2019-10-13  0:13             ` Coden
2019-10-13  5:59               ` Bart Schaefer
2019-10-13 23:51                 ` Coden [this message]
2020-03-07 13:03                   ` Coden
2019-10-11 13:11     ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='4XeMR-DaD1iuP2o6WRImZHS7lhiCE95A9Aq9OXj7DJPBwz6XC_6Lpxvw5m1VFfqgEDYSlRjPU01kXfBpHbv58VaUtsfUiD1788YZhpmBdOc=@protonmail.com' \
    --to=codenb@protonmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).