unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] configure: fix mktemp call for macOS
@ 2019-06-12  0:26 Ralph Seichter
  2019-06-14 10:57 ` David Bremner
  0 siblings, 1 reply; 10+ messages in thread
From: Ralph Seichter @ 2019-06-12  0:26 UTC (permalink / raw)
  To: notmuch

The mktemp call in configure is incompatible with /usr/bin/mktemp as
shipped with macOS, where it fails due to a missing parameter. I added
the missing template, and the call is now working with both Apple's
and GNU coreutils' mktemp.

Signed-off-by: Ralph Seichter <abbot@monksofcool.net>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 8b80f0e0..feebafcc 100755
--- a/configure
+++ b/configure
@@ -529,7 +529,7 @@ int main () {
     return 0;
 }
 EOF
-    if ! TEMP_GPG=$(mktemp -d); then
+    if ! TEMP_GPG=$(mktemp -d /tmp/notmuch.XXXXXX); then
         printf 'No.\nCould not make tempdir for testing session-key support.\n'
         errors=$((errors + 1))
     elif ${CC} ${CFLAGS} ${gmime_cflags} _check_session_keys.c ${gmime_ldflags} -o _check_session_keys \
-- 
2.21.0

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

* Re: [PATCH] configure: fix mktemp call for macOS
  2019-06-12  0:26 [PATCH] configure: fix mktemp call for macOS Ralph Seichter
@ 2019-06-14 10:57 ` David Bremner
  2019-06-14 11:19   ` Ralph Seichter
  0 siblings, 1 reply; 10+ messages in thread
From: David Bremner @ 2019-06-14 10:57 UTC (permalink / raw)
  To: Ralph Seichter, notmuch; +Cc: Tomi Ollila

Ralph Seichter <abbot@monksofcool.net> writes:

> The mktemp call in configure is incompatible with /usr/bin/mktemp as
> shipped with macOS, where it fails due to a missing parameter. I added
> the missing template, and the call is now working with both Apple's
> and GNU coreutils' mktemp.
>

I'm hoping Tomi will comment, but I wonder if we should do something
like

TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX")

(borrowed from test/test-lib.sh). This avoids hardcoding the temporary
directory.

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

* Re: [PATCH] configure: fix mktemp call for macOS
  2019-06-14 10:57 ` David Bremner
@ 2019-06-14 11:19   ` Ralph Seichter
  2019-06-14 17:57     ` Tomi Ollila
  0 siblings, 1 reply; 10+ messages in thread
From: Ralph Seichter @ 2019-06-14 11:19 UTC (permalink / raw)
  To: David Bremner, notmuch; +Cc: Tomi Ollila

* David Bremner:

> TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX")
>
> (borrowed from test/test-lib.sh). This avoids hardcoding the temporary
> directory.

I had the same thought at first, but I want to ensure that the path
length does not cause trouble anymore.

  > uname -v
  Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64
  > echo $TMPDIR
  /var/folders/m_/w5lk3r_1495dhnl4l0s96pr00000gn/T/

That's my MacBook Pro with macOS 10.14.5 (Mojave). AFAIK, older versions
can have longer names. Also, I am concerned with accumulating clutter.

  > grep clean_tmps_dirs /etc/defaults/periodic.conf
  daily_clean_tmps_dirs="/tmp"

The /tmp directory will, with default settings, be cleaned periodically
by the OS, while $TMPDIR (which is user-specific) will not.

-Ralph

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

* Re: [PATCH] configure: fix mktemp call for macOS
  2019-06-14 11:19   ` Ralph Seichter
@ 2019-06-14 17:57     ` Tomi Ollila
  2019-06-14 18:11       ` Tomi Ollila
  2019-06-16 14:30       ` Daniel Kahn Gillmor
  0 siblings, 2 replies; 10+ messages in thread
From: Tomi Ollila @ 2019-06-14 17:57 UTC (permalink / raw)
  To: Ralph Seichter, David Bremner, notmuch

On Fri, Jun 14 2019, Ralph Seichter wrote:

> * David Bremner:
>
>> TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX")
>>
>> (borrowed from test/test-lib.sh). This avoids hardcoding the temporary
>> directory.
>
> I had the same thought at first, but I want to ensure that the path
> length does not cause trouble anymore.

Yes. $TMPDIR could be problematic if it makes the full (unix domain
socket?) path be too long.

SO, exact version Ralph made looks good to me.

Tomi


>
>   > uname -v
>   Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64
>   > echo $TMPDIR
>   /var/folders/m_/w5lk3r_1495dhnl4l0s96pr00000gn/T/
>
> That's my MacBook Pro with macOS 10.14.5 (Mojave). AFAIK, older versions
> can have longer names. Also, I am concerned with accumulating clutter.
>
>   > grep clean_tmps_dirs /etc/defaults/periodic.conf
>   daily_clean_tmps_dirs="/tmp"
>
> The /tmp directory will, with default settings, be cleaned periodically
> by the OS, while $TMPDIR (which is user-specific) will not.
>
> -Ralph
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] configure: fix mktemp call for macOS
  2019-06-14 17:57     ` Tomi Ollila
@ 2019-06-14 18:11       ` Tomi Ollila
  2019-06-16 14:30       ` Daniel Kahn Gillmor
  1 sibling, 0 replies; 10+ messages in thread
From: Tomi Ollila @ 2019-06-14 18:11 UTC (permalink / raw)
  To: Ralph Seichter, David Bremner, notmuch

On Fri, Jun 14 2019, Tomi Ollila wrote:

> On Fri, Jun 14 2019, Ralph Seichter wrote:
>
>> * David Bremner:
>>
>>> TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX")
>>>
>>> (borrowed from test/test-lib.sh). This avoids hardcoding the temporary
>>> directory.
>>
>> I had the same thought at first, but I want to ensure that the path
>> length does not cause trouble anymore.
>
> Yes. $TMPDIR could be problematic if it makes the full (unix domain
> socket?) path be too long.
>
> SO, exact version Ralph made looks good to me.


Revert that. mktemp(1) uses $TMPDIR if defined (and just tested)

>
> Tomi
>
>
>>
>>   > uname -v
>>   Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64
>>   > echo $TMPDIR
>>   /var/folders/m_/w5lk3r_1495dhnl4l0s96pr00000gn/T/
>>
>> That's my MacBook Pro with macOS 10.14.5 (Mojave). AFAIK, older versions
>> can have longer names. Also, I am concerned with accumulating clutter.
>>
>>   > grep clean_tmps_dirs /etc/defaults/periodic.conf
>>   daily_clean_tmps_dirs="/tmp"
>>
>> The /tmp directory will, with default settings, be cleaned periodically
>> by the OS, while $TMPDIR (which is user-specific) will not.
>>
>> -Ralph
>> _______________________________________________
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> https://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] configure: fix mktemp call for macOS
  2019-06-14 20:16   ` Fwd: Delivery Status Notification (Failure) Tomi Ollila
@ 2019-06-15 17:51     ` Ralph Seichter
  2019-06-16 11:12       ` Tomi Ollila
  0 siblings, 1 reply; 10+ messages in thread
From: Ralph Seichter @ 2019-06-15 17:51 UTC (permalink / raw)
  To: notmuch

* Tomi Ollila:

> First, it would be better if
>
> TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX")
>
> worked, then the behaviour on Linux would not change.

I'm trying to figure out if I can override $TMPDIR during the MacPorts
configure phase. According to the documentation, modifying environment
variables should work, but I am not quite there yet.

Corollary: I suggest we go for the method shown above for the time
being. I am not a fan of hardcoding paths either.

-Ralph

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

* Re: [PATCH] configure: fix mktemp call for macOS
  2019-06-15 17:51     ` [PATCH] configure: fix mktemp call for macOS Ralph Seichter
@ 2019-06-16 11:12       ` Tomi Ollila
  2019-06-16 15:18         ` Ralph Seichter
  0 siblings, 1 reply; 10+ messages in thread
From: Tomi Ollila @ 2019-06-16 11:12 UTC (permalink / raw)
  To: notmuch

On Sat, Jun 15 2019, Ralph Seichter wrote:

> * Tomi Ollila:
>
>> First, it would be better if
>>
>> TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX")
>>
>> worked, then the behaviour on Linux would not change.
>
> I'm trying to figure out if I can override $TMPDIR during the MacPorts
> configure phase. According to the documentation, modifying environment
> variables should work, but I am not quite there yet.
>
> Corollary: I suggest we go for the method shown above for the time
> being. I am not a fan of hardcoding paths either.

That maintains the status quo, so no-one needs to explain the change
in commit message.

SO I pre-LGTM anyone sending message containing the followin change:

+    if ! TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX"); then

Tomi


>
> -Ralph

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

* Re: [PATCH] configure: fix mktemp call for macOS
  2019-06-14 17:57     ` Tomi Ollila
  2019-06-14 18:11       ` Tomi Ollila
@ 2019-06-16 14:30       ` Daniel Kahn Gillmor
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel Kahn Gillmor @ 2019-06-16 14:30 UTC (permalink / raw)
  To: Tomi Ollila, Ralph Seichter, David Bremner, notmuch

[-- Attachment #1: Type: text/plain, Size: 537 bytes --]

On Fri 2019-06-14 20:57:07 +0300, Tomi Ollila wrote:

> Yes. $TMPDIR could be problematic if it makes the full (unix domain
> socket?) path be too long.

Modern, maintained version of GnuPG will only place sockets directly in
the $GNUPGHOME if /run/user/$(id -u) (i.e., $XDG_RUNTIME_DIR) is not
available.

I've just sent a message to gnupg-devel asking for help from upstream
there, this shouldn't be this complicated.  see
id:87blyxd2qu.fsf@fifthhorseman.net on gnupg-devel@gnupg.org ("safe
ephemeral GnuPG homdirs").

          --dkg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

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

* [PATCH] configure: fix mktemp call for macOS
  2019-06-16 11:12       ` Tomi Ollila
@ 2019-06-16 15:18         ` Ralph Seichter
  2019-06-17  5:10           ` David Bremner
  0 siblings, 1 reply; 10+ messages in thread
From: Ralph Seichter @ 2019-06-16 15:18 UTC (permalink / raw)
  To: notmuch

Add missing template to mktemp, as required by macOS / OS X.

Signed-off-by: Ralph Seichter <abbot@monksofcool.net>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 8b80f0e0..6e73b22e 100755
--- a/configure
+++ b/configure
@@ -529,7 +529,7 @@ int main () {
     return 0;
 }
 EOF
-    if ! TEMP_GPG=$(mktemp -d); then
+    if ! TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX"); then
         printf 'No.\nCould not make tempdir for testing session-key support.\n'
         errors=$((errors + 1))
     elif ${CC} ${CFLAGS} ${gmime_cflags} _check_session_keys.c ${gmime_ldflags} -o _check_session_keys \
-- 
2.22.0

(This obsoletes id:87r27z63uk.fsf@ra.horus-it.com)

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

* Re: [PATCH] configure: fix mktemp call for macOS
  2019-06-16 15:18         ` Ralph Seichter
@ 2019-06-17  5:10           ` David Bremner
  0 siblings, 0 replies; 10+ messages in thread
From: David Bremner @ 2019-06-17  5:10 UTC (permalink / raw)
  To: Ralph Seichter, notmuch

Ralph Seichter <abbot@monksofcool.net> writes:

> Add missing template to mktemp, as required by macOS / OS X.
>
> Signed-off-by: Ralph Seichter <abbot@monksofcool.net>
> ---

I've merged this to master and release. In the case that we do another
point release before 0.30, it will be in that.

d

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

end of thread, other threads:[~2019-06-17  5:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12  0:26 [PATCH] configure: fix mktemp call for macOS Ralph Seichter
2019-06-14 10:57 ` David Bremner
2019-06-14 11:19   ` Ralph Seichter
2019-06-14 17:57     ` Tomi Ollila
2019-06-14 18:11       ` Tomi Ollila
2019-06-16 14:30       ` Daniel Kahn Gillmor
     [not found] <CAC=HcsFwVdsxMeCLk9qZYeHbd_+qJN77EqPZ17S2UgdR0bb6mw@mail.gmail.com>
     [not found] ` <5d03ff8e.1c69fb81.c82a3.d08e.GMR@mx.google.com>
2019-06-14 20:16   ` Fwd: Delivery Status Notification (Failure) Tomi Ollila
2019-06-15 17:51     ` [PATCH] configure: fix mktemp call for macOS Ralph Seichter
2019-06-16 11:12       ` Tomi Ollila
2019-06-16 15:18         ` Ralph Seichter
2019-06-17  5:10           ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.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).