From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Native-compilation build process (was Re: Loading tramp for dump goes into infinite regress) Date: Wed, 3 Aug 2022 10:53:12 -0400 Message-ID: References: <8735erhrlg.fsf@gmx.de> <83wnc2g0n8.fsf@gnu.org> <83sfmqfxcb.fsf@gnu.org> <83a68yfp6j.fsf@gnu.org> <83fsid5xg6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9868"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andrea Corallo , Michael Albinus , emacs-devel , Stefan Monnier To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 03 16:54:51 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJFlo-0002Ra-Ti for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Aug 2022 16:54:49 +0200 Original-Received: from localhost ([::1]:47992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJFlm-0007e7-Uk for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Aug 2022 10:54:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJFkZ-0006Ma-Jk for emacs-devel@gnu.org; Wed, 03 Aug 2022 10:53:31 -0400 Original-Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:41925) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJFkX-0004OZ-QQ; Wed, 03 Aug 2022 10:53:31 -0400 Original-Received: by mail-pj1-x1034.google.com with SMTP id t2-20020a17090a4e4200b001f21572f3a4so2391012pjl.0; Wed, 03 Aug 2022 07:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Rj+wo/sbVeN+dhjJKhr8FSl7zS81r269woEEKn7lzKY=; b=BYHS94J8sadbSVQggo1PG191aCZiilm5CoVJqL0f43s+9X/vWCwZpYI14jf/0iFeiw 2GN5SsFMgI+3bbBOn7lCgjPrfq0aixToscIqMiD9kB7835y+ZajEzT1f7k4PKdIldqpx aTHBxbETGCyEec3FizBu1dGRf06I/cgr6AhWAtlYuz2P/K2aUw6WY4ZjCB6CWH+q7bWe CAib1/TqhkgpnSKUrXoJn7iSTzk8MAEE2CUfqR7vPOnTSWTJNzHPhciOAi5PqFzxq88E OWz880rcHeNWcVmawNy9pcNG9PoSnDHzmsIDK8+gfD8pZtkoY3jEkBFnBZ+8ybhD6+VU ReCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rj+wo/sbVeN+dhjJKhr8FSl7zS81r269woEEKn7lzKY=; b=xNXtkZ+JK1cLpKyFqba5ol6vQ6QrPpUVtJ7seDDLQJ1bs/Y4ygvkzEObJLzU6dWTUE CgfKZIBbMRI+6cvpD6S3ne6wKmykC8gFEMhUaJavoOTdafohagag5HXciHJenSKOtNQ7 DFSmCzezP+J5o6Xe7dxwKieEBsHvdHzQsjHRbnjPbPSJLjdxRO1eYON7PJIu5364JgPM a8LLPm6zrD3l180/m49qwU6y/znX4jqzF5YSiJLyReKFCFC/C3EgpRzEfcCVHihgxLEc vIJv+CF+3hNbwV1+Wan+jkvfOM12xMx7yUrYmdDJ0tYYTLOw0jN/JE4zR2OKZ22IC/L0 iI6w== X-Gm-Message-State: ACgBeo3VRPnAd9emI3hgE10qJ1SxTN92xQFOmb9D7/XkVUnxtEfXn3Z/ XOWqqLJRn0wpcLDUbF/Tnq9opXwPulwYThBIyJG+mxIc X-Google-Smtp-Source: AA6agR4bpLqMkPWxoNZ7KKEeadluvq2CSy0Tt586ocCazCOLfyN1Sm4nv9QO9sEaFetUJmFlDZ4FUnkX6wWQmxYjVuc= X-Received: by 2002:a17:902:900c:b0:16d:28ad:29e1 with SMTP id a12-20020a170902900c00b0016d28ad29e1mr26021680plp.93.1659538406869; Wed, 03 Aug 2022 07:53:26 -0700 (PDT) In-Reply-To: <83fsid5xg6.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=owinebar@gmail.com; helo=mail-pj1-x1034.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:293024 Archived-At: On Wed, Aug 3, 2022 at 8:22 AM Eli Zaretskii wrote: > > > From: Lynn Winebarger > > Date: Wed, 3 Aug 2022 05:58:17 -0400 > > Cc: Eli Zaretskii , Michael Albinus , > > emacs-devel > > > > I found the problem - when I run make in the src directory, the variables for the ELN and bin destinations are > > blank, which causes the code in loadup that is supposed to make the compilation unit names into pairs to > > not bother. > > Maybe these two variables should get constructed in src/Makefile.in? Running make from the src directory > > shouldn't result in an unusable dump file. > > Why are you running "make" only in 'src'? Some necessary parts of the > build must also run "make" in 'lisp' and in other places. I'm replicating the 3 stage build process Stefan Monnier (added to the cc list) described by invoking a shell script from site-load, when dump-mode is set to pdump. The shell script produces the second stage build - the one with a dump containing just the files loaded directly from loadup - then uses it to compile the files loaded by site-load. It explicitly builds the emacs.pdmp target in src, moves emacs and emacs.pdmp to emacs-1 and emacs-1.pdmp, then invokes: make -C ../lisp EMACS=../src/emacs-1 compile-target TARGETS="${SL_TARGETS}" BYTE_COMPILE_EXTRA_FLAGS="--eval '(setq comp-file-preloaded-p t)'" where SL_TARGETS has been extracted from site-load.el using the same procedure used in constructing lisp.mk And in the process of getting this script right, I also sometimes invoke make directly from src after bootstrapping has attempted to create emacs.pdmp and failed. > > In any case, these variables cannot be defined _only_ in src/Makefile, > but we could perhaps copy the definition from the top-level > Makefile.in to src/Makefile.in. > Whatever you think is best. > > I'd probably make the code in loadup either throw an error or come up with some reasonable default. If you > > insist on having the final installation specified, then it should just error during the build instead of producing a > > dump guaranteed to fail when loaded. Otherwise, either use some dummy values or just treat the build > > directory as the install directory. > > The final installation _must_ be specified, yes. Using the build > directory won't help because Emacs already does that internally. IOW, > it only needs help in knowing where the stuff _will_ be installed That is true for the dump that is going to be installed, yes, but for intermediate stages in the build that knowledge is not required for the resulting dump to be useful. In any case, once loadup determines there are native compile units loaded while preparing for the dump, either they all should have the names fixed up, or an error should be signaled. It would be way more helpful to get an error during the dump procedure stating "The --bin-dir and --eln-dir flags must be specified while dumping with native-compilation units loaded", than to get "attempt to load an incoherent eln" file later. Because that will be the result. It's not clear to me, though, why the pdmp loading process should refuse to work if the compilation units recorded in the dump file are just strings. It seems to me the "dual location" is more of a "nice to have" feature than a real requirement. There could be a flag to dump an image with only the (relative) final installation paths recorded, or it could just be a build that will always be run in place (e.g. an ordinary user build). Or even if an ordinary user reruns loadup in dump mode after emacs has been fully built and installed. Why would the cons in the native compilation unit record be useful at that point? For user dumps, recording the absolute paths would presumably work fine, no? Lynn