emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MSYS2 PATH problems with native compilation (was: msys2 build path probl


From: Óscar Fuentes
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Óscar Fuentes <ofv@wanadoo.es>
>> 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?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]