unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: windows build failure
Date: Tue, 22 Feb 2011 05:49:41 -0500	[thread overview]
Message-ID: <E1PrpoL-0003V4-Gv@fencepost.gnu.org> (raw)
In-Reply-To: <4D638488.50101@cs.ucla.edu> (message from Paul Eggert on Tue, 22 Feb 2011 01:40:24 -0800)

> Date: Tue, 22 Feb 2011 01:40:24 -0800
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: emacs-devel@gnu.org
> 
> On 02/22/2011 12:57 AM, Eli Zaretskii wrote:
> >  the artificial definition to zero in sys_stat.in.h
> > is only fine if one ignores the de-facto practice of testing for
> > S_IFLNK or S_ISLNK to guard code elsewhere that cannot be compiled or
> > run on platforms without symlinks
> 
> No, the idea is that normal code should not use #ifdef S_IFLNK.

Well, "normal code" in Emacs does.  We have 5 such places at this
time, if I didn't miss any.

> It should instead use "if (S_ISLNK (...)) ...".
> On hosts that don't have symbolic links, this "if"
> gets optimized away to nothing, so it's just as fast
> as the #ifdef.

How can we use this idea, when the code in question calls functions
like `symlink' or `readlink", which don't exist on hosts that don't
support symlinks?  This won't link, unless we do something else in
addition.  If we want to go your way, we need to decide how to resolve
this difficulty (and do it in a way that won't become broken when you
resync with gnulib an hour or a day or a year from now ;-).

> Using plain "if" tends to lead to code that is easier to maintain
> than using "#ifdef", in cases like these.

I have no issues with using "if", but we must decide how to do that
without breaking compilation/link.

Once compilation and link work, we will also need to carefully review
the affected code, because its logic might subtly assume something
about the underlying platforms' behavior wrt symlinks, and that logic
might do The Wrong Thing when applied to hosts without symlinks, in
the parts that are common to "if" and its "else".

> Large chunks of GNU code have been written using this style,
> in programs such as coreutils, and it typically works well.

