unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Emacs macOS build warnings
       [not found] <968F1C8D-123F-4692-B035-C999767CC45C@acm.org>
@ 2022-02-06 16:00 ` Alan Third
  2022-02-06 16:14   ` Mattias Engdegård
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Third @ 2022-02-06 16:00 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Po Lu, Emacs-Devel

On Wed, Feb 02, 2022 at 12:46:09PM +0100, Mattias Engdegård wrote:
> Dear Emacs NS maintainers,
> 
> Building Emacs on macOS 11.6.3 (Big Sur) with Apple clang 13.0.0, I
> get deprecation warnings from two uses of `vfork` and one of
> `CTGetCoreTextVersion`. I'd like to get rid of them but without
> causing trouble for other configurations.
> 
> Silencing the vfork warnings would be straightforward enough but the
> question is under what condition it should be done. Maybe it doesn't
> make any harm when it isn't needed?

On the latest macOS I believe vfork now does the same thing as fork,
so it might be easiest to detect the OS version and unset HAVE_VFORK,
although since we don't seem to actually check for that directly in
configure.ac I guess it's perhaps a standard test in autoconfig which
may make it hard to over-ride?

The alternative approach is to look at whether we should be using
posix_spawn here. I was under the impression that we had already
switched to using posix_spawn, at least on macOS, so I guess these
calls to vfork were missed.

> I treated CTGetCoreTextVersion warning by following the direction in
> the deprecation message and used NSProcesInfo instead, and it seems
> to work although it's a bit clumsy. Is there a better way?

I think your fix for this is good and probably the right thing to do.

-- 
Alan Third



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs macOS build warnings
  2022-02-06 16:00 ` Emacs macOS build warnings Alan Third
@ 2022-02-06 16:14   ` Mattias Engdegård
  2022-02-10 21:33     ` Alan Third
  0 siblings, 1 reply; 4+ messages in thread
From: Mattias Engdegård @ 2022-02-06 16:14 UTC (permalink / raw)
  To: Alan Third; +Cc: Po Lu, Emacs-Devel

6 feb. 2022 kl. 17.00 skrev Alan Third <alan@idiocy.org>:

> On the latest macOS I believe vfork now does the same thing as fork,
> so it might be easiest to detect the OS version and unset HAVE_VFORK,
> although since we don't seem to actually check for that directly in
> configure.ac I guess it's perhaps a standard test in autoconfig which
> may make it hard to over-ride?

In the version I am using (11.6.3), which is also the most recently supported for my machine, vfork is measurably faster than fork so it isn't an alias yet. In other words, unsetting HAVE_VFORK would lead to a performance regression.

> The alternative approach is to look at whether we should be using
> posix_spawn here. I was under the impression that we had already
> switched to using posix_spawn, at least on macOS, so I guess these
> calls to vfork were missed.

The idea is to use posix_spawn when possible; according to comments in the code, that function cannot be used in some circumstances such as when we need to use PTYs instead of pipes. I haven't verified whether this is actually true.

I'm sure you are happy to hear that dropping fork/exec is high on my list of things to discuss with Ken and Dennis when I finally get my time machine working.

>> I treated CTGetCoreTextVersion warning by following the direction in
>> the deprecation message and used NSProcesInfo instead, and it seems
>> to work although it's a bit clumsy. Is there a better way?
> 
> I think your fix for this is good and probably the right thing to do.

Thank you, I shall commit it as a separate change then.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs macOS build warnings
  2022-02-06 16:14   ` Mattias Engdegård
@ 2022-02-10 21:33     ` Alan Third
  2022-02-10 22:16       ` Mattias Engdegård
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Third @ 2022-02-10 21:33 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Po Lu, Emacs-Devel

On Sun, Feb 06, 2022 at 05:14:07PM +0100, Mattias Engdegård wrote:
> 6 feb. 2022 kl. 17.00 skrev Alan Third <alan@idiocy.org>:
> 
> > On the latest macOS I believe vfork now does the same thing as fork,
> > so it might be easiest to detect the OS version and unset HAVE_VFORK,
> > although since we don't seem to actually check for that directly in
> > configure.ac I guess it's perhaps a standard test in autoconfig which
> > may make it hard to over-ride?
> 
> In the version I am using (11.6.3), which is also the most recently
> supported for my machine, vfork is measurably faster than fork so it
> isn't an alias yet. In other words, unsetting HAVE_VFORK would lead
> to a performance regression.

OK, I guess we need to silence the deprecation messages then... I feel
like there should be something smarter we can do here, but I guess
there probably isn't.

> > The alternative approach is to look at whether we should be using
> > posix_spawn here. I was under the impression that we had already
> > switched to using posix_spawn, at least on macOS, so I guess these
> > calls to vfork were missed.
> 
> The idea is to use posix_spawn when possible; according to comments
> in the code, that function cannot be used in some circumstances such
> as when we need to use PTYs instead of pipes. I haven't verified
> whether this is actually true.
> 
> I'm sure you are happy to hear that dropping fork/exec is high on my
> list of things to discuss with Ken and Dennis when I finally get my
> time machine working.

I'd rather you have a word with Tim Cook about not deprecating every
feature we use? ;)

> >> I treated CTGetCoreTextVersion warning by following the direction in
> >> the deprecation message and used NSProcesInfo instead, and it seems
> >> to work although it's a bit clumsy. Is there a better way?
> > 
> > I think your fix for this is good and probably the right thing to do.
> 
> Thank you, I shall commit it as a separate change then.

Thanks.
-- 
Alan Third



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs macOS build warnings
  2022-02-10 21:33     ` Alan Third
@ 2022-02-10 22:16       ` Mattias Engdegård
  0 siblings, 0 replies; 4+ messages in thread
From: Mattias Engdegård @ 2022-02-10 22:16 UTC (permalink / raw)
  To: Alan Third; +Cc: Po Lu, Emacs-Devel

10 feb. 2022 kl. 22.33 skrev Alan Third <alan@idiocy.org>:

> OK, I guess we need to silence the deprecation messages then... I feel
> like there should be something smarter we can do here, but I guess
> there probably isn't.

Thanks, I pushed the rest of the patch. If it causes trouble for any other combination of compiler and OS version then it will just have to be dealt with somehow.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-10 22:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <968F1C8D-123F-4692-B035-C999767CC45C@acm.org>
2022-02-06 16:00 ` Emacs macOS build warnings Alan Third
2022-02-06 16:14   ` Mattias Engdegård
2022-02-10 21:33     ` Alan Third
2022-02-10 22:16       ` Mattias Engdegård

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).