bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

test-framework-sh: Don't leave temporary directories on NetBSD.


From: Collin Funk
Subject: test-framework-sh: Don't leave temporary directories on NetBSD.
Date: Sat, 08 Jun 2024 03:19:28 -0700
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Paul, Jim,

A few years ago Paul removed '-t' from mktemp to accommodate NetBSD [1].
The change was then reverted since Jim preferred the directory name
created with -t. The issue arrives again because although it "works" it
silently litters /tmp with empty directories.

Here is an example on NetBSD 10.0:

     $ gnulib-tool --create-testdir --dir testdir1 localeconv
     $ cd testdir1
     $ ./configure
     $ make check
     $ ls /tmp
     gnulib-python-cache-collin  ssh-6fF5RmMxl5Rr  ssh-y2OL0VTqIZcc
     $ ls /tmp/
     -p.Aa9x3xH3  -p.QDECT3St  gnulib-python-cache-collin  ssh-6fF5RmMxl5Rr  
ssh-y2OL0VTqIZcc

Originally I thought that this was due to GNU getopt rearranging options
or something, since I don't think NetBSD does that. However, it looks
like NetBSD creates two directories and the first one is ignored by the
test framework. Here is before and after removing '-t' and using
"set -x" at the top of init.sh (NetBSD):

    # Before:
    unset TMPDIR
    using redirections: 2>/dev/null do {
    d='/tmp/-p.COeKGNtW
    gt-test-init.sh.74sa'

    # After:
    unset TMPDIR
    using redirections: 2>/dev/null do {
    d=/home/collin/.local/src/gnulib/testdir1/gltests/gt-test-init.sh.5ii7

So the removal of '-t' fixes things on NetBSD. Here is the names created
before and after removing '-t' with Coreutils 9.5:

    # Before:
    d=/home/collin/.local/src/gnulib/testdir1/gltests/gt-test-init.sh.cx71

    # After:
    d=/home/collin/.local/src/gnulib/testdir1/gltests/gt-test-init.sh.ma3i

I don't see a difference, but I am not very familiar with mktemp so
perhaps I am missing something. I've gone ahead and committed this to
solve the issue but feel free to change it with this added information.

Collin

[1] https://lists.gnu.org/archive/html/bug-gnulib/2016-03/msg00071.html

Attachment: 0001-test-framework-sh-Don-t-leave-temporary-directories-.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]