For some value of "well".  I really don't want to begin griping about
the MinGW port of Coreutils on Windows (that's OT here, anyway), but
for starters, it is linked against a ported glibc, which includes a
bastard semi-broken emulation of symlinks.  So I'm not sure anyone has
ever tested this approach in practice, at least not in Coreutils.

Again, I'm not against going the "if" path, I just wanted to (a) point
out the issue and hear from the relevant parties what, if anything,
they prefer to do about that, and (b) make sure we all understand that
fixing it cleanly is not a trivial job (but not rocket science,
either, of course).  Once the decision is made, I will be more than
willing to contribute to this effort.



  reply	other threads:[~2011-02-22 10:49 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 19:37 windows build failure Sean Sieger
2011-02-21 19:40 ` Sean Sieger
2011-02-21 19:46 ` Christoph
2011-02-21 19:48 ` Paul Eggert
2011-02-21 20:21   ` Eli Zaretskii
2011-02-21 20:29     ` Lennart Borgman
2011-02-21 22:50     ` Sean Sieger
2011-02-21 20:37   ` Eli Zaretskii
2011-02-22  2:09     ` Paul Eggert
2011-02-22  8:57       ` Eli Zaretskii
2011-02-22  9:40         ` Paul Eggert
2011-02-22 10:49           ` Eli Zaretskii [this message]
2011-02-22 21:44             ` Paul Eggert
2011-02-23  9:47               ` Eli Zaretskii
2011-02-23 10:32                 ` Eli Zaretskii
2011-02-25 21:28                 ` Paul Eggert
2011-02-26 18:01                   ` Remove S_IFLNK (was: windows build failure) Eli Zaretskii
2011-02-26 20:01                     ` Remove S_IFLNK Stefan Monnier
2011-02-26 22:36                     ` Paul Eggert
2011-02-27 19:54                       ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2013-09-17 21:45 windows build failure Sean Sieger
2013-09-18  6:42 ` Eli Zaretskii
2013-09-18  6:56   ` Dani Moncayo
2013-09-18  7:23     ` Eli Zaretskii
2013-09-18 12:37       ` Sean Sieger
2013-09-18 12:44         ` Eli Zaretskii
     [not found]   ` <CADWZ7fL5iWhAWqrc8RqipO3Zgaz=AygHPUhhTNG97zTVaxpE3g@mail.gmail.com>
2013-09-18 12:46     ` Eli Zaretskii
2013-09-18 13:08       ` Sean Sieger
2013-09-18 13:18         ` Eli Zaretskii
2013-09-18 13:25           ` Sean Sieger
2013-09-18 14:48             ` Eli Zaretskii
2013-09-18 15:15               ` Sean Sieger
2013-09-18 15:28                 ` Eli Zaretskii
2013-09-18 15:38                   ` Sean Sieger
2013-09-19 14:14               ` Sean Sieger
2013-09-19 14:24                 ` Eli Zaretskii
2013-09-19 17:33                   ` Sean Sieger
2013-09-19 18:46                     ` Eli Zaretskii
2013-09-19 20:25                       ` Sean Sieger
2013-09-20  7:28                         ` Eli Zaretskii
2013-09-20 14:24                           ` Sean Sieger
2013-09-20 15:16                             ` Eli Zaretskii
2013-09-20 16:23                               ` Sean Sieger
2013-09-20 16:34                               ` Sean Sieger
2013-09-20 17:40                                 ` Eli Zaretskii
2013-10-12 13:31                                   ` Eli Zaretskii
2013-10-12 15:55                                     ` Paul Eggert
2013-10-12 16:49                                       ` Eli Zaretskii
2013-10-12 19:13                                         ` Paul Eggert
2013-10-12 20:03                                           ` Eli Zaretskii
2013-10-12 21:45                                             ` Paul Eggert
2013-10-12 19:31                                     ` Sean Sieger
2013-10-14 12:41                                     ` Sean Sieger
2013-10-14 16:25                                       ` Eli Zaretskii
2013-10-14 17:31                                         ` Sean Sieger
2013-10-14 18:02                                     ` Sean Sieger
2013-10-14 18:10                                       ` Eli Zaretskii
2013-10-14 19:06                                         ` Sean Sieger
2013-10-14 19:13                                           ` Eli Zaretskii
2013-10-14 19:24                                             ` Sean Sieger
2013-05-26 20:29 Sean Sieger
2013-05-27 16:36 ` Eli Zaretskii
2013-05-27 18:07   ` Óscar Fuentes
2013-05-27 19:10     ` Eli Zaretskii
2013-05-27 19:56       ` Óscar Fuentes
2013-05-28 18:19   ` Sean Sieger
2013-05-28 19:07     ` Eli Zaretskii
2013-05-29 13:15       ` rzl24ozi
2013-05-29 15:21         ` Eli Zaretskii
2013-05-29 15:50           ` Óscar Fuentes
2013-05-29 17:17             ` Eli Zaretskii
2013-05-29 17:02           ` Paul Eggert
2013-05-29 17:20             ` Eli Zaretskii
2013-05-29 18:55               ` Paul Eggert
2013-05-29 20:28                 ` Eli Zaretskii
2013-05-29 21:27                   ` Paul Eggert
2013-05-30  2:46                     ` Eli Zaretskii
2013-05-29 23:35           ` rzl24ozi
2013-05-30 18:03             ` Eli Zaretskii
2013-05-30 19:38               ` rzl24ozi
2013-05-31  8:50                 ` Eli Zaretskii
2013-05-29 16:06   ` cg
2013-05-29 17:21     ` Eli Zaretskii
2012-07-29 16:40 Windows " Dani Moncayo
2012-07-29 16:49 ` Dani Moncayo
2011-02-14 16:47 windows " Sean Sieger
2011-02-14 16:54 ` Tom Tromey
2011-02-14 17:17   ` Eli Zaretskii
2011-02-14 17:20     ` Sean Sieger
2011-02-14 17:49     ` Eli Zaretskii
2011-02-14 18:02       ` Tom Tromey
2011-02-14 20:43       ` Sean Sieger
2011-01-03 17:57 Sean Sieger
2011-01-03 19:37 ` Eli Zaretskii
2010-08-02 15:01 Sean Sieger
2010-08-02 15:05 ` Juanma Barranquero
2010-08-02 15:16   ` Sean Sieger
2010-07-19 14:42 Sean Sieger
2010-07-19 15:03 ` Óscar Fuentes
2010-07-19 15:30   ` Juanma Barranquero
2010-07-19 17:45     ` Eli Zaretskii
2010-07-20 18:33       ` Juanma Barranquero
2010-07-19 18:35   ` Sean Sieger

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=E1PrpoL-0003V4-Gv@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --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).