Zsh Mailing List Archive
Messages sorted by:
Re: Portable rootless ZSH
- X-seq: zsh-workers 44830
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Coden <codenb@xxxxxxxxxxxxxx>
- Subject: Re: Portable rootless ZSH
- Date: Sat, 12 Oct 2019 22:59:03 -0700
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=bChEQbHuLqRybJQkMZJxAF0shGflP5/UDVokBqddK7A=; b=m09HiU5ywSJqX1UWEFh9B9GNn9Omih8qPUum7kAWDntHledyTI85hEfy4gxTZdUivi SiilT2BH4Z2mVIWg36Dxcx4ta3tKiyk3PuhQZmfhq12rxYg51tPJB2/6rf0KVi0HPN1o UfjkyaaFSjCN9qrWfW4M6sgOPdvjqM6Kp5eyQL2JRfsWLUt6niB8fM8l/Npmzal8Si4Z F9S0ucAe0ZGPpBzD5REQXZ8XYYFQQjZ2yrxWR/ql9KV4DZEtyxX+lpn7A9P8o44Pnrsn tYplY9n2NfLrUaNfmSJohdZ75qFy11yaudLs9scHLXfxkQXGhO0f6at1oQqtoZpP0S/V p7kQ==
- In-reply-to: <USIztrF9t7xJwtAVpl-y33E8NjN0zaQMsW2zaXxzWxaeNxIBxb9ejsYVx0KtTW3RiqY1ZQSQXKmydxyi9tD89JNpyX7VJXG2LSibw3wWrCwfirstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- List-unsubscribe: <mailto:email@example.com>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <X8SiYN2toMZ5PPVZksUCEHWuP_LQiWjl_7pgD9MKXK3U7uS1TRvB1SjBAiZChh_o1t-wZg_wZI-OsnJ_GAKbf_VSFaZ7DrIySgPQbd9kYp0firstname.lastname@example.org> <20191008204722.GU6761@ming.fruitbat.org> <TDwB1Iqe7IWM9v3ll1xTQHtjYH-dEp5OMRUBA341L7O4rccNO-nh6lUSKnXV-6HKFJ4yUlkmfrPeVBqNMxdr6_pIYXR6z40GWl3r3-S_QlMemail@example.com> <-1Pz0W4MKe73f-nCkejafEE_SNaTME3zWtRpz26zC_wtj9KNc0hpsLeZA60x2YG1GSs5D7RW10p5kfmsy5HRFiXl3oHHx3wt2NHVKUGfX_0firstname.lastname@example.org> <FG_5iNx0DPNq-a1zqxGntg3hmpbHyJ_zHKFQZKw-LyXw5ee11rRK_98EM8usgD307Kld2pofl-KsvmWOeMBiQ37j_fwRxcA0oZbNM_6NZ2Uemail@example.com> <q9STAY5-iaqPtJEpUF1qCIiTR8Oc-8p6fuuvMvSuAlI_PE0gRpzNeAzg8bjdaTT6lDm4lIufqeqVSuqVbj0RLszcohztg3kmVBlLykeyPcsfirstname.lastname@example.org> <CAH+w=7adjhaYy1-p4sSC6M_zHo+DtksQ-Zebz-VKThdowZrwBw@mail.gmail.com> <USIztrF9t7xJwtAVpl-y33E8NjN0zaQMsW2zaXxzWxaeNxIBxb9ejsYVx0KtTW3RiqY1ZQSQXKmydxyi9tD89JNpyX7VJXG2LSibw3wWrCwemail@example.com>
On Sat, Oct 12, 2019 at 5:13 PM Coden <codenb@xxxxxxxxxxxxxx> 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
ln -s . run
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
./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.
Messages sorted by: