Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /private/var/mail to darwin_native sandbox #3

Closed
wants to merge 1 commit into from

Conversation

jlmuir
Copy link
Contributor

@jlmuir jlmuir commented Mar 29, 2017

This makes the configure phase of pkgsrc's mail/neomutt work because it has an Autotools configure check for "where new mail is stored" which roughly does the following:

mutt_cv_mailpath=no
if test -d /var/mail; then
  mutt_cv_mailpath=/var/mail
elif test -d /var/spool/mail; then
  mutt_cv_mailpath=/var/spool/mail
elif test -d /usr/spool/mail; then
  mutt_cv_mailpath=/usr/spool/mail
elif test -d /usr/mail; then
  mutt_cv_mailpath=/usr/mail
fi

Since /var/mail nor any of the other paths exist in the sandbox, the configure script fails like this:

checking where new mail is stored... no
configure: error: "Could not determine where new mail is stored."
*** Error code 1

This change is really just a change to make the sandbox more like outside the sandbox so that a particular pkgsrc package will build. In this case, the package is mail/neomutt. I don't know if any other pkgsrc package would benefit.

Another approach would be to change pkgsrc's mail/neomutt/Makefile to invoke the configure script with --with-mailpath=/var/mail for Darwin. But it seems like a tough sell to get that committed because it seems like a bad idea to be making changes to pkgsrc packages to make them build successfully in a particular sandbox. Ideally the sandbox should enable packages to build just like outside the sandbox.

Depending on how realistic /var/mail should be in the sandbox, it could instead be returned by the _darwin_native_bindfs_mounts function, but since other things in /var were being faked (i.e., just being created in the sandbox and not using a null-mount), the change just adds it in the darwin_native_create function with the other faked things.

Add /private/var/mail (and /var/mail by way of the already existing
/var -> /private/var symlink) to the darwin_native sandbox.  In the
sandbox, it will be empty, its group ID will not be that of the mail
group, and it will not be writable by the mail group, but it will be
good enough to satisfy Autotools-like configure scripts that look for a
system mail spool (e.g., pkgsrc's mail/neomutt which has a "where new
mail is stored" check).
@jmmv
Copy link
Owner

jmmv commented Apr 18, 2017

Merged as 7c9de79. Same as with the other PR: modified your change to rebase it with HEAD and to add a NEWS entry.

@jmmv jmmv closed this Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants