From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Self-contained emacs binary? Date: Thu, 15 Feb 2018 18:37:16 -0800 Message-ID: <771f48d1-c765-7a64-f527-230db5e01935@dancol.org> References: <20180215224653.GA36004@breton.holly.idiocy.org> <96e4b0da-4cc3-859f-7088-e483556be69f@dancol.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1518748660 11666 195.159.176.226 (16 Feb 2018 02:37:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Feb 2018 02:37:40 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 16 03:37:36 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emVtt-00022S-0L for ged-emacs-devel@m.gmane.org; Fri, 16 Feb 2018 03:37:25 +0100 Original-Received: from localhost ([::1]:57807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emVvv-0005XV-18 for ged-emacs-devel@m.gmane.org; Thu, 15 Feb 2018 21:39:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emVtt-0003gV-0O for emacs-devel@gnu.org; Thu, 15 Feb 2018 21:37:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emVts-0005Sw-9l for emacs-devel@gnu.org; Thu, 15 Feb 2018 21:37:25 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:60318) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emVts-0005Sq-2C for emacs-devel@gnu.org; Thu, 15 Feb 2018 21:37:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:References:To:Subject:From; bh=gJgeB2eBVzU5H+Ad9Wmix6gDgsro2av8hlr2rN5L/M0=; b=GdMNHw6qa+BuN2nFFPNwX44qT3cAz5JwIoGa/sGPjaPwM1zektQMdqqSDLf7x0s62VryCTFZry96MVVRmDDzouqw7k23Z/VXnrX5zxOWoHcwoH9SfDLl6+f/NSAF38R578xiS3cFYTJ3TppBUnkmfqhsUbwYC/N/IkF6uJgT57nohpLvkN6FBy4qOTR8JM0mIwOKvAkoGIZXBH7AclS12kaSfUnZ7KFhhffYGCKFQNU29Wc5VyAi/04TVvoadLWvoIsC/fEhX0DhhFqJVdK4uVQxg71uuEnjNJrdZp0tuT/oTqbEjYgQ6+2sz2B6ZWg6rMKiWeCnZ2RSrOgJwLFVyQ==; Original-Received: from [2604:4080:1321:8ab0:4543:45e5:5340:8450] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1emVtr-0003hV-BT; Thu, 15 Feb 2018 18:37:23 -0800 In-Reply-To: <96e4b0da-4cc3-859f-7088-e483556be69f@dancol.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:222800 Archived-At: On 02/15/2018 06:25 PM, Daniel Colascione wrote: > On 02/15/2018 05:54 PM, Stefan Monnier wrote: >>> I do wonder whether it makes sense to try to copy the dump into the >>> Emacs executable itself instead of leaving it as a separate file. >> >> We could try, but: >> - it adds complexity and maybe system-dependent hacks. > > Not if we just tack onto the end. > >> - it closes the opportunity to have several dump files for a single >>    executable (I was thinking we could try and let end-users build their >>    own dump file). > Not necessarily. Suppose we go with the append-to-the-executable option. > Then, to "re-dump" emacs, we'd open the current executable, copy it to a > temporary file, back up to the start of the dump, ftruncate. Now we've > recovered temacs and we can go through normal loadup and dump. > > Maybe we can even automatically detect changes to any file in > load-history and perform this procedure automatically on startup. You know, we could just append a whole zip archive to the executable and load elisp files from this zip archive. (The dump file would be just another file in the archive.) This way, we'd be able to make a self-contained "emacs" binary that wouldn't need special installation. (arc-mode would keep find-library working.) We could even mmap files from the zip archive as long as the files are suitably aligned and STOREd instead of compressed; Android uses this trick to map stuff sitting inside APK files.