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.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 c456a060 for ; Sun, 13 Oct 2019 06:00:00 +0000 (UTC) Received: (qmail 3086 invoked by alias); 13 Oct 2019 05:59:51 -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: 44830 Received: (qmail 10960 invoked by uid 1010); 13 Oct 2019 05:59:51 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f52.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25598. spamassassin: 3.4.2. Clear:RC:0(209.85.167.52):SA:0(-1.9/5.0):. Processed in 1.793595 secs); 13 Oct 2019 05:59:51 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.167.52 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=bChEQbHuLqRybJQkMZJxAF0shGflP5/UDVokBqddK7A=; b=eckCXhlw6/plvBLhSPwDyGYAFO8GHoLNapxyiFlGRM6WRRUveLdybEeBU5UzbYcMRQ Qy/rFvfur2LDkPThn/Yv+//FYqouODMYENlvnQ+j5tLRufjRHhnbUGqY4znN2sfD1TuY e8H23WTaSxgGHE15Y6UQdjxTLU/9jZ/hZNK28YKjJ7zHXrmEl6XnjZ9GmI1GRIMfI+lG v0J1FqlUduEhi3WZejKzsg+r7MjacXAPBeD9RfCofFrQr8sMZiayyL9o0FwAfTsEeVCu YN3R0avMI+NkzBcGt3MgL7pVdxoGFpyZYC+toYkgZf+Oe2ZRTpa9PAHmjXt78eunM8dD n9Iw== X-Gm-Message-State: APjAAAU2S+wdNfLQyOmwf0E+yyP/S9wi5SAKtGLIJeuCdw83liPtbx69 rjTrvTjTLXALXyV8ePnq9hARUt1UUJb+LXCCbe4Tew== X-Google-Smtp-Source: APXvYqx0uJuMkDWAafCW/xcPD7gmCKhMXukGYxl2TvFOuHQVS2ueq3KNlHMnDGG0FAs32pmiHVMhgKmiRWGUY9sWLdM= X-Received: by 2002:a19:6a18:: with SMTP id u24mr13136019lfu.52.1570946354959; Sat, 12 Oct 2019 22:59:14 -0700 (PDT) MIME-Version: 1.0 References: <20191008204722.GU6761@ming.fruitbat.org> <-1Pz0W4MKe73f-nCkejafEE_SNaTME3zWtRpz26zC_wtj9KNc0hpsLeZA60x2YG1GSs5D7RW10p5kfmsy5HRFiXl3oHHx3wt2NHVKUGfX_0=@protonmail.com> In-Reply-To: From: Bart Schaefer Date: Sat, 12 Oct 2019 22:59:03 -0700 Message-ID: Subject: Re: Portable rootless ZSH To: Coden Cc: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Oct 12, 2019 at 5:13 PM Coden 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 a= llows me to imitate "rootless" and I've tested my binary on modern linux di= stros 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 b= ut 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.