all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Andreas Grünbacher" <andreas.gruenbacher@gmail.com>
Cc: 20681@debbugs.gnu.org, eggert@cs.ucla.edu, nandryshak@gmail.com,
	angelo.graziosi@alice.it
Subject: bug#20681: Build failure [MSYS2/MINGW64, OSX]
Date: Sun, 31 May 2015 17:29:19 +0300	[thread overview]
Message-ID: <83oal0u8g0.fsf@gnu.org> (raw)
In-Reply-To: <CAHpGcMLdNfNFAY0gAQszGSCT6r8b199gUbOrQoLaPC-H206w0w@mail.gmail.com>

> Date: Sat, 30 May 2015 15:06:16 +0200
> From: Andreas Grünbacher <andreas.gruenbacher@gmail.com>
> Cc: Nick Andryshak <nandryshak@gmail.com>, 20681@debbugs.gnu.org, 
> 	Paul Eggert <eggert@cs.ucla.edu>, Angelo Graziosi <angelo.graziosi@alice.it>
> 
> > Please tell what do you want to see in confg.h, specifically.  I can
> > force the Emacs development head to compile set-permissions.c, so
> > perhaps Emacs's config.h will do.
> 
> It may. I have no idea what kind of acl functionality emacs on MinGW
> should have though.

Emacs built with MinGW has the same functionality on Windows as Emacs
does on Posix hosts: get a file's ACL as a text string, set a file's
ACL from text string description, and copy ACL from one file to
another.

The relevant functions, acl_get_file, acl_set_file, acl_to_text,
acl_from_text, and acl_free are implemented as part of Emacs.

> What did it do before?

The only ACL-related function that Emacs on Windows was using from
Gnulib was acl_errno_valid.  All the rest were implemented in the
Emacs sources.

IOW, the Gnulib ACL functions were almost completely unused in the
MinGW build.  However, they did compile, which allowed us to keep the
Gnulib configuration very similar to what was used on Posix hosts.
Which is why I'm not sure it is worth your while to do more than
you've already done, unless you do want to make sure the code at least
compiles as it did before.

With that caveat, I answer below your questions, regardless.

> Is the build failure new or did it already exist before the acl
> rewrite?

It is new.  Before the rewrite, the file qcopy-acl.c would compile
with MinGW, although the function qcopy_acl was not called in the
MinGW build, and so qcopy-acl.o was not linked into the binary.  But
it would at least compile.

After the rewrite, qcopy-acl.c is just a thin wrapper around
get-permissions.c and set-permissions.c.  The former still compiles
with MinGW, but the latter doesn't.  The reason is this cpp
conditional:

  #    ifndef HAVE_ACL_DELETE_DEF_FILE
  #     error Must have acl_delete_def_file (see POSIX 1003.1e draft 17).
  #    endif

I don't understand why the code requires acl_delete_def_file where it
previously did not: it's not like setting permissions will absolutely
not work if there is no such function.  E.g., why not do something
like the following instead:

  #    ifndef HAVE_ACL_DELETE_DEF_FILE
		    ret = -1;
		    errno = ENOSYS;
  #    else
		    ret = acl_delete_def_file (name);

  #    endif

More generally, copying ACLs from one file to another does not need
any analysis of what's in the ACLs being copied: it could simply treat
the ACLs as an opaque object, something whose structure and semantics
are known only to the innards of acl_get_file and acl_set_file.  So
building qcopy_acl on top of get_permissions and set_permissions,
which are more flexible, and do require that knowledge, is IMO
fundamentally wrong, as it makes much harder to port this simple and
important Gnulib function to other platforms.  After all, copying ACLs
from one file to another is much more frequent and important an
operation than setting ACLs from user-specified arguments.  What's
more, the assumption that if acl_get_file and acl_set_file are
available, then so should be acl_delete_def_file is yet another
obstacle, IMO gratuitous one.

> Which acl related symbols do you have in config.h?

HAVE_ACL_FREE
HAVE_ACL_FROM_TEXT
HAVE_ACL_GET_FILE
HAVE_ACL_SET_FILE
HAVE_SYS_ACL_H
USE_ACL

> If it has acl_get_file and acl_set_file, where can I find
> documentation about what those functions do on MinGW?

They do what you'd expect, but support only ACL_TYPE_ACCESS.  They
know about ACL_TYPE_DEFAULT, but always return EINVAL for it, since
it's next to impossible (and not recommended) to have a directory on
Windows which has no default ACLs associated with it.

You can see their sources in src/w32.c in the Emacs repository.

Thanks.





  reply	other threads:[~2015-05-31 14:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 12:55 bug#20681: Build failure [MSYS2/MINGW64, OSX] Angelo Graziosi
2015-05-28 17:47 ` Eli Zaretskii
2015-05-29 12:27   ` Angelo Graziosi
2015-05-29 16:56     ` Paul Eggert
2015-05-29 19:06       ` bug#20681: [PATCH] acl-permissions: Fix build on Mac OS X and older AIX (Bug#20681) Andreas Gruenbacher
2015-05-29 19:09       ` bug#20681: Build failure [MSYS2/MINGW64, OSX] Andreas Grünbacher
2015-05-29 19:45         ` Paul Eggert
2015-05-29 19:56           ` Nick Andryshak
2015-05-29 19:57             ` Andreas Grünbacher
2015-05-30 10:22               ` Eli Zaretskii
2015-05-30 12:02                 ` Andreas Grünbacher
2015-05-30 12:10                   ` Eli Zaretskii
2015-05-30 13:06                     ` Andreas Grünbacher
2015-05-31 14:29                       ` Eli Zaretskii [this message]
2015-05-31 19:18                         ` Andreas Grünbacher
2015-06-01 15:05                           ` Eli Zaretskii
2015-06-01 16:18                             ` Andreas Grünbacher
2015-06-01 17:39                               ` Eli Zaretskii
2015-06-01 18:41                                 ` Andreas Grünbacher
2015-06-01 19:01                                   ` Eli Zaretskii
2015-05-29 21:49           ` Angelo Graziosi

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

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

  git send-email \
    --in-reply-to=83oal0u8g0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=20681@debbugs.gnu.org \
    --cc=andreas.gruenbacher@gmail.com \
    --cc=angelo.graziosi@alice.it \
    --cc=eggert@cs.ucla.edu \
    --cc=nandryshak@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.