unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: emacs-devel@gnu.org
Subject: Re: MSYS2 PATH problems with native compilation
Date: Mon, 06 Dec 2021 23:48:28 +0100	[thread overview]
Message-ID: <875ys1bb9f.fsf@telefonica.net> (raw)
In-Reply-To: 83lf0x248u.fsf@gnu.org

Eli Zaretskii <eliz@gnu.org> writes:

>> 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.
>
> What do you mean by "depends on libgccjit"?

It is a package dependency, meaning that if the user installs the emacs
package, it is guaranteed that libgccjit will be installed too.

>> 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.
>
> How is libgccjit different from any other DLL that Emacs loads
> dynamically, like libpng, for example?  How do your users, who work
> with multiple architectures, cope with that wrt other DLLs that Emacs
> uses?

DLLs that Emacs load dynamically are not a problem, they all work fine
(including libgccjit dll). The problem is for executables invoked by
Emacs, because Emacs searchs for them using exec-path (which itself
depends on the initial value of PATH.) This is different to what
CreateProcess does which, as you very well know, always searches the
executable on the same directory as the calling process' executable,
first thing. This means that Emacs deviates from the stablished rule on
Windows, and that deviation causes a degraded experience.

To recap: libgccjit dll is fine, but as.exe/ld.exe/etcetera are not found
despite being installed right there along emacs.exe.

>> 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?
>
> "OK" from what POV?

From your POV, of course. I'm talking about making changes to Emacs.

> The MSYS2 project makes its own rules for
> configuring binary distributions, and those decisions are not
> necessarily aligned with the upstream project.  Why do you ask here
> whether something you'd like to do in your distribution is OK or not?

We could locally patch Emacs, of course, but "fixing" the upstream
project is preferable.

> If you want to know my opinions, you already heard them.  (And I still
> don't think I understand the underlying problem, even after your
> additional explanations, see above.)
>
>> Other solution?
>
> If you cannot put a DLL on PATH, the usual solution is to have it in
> the same directory as the .exe which needs it.  Would that be a
> satisfactory solution for your problems?

This is not about DLLs, as stated above.

The general problem is that Emacs is installed along all the tools it
needs, but they are invisible to Emacs unless you explicitly say "they
are right there where you are!". That's not the experience we get on
GNU/Linux and other systems, where Emacs has no problem finding any
executable as long as it is installed where the package manager puts it
by default.




  reply	other threads:[~2021-12-06 22:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 15:04 msys2 build path problems + copy-paste english results in chinese characters arthur miller
2021-12-01 15:55 ` Lars Ingebrigtsen
2021-12-01 18:32   ` Arthur Miller
2021-12-01 18:50     ` Lars Ingebrigtsen
2021-12-01 22:42       ` Arthur Miller
2021-12-01 16:46 ` Eli Zaretskii
2021-12-01 18:25   ` Arthur Miller
2021-12-01 18:44     ` Eli Zaretskii
2021-12-01 22:39       ` Arthur Miller
2021-12-01 23:01         ` Óscar Fuentes
2021-12-02  7:19           ` Eli Zaretskii
2021-12-02  9:42             ` Óscar Fuentes
2021-12-02 10:05               ` Eli Zaretskii
2021-12-02 15:40                 ` Óscar Fuentes
2021-12-02 18:05                   ` Eli Zaretskii
2021-12-05  8:43                     ` Arthur Miller
2021-12-06  0:38             ` MSYS2 PATH problems with native compilation (was: msys2 build path problems + copy-paste english results in chinese characters) Óscar Fuentes
2021-12-06 14:32               ` Eli Zaretskii
2021-12-06 22:48                 ` Óscar Fuentes [this message]
2021-12-07 13:20                   ` MSYS2 PATH problems with native compilation Eli Zaretskii
2021-12-07 16:09                     ` Óscar Fuentes
2021-12-07 17:07                       ` Eli Zaretskii
2021-12-07 21:13                         ` Óscar Fuentes
2021-12-08 12:34                           ` Eli Zaretskii
2021-12-02  7:17         ` msys2 build path problems + copy-paste english results in chinese characters Eli Zaretskii
     [not found]           ` <AM9PR09MB4977B43C2FC19514E4385B5E966C9@AM9PR09MB4977.eurprd09.prod.outlook.com>
2021-12-05 10:17             ` Eli Zaretskii
2021-12-05 10:57               ` Arthur Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875ys1bb9f.fsf@telefonica.net \
    --to=ofv@wanadoo.es \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).