From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Corwin Brust Newsgroups: gmane.emacs.bugs Subject: bug#58318: 28.2; Emacs installed from package won't work with MinGW Date: Thu, 6 Oct 2022 08:09:16 -0500 Message-ID: References: <835ygxsdyu.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="21149"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58318@debbugs.gnu.org, Bartosz Bubak To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 06 15:24:26 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ogQrR-0005Jb-In for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Oct 2022 15:24:25 +0200 Original-Received: from localhost ([::1]:33600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogQrQ-0006Lf-Kj for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Oct 2022 09:24:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogQdW-0000XH-NJ for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 09:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogQdW-0000PB-Cy for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 09:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ogQdV-0006eH-MT for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 09:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Corwin Brust Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Oct 2022 13:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58318 X-GNU-PR-Package: emacs Original-Received: via spool by 58318-submit@debbugs.gnu.org id=B58318.166506177825524 (code B ref 58318); Thu, 06 Oct 2022 13:10:01 +0000 Original-Received: (at 58318) by debbugs.gnu.org; 6 Oct 2022 13:09:38 +0000 Original-Received: from localhost ([127.0.0.1]:59375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogQd8-0006db-1t for submit@debbugs.gnu.org; Thu, 06 Oct 2022 09:09:38 -0400 Original-Received: from mail-oo1-f43.google.com ([209.85.161.43]:45963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogQd6-0006dL-1x for 58318@debbugs.gnu.org; Thu, 06 Oct 2022 09:09:36 -0400 Original-Received: by mail-oo1-f43.google.com with SMTP id s1-20020a4a81c1000000b0047d5e28cdc0so1333815oog.12 for <58318@debbugs.gnu.org>; Thu, 06 Oct 2022 06:09:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Zn6BgP9u3NiZNln0tbqy7JIJHpaJzqY1cE4WAbs9mJ4=; b=Lli3xKJtuKM/SfHLBCZ8MUBk2cFJJQe7UJWXSlx04qDji6d+99NywOmdKJDwwl27jW mtpiJoj/YbpXZOZwBYYKSOZZDQ90We2RoaHOIBHBjlQdQlmU7L4LeU4WuSBk/N42tZ9S TTrRVjzZ/N3OtmsJnVh9neCJYbevGVqQSRQezAqEPORn7tsc+bUCYf1Fh8mBudOyGXfO gDomURS/RJG2AcqgKp+RViSACrX2HcvVqO5k+0MjnXYlhq1v3OF6WmBVtH6tSMsLG//q MBPnxQkwoXSUHrp+lle7DCNBPV6vWnM54W+3tZtgzFi4rRXhBUnL6f4aPt9Q/40UEf9p z8xA== X-Gm-Message-State: ACrzQf0yb9eoomaYVYIABqm++nX8LNC3yDt5bWfBZ58rXI8dKz+9e6aT wioC4fZ7as5FYHKk8vPaHt5Xi1o4XsmQJ0ceLom8J7fgX10= X-Google-Smtp-Source: AMsMyM6bowkLf1mOLHXGarwOFeKJCB3UOZBy5wl23w5FyydEgvdu7VI9WTH5LAtmJ4ZzVcDQKyIkUNMg8Fj/HGEINrs= X-Received: by 2002:a05:6830:208e:b0:65a:c07:cca0 with SMTP id y14-20020a056830208e00b0065a0c07cca0mr1810361otq.65.1665061767927; Thu, 06 Oct 2022 06:09:27 -0700 (PDT) In-Reply-To: <835ygxsdyu.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244664 Archived-At: On Thu, Oct 6, 2022 at 12:44 AM Eli Zaretskii wrote: > > > From: Bartosz Bubak > > Date: Wed, 5 Oct 2022 18:01:00 +0200 > > > > When installing Emacs using the installer (emacs-28.2-installer.exe), > > by default it adds the compiler and libraries (gcc and libgccjit) > > to the ./bin directory without prompting the user for his opinion. I'm confused. With one exception, I do not think that we provide GCC with Emacs binaries for windows. We *do* provide libgcc_s_seh-1.dll but we do not provide, e.g. gcc.exe, as.exe, etc. > > > > The problem appears when another compiler is already installed in the > > system, eg. from MinGW. Emacs then tries to use the libraries from PATH > > instead of those installed in its subdirectories: > > > > Warning (comp): c: /tools/emacs/share/emacs/28.2/lisp/org/org-entities.el: > > Error: Internal native compiler error failed to compile > > Warning (comp): C: \\ ProgramData \\ chocolatey \\ lib \\ mingw \\ tools \\ > > install \\ mingw64 \\ bin \\ libgccjit-0.dll: error: error invoking gcc > > driver It does make sense to me that having two different versions of GCC both findable on the Windows path could be problematic (although I don't see how the Emacs installer could be responsible for installing any of them). > > > > When I tried to find a solution to the problem, I found something like > > this: > > > > M-: (executable-find "gcc") RET > > "c:/ProgramData/chocolatey/bin/gcc.exe > > M-: (executable-find "as") RET > > "c:/ProgramData/chocolatey/bin/as.exe" > > etc, etc > > > > But should be: > > C:\Program Files\Emacs\emacs-28.2\bin\gcc.exe > > C:\Program Files\Emacs\emacs-28.2\bin\as.exe That's very odd -- looking at the "install" folder created when I built and packaged the emacs-28 binaries I can't find either of those files: corwi@Avalon MINGW64 /d/emacs-build/install/emacs-28.2 $ (cd /d/emacs-build/install/emacs-28.2; ls -Rl | grep 'as.exe') corwi@Avalon MINGW64 /d/emacs-build/install/emacs-28.2 $ (cd /d/emacs-build/install/emacs-28.2; ls -Rl | grep 'gcc') -rwxr-xr-x 1 corwi corwi 84147 Feb 20 2022 libgcc_s_seh-1.dll -rw-r--r-- 1 corwi corwi 10282 Sep 6 16:31 gcc.el -rw-r--r-- 1 corwi corwi 4680 Sep 6 18:05 gcc.elc > > > > The only solution I have found so far is to uninstall the "global" > > MinGW, then emacs uses the embedded libraries and everything is fine. > > > > In GNU Emacs 28.2 (build 2, x86_64-w64-mingw32) > > of 2022-09-13 built on AVALON > > Windowing system distributor 'Microsoft Corp.', version 10.0.22000 > > System Description: Microsoft Windows 10 Pro (v10.0.2009.22000.978) > > > > Configured using: > > 'configure --with-modules --without-dbus --with-native-compilation > > --without-compress-install CFLAGS=-O2' > > > > Configured features: > > ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP > > NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS > > XPM ZLIB > > > > (NATIVE_COMP present but libgccjit not available) It looks from this that Emacs doesn't find (a complete) GCC kit for use with GCC, so your Emacs should be loading ELN files shipped with the release but not trying to compile any new ones, I think? Unfortunately, that just makes the "Error: Internal native compiler error failed to compile" even more of a mystery: Eli, If, per the configuration reported when generating this bug report, Emacs can see libgccjit is not available, then should Emacs still be trying to native compile org-entitles in this case? > > > > Important settings: > > value of $LANG: PLK > > locale-coding-system: cp1250 > > Corwin, are you reading this? Yes, I am now. Thank you. > > I admit I don't have a clear idea of why the problem happens. Is the > libgccjit and/or GCC and/or Binutils distributed by chocolatey somehow > incompatible with the ones you include in the installer? Because if > they are compatible, just removing the GCC/Binutils stuff bundled with > the Emacs installer should have solved the issue (and then providing > an option in the installer not to install the bundled GCC would be a > way towards solving this). And yet the OP seems to say (AFAIU) that > this didn't help, and only uninstalling the chocolatey GCC/Binutils > did. We cannot possibly ask users to uninstall their existing > development environment when installing Emacs. I'm not aware of any incompatibilities but I'm not a chocolatey user. I'll need to do some experimentation. I'd be happy to add/adjust installer options. Would we (probably most simply?) add an option where we can "uncheck" installing all of the deps? If not, what else would the new option suppress installing (beside libgcc_s_seh-1.dll)? > > I think someone should try installing the chocolatey distribution and > see whether the binaries from the GNU FTP site can work with its > libgccjit. Because I'm not sure I understand what happens in this > case, even though I asked several times. If indeed there's > incompatibility, I'd be interested to know why (I have no idea how > chocolatey builds its GCC). If that is not solvable, we should > probably say that people with chocolatey installation should not > install Emacs binaries with native-compilation enabled. I'll get the machine I'm using to test release binaries going on this today after work and report back with any success I have reproducing/researching. Others' findings would be most welcome if anyone else is experimenting with this too.