From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id bd8aed1e for ; Sun, 13 Oct 2019 23:52:18 +0000 (UTC) Received: (qmail 16707 invoked by alias); 13 Oct 2019 23:52:11 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44833 Received: (qmail 777 invoked by uid 1010); 13 Oct 2019 23:52:11 -0000 X-Qmail-Scanner-Diagnostics: from mail-40133.protonmail.ch by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25601. spamassassin: 3.4.2. Clear:RC:0(185.70.40.133):SA:0(-2.7/5.0):. Processed in 2.318189 secs); 13 Oct 2019 23:52:11 -0000 X-Envelope-From: codenb@protonmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.protonmail.ch designates 185.70.40.133 as permitted sender) Date: Sun, 13 Oct 2019 23:51:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1571010692; bh=TmlB9JIuX9WXJHZjLrIrzT+D41wikYiGd0tm63w80UY=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=n8Lxe/2BFXzSyBPRW7IhmDBdoYxvMj9vWFgJkGCBlVem8qKKDWxRKkrVqP/Z/YjOG IRtnTKbGiatjre3Y4UtoqFbbM6JU5/QIZtPDsAxVBK62Xsc2aQpILHxXiul9zoG2W3 bNse8kVcWwDKUO7vOiWEbTqoxJyjc+yL+yD3vIBo= To: Bart Schaefer From: Coden Cc: "zsh-workers@zsh.org" Reply-To: Coden Subject: Re: Portable rootless ZSH Message-ID: <4XeMR-DaD1iuP2o6WRImZHS7lhiCE95A9Aq9OXj7DJPBwz6XC_6Lpxvw5m1VFfqgEDYSlRjPU01kXfBpHbv58VaUtsfUiD1788YZhpmBdOc=@protonmail.com> In-Reply-To: References: <20191008204722.GU6761@ming.fruitbat.org> <-1Pz0W4MKe73f-nCkejafEE_SNaTME3zWtRpz26zC_wtj9KNc0hpsLeZA60x2YG1GSs5D7RW10p5kfmsy5HRFiXl3oHHx3wt2NHVKUGfX_0=@protonmail.com> Feedback-ID: 1g_EZM5cadEHcIg82x2qZXWXT-U_XXBlI7kN837NwaZpram7G2oom_E1e2DIYhFQFmC50rpRJhWFHjVSm_Y7-w==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you for details! I'll try again. =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Sunday, October 13, 2019 8:59 AM, Bart Schaefer 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 workarou= nd allows me to imitate "rootless" and I've tested my binary on modern linu= x 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 t= hat 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 buildi= ng 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=3D$PWD/run --bindir=3D$PWD/run > --enable-etcdir=3D./run/etc --enable-scriptdir=3D./run/scripts > --enable-fndir=3D./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.