From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: MSYS2 PATH problems with native compilation (was: msys2 build path problems + copy-paste english results in chinese characters) Date: Mon, 06 Dec 2021 01:38:14 +0100 Message-ID: <87a6hebma1.fsf_-_@telefonica.net> References: <83a6hks26v.fsf@gnu.org> <83pmqgqi6e.fsf@gnu.org> <87czmghqui.fsf@telefonica.net> <834k7rqxru.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18940"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:Slgiiv3NySJcfRqLrSygUlOWZNM= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 06 01:40:49 2021 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 1mu23l-0004jH-AO for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Dec 2021 01:40:49 +0100 Original-Received: from localhost ([::1]:46208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mu23j-000572-Qr for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Dec 2021 19:40:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mu21T-0004In-QI for emacs-devel@gnu.org; Sun, 05 Dec 2021 19:38:27 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:54732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mu21R-0001Gi-C8 for emacs-devel@gnu.org; Sun, 05 Dec 2021 19:38:27 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mu21O-0001rI-UZ for emacs-devel@gnu.org; Mon, 06 Dec 2021 01:38:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:281037 Archived-At: Eli Zaretskii writes: >> From: Óscar Fuentes >> Date: Thu, 02 Dec 2021 00:01:41 +0100 >> >> >> Does the directory where you have gas.exe >> >> appear on the system-wide PATH? >> > >> > Nope; I haven't manually added any of msys paths to the system, I thought the >> > build would add some default paths to msys dirs. >> >> Try this in your .emacs : >> >> (let ((dir (file-name-directory (car command-line-args)))) >> (setenv "PATH" (concat (getenv "PATH") path-separator dir)) >> (setq exec-path (append exec-path (list dir)))) > > Changing PATH from within Emacs is not recommended, it will bite you > down the road when you least expect it. Revisiting this... I just checked in the recipe for building Emacs 28.0.90 on MinGW-w64 (MSYS2) with native compilation enabled and found a serious problem. The Emacs MinGW-w64/MSYS2 package now depends on libgccjit package, which means that libgccjit will be present when Emacs is installed. But if Emacs runs without its bin/ directory in PATH, libgccjit is not functional (an error about missing as.exe is shown.) Creating a desktop icon for runemacs.exe and starting Emacs from there is common. Also for MSYS2 users is common to work with multiple architectures (mingw, clang, ucrt with their 32/64 bits variants) simultaneously, and putting the binaries of one of those architectures in global PATH is problematic. Hence it would be very convenient to use libgccjit without touching PATH. I ask again: would it be ok to add emacs.exe directory to PATH from runemacs.exe or emacs.exe itself? Set PATH for the emacs instances used for generating the .eln files? Other solution?