public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Matthieu Vachon <matthieu.o.vachon@gmail.com>
To: "kawa@sourceware.org" <kawa@sourceware.org>
Subject: Re: Compilation (make) problem
Date: Sat, 21 Sep 2013 06:05:00 -0000	[thread overview]
Message-ID: <CAOTvmomrgwrGN6d+rmVVgiwOQHgu-5Lmbi=DcNpfdfXn95trNw@mail.gmail.com> (raw)
In-Reply-To: <523CA79E.3000705@bothner.com>

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

Ok, I understand what was my problem. In the `bin/` folder I had a
directory named `tmp`. This was collapsing with target that was trying
to create a tmp file with name `tmp`. Since I had the directory, make
was not happy. I don't know where the `tmp` folder was coming from
tough.

I attached a patch that now use a more specific tmp file instead of
`tmp`. Feel free to include it or not since there is no real bug in
the Makefile.

Regards,
Matt

On Fri, Sep 20, 2013 at 3:53 PM, Per Bothner <per@bothner.com> wrote:
> On 09/20/2013 11:51 AM, Matthieu Vachon wrote:
>>
>> When arriving at this Makefile, the build failed saying that `tmp` is
>> a folder and cannot be written to. This problem comes from this line
>> in the Makefile (there is more that one instance):
>>
>>      echo '#!/bin/sh' >tmp
>> ...
>>
>> What would be the right fix for this problem?
>
>
> The testsuite mostly uses names that *start* with tmp,
> such as tmp.out or tmp-knucleotide1.log.
>
> Using the tmp.xxx form is compatible with the mktemp
> command, but it is conceivable some filesystems (like FAT)
> would have problems (but they would probably have problems
> regardless), so perhaps the tmp-xxx form is preferable.
>
> So for gckawa instead of tmp maybe use tmp-gckawa.
>
> The CLEANFILES macro would need to be updated,
> presumably to tmp-*.
> --
>         --Per Bothner
> per@bothner.com   http://per.bothner.com/

[-- Attachment #2: feature-minimize-tmpfile-collision.patch --]
[-- Type: application/octet-stream, Size: 6140 bytes --]

Index: Makefile.am
===================================================================
--- Makefile.am	(revision 7600)
+++ Makefile.am	 (working copy)
@@ -117,7 +117,7 @@ EXTRA_DIST = debian/control debian/rules debian/changelog debian/dirs \
   gnu/jemacs/jar-manifest gnu/jemacs/status.html \
   kawa/Version.java jar-manifest Make-rules classes-to-skip-for-runtime
 
-MOSTLYCLEANFILES = tmp *.o kawa1$(exeext) *.stamp classes.list classes-rt.list
+MOSTLYCLEANFILES = tmp* *.o kawa1$(exeext) *.stamp classes.list classes-rt.list
 CLEANFILES = *.jar kawa/Version.java $(META_ScriptEngineFactory)
 DISTCLEANFILES = selected-java-source
 
Index: bin/Makefile.am
===================================================================
--- bin/Makefile.am	(revision 7600)
+++ bin/Makefile.am	 (working copy)
@@ -83,42 +83,42 @@ EXTRA_LIB_SERVLET = -l-javax-servlet
 endif
 
 kawa.sh:
-	echo '#!/bin/sh' >tmp
-	echo 'thisfile=`which $$0`' >>tmp
-	echo 'thisdir=`dirname $$thisfile`' >>tmp
+	echo '#!/bin/sh' >tmp-kawa.sh.out
+	echo 'thisfile=`which $$0`' >>tmp-kawa.sh.out
+	echo 'thisdir=`dirname $$thisfile`' >>tmp-kawa.sh.out
 if ENABLE_KAWA_FRONTEND
 # In this case kawa.sh is only used for pre-install testing.
 # We don't need to set KAWALIB, since kawapath.c looks for it in "..".
-	echo 'LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$$thisdir' >>tmp
-	echo 'export LD_LIBRARY_PATH' >>tmp
-	echo 'exec $$thisdir/kawa "$$@"' >>tmp
+	echo 'LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$$thisdir' >>tmp-kawa.sh.out
+	echo 'export LD_LIBRARY_PATH' >>tmp-kawa.sh.out
+	echo 'exec $$thisdir/kawa "$$@"' >>tmp-kawa.sh.out
 else
 if WITH_GCJ_NO_DBTOOL
-	echo 'LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$$thisdir:$(libdir)' >>tmp
-	echo 'export LD_LIBRARY_PATH' >>tmp
-	echo 'exec $$thisdir/kawa-bin "$$@"' >>tmp
+	echo 'LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$$thisdir:$(libdir)' >>tmp-kawa.sh.out
+	echo 'export LD_LIBRARY_PATH' >>tmp-kawa.sh.out
+	echo 'exec $$thisdir/kawa-bin "$$@"' >>tmp-kawa.sh.out
 else
-	echo 'if test -f $$thisdir/../$(KAWAJAR)' >>tmp
-	echo 'then KAWALIB=$${KAWALIB-"`$(CYGPATH_W) "$$thisdir/../$(KAWAJAR)"`"}' >>tmp
-	echo 'else KAWALIB=$${KAWALIB-$(KAWALIB)}; fi' >>tmp
-	echo 'CLASSPATH="$${KAWALIB}$(CLASSPATH_SEPARATOR)$(conf_classpath)$${CLASSPATH-$(CLASSPATH)}"' >>tmp
-	echo 'export CLASSPATH' >>tmp
+	echo 'if test -f $$thisdir/../$(KAWAJAR)' >>tmp-kawa.sh.out
+	echo 'then KAWALIB=$${KAWALIB-"`$(CYGPATH_W) "$$thisdir/../$(KAWAJAR)"`"}' >>tmp-kawa.sh.out
+	echo 'else KAWALIB=$${KAWALIB-$(KAWALIB)}; fi' >>tmp-kawa.sh.out
+	echo 'CLASSPATH="$${KAWALIB}$(CLASSPATH_SEPARATOR)$(conf_classpath)$${CLASSPATH-$(CLASSPATH)}"' >>tmp-kawa.sh.out
+	echo 'export CLASSPATH' >>tmp-kawa.sh.out
 	if JAVA=`which $(JAVA)`; then true; else JAVA=$(JAVA); fi; \
-	  echo 'exec $${JAVA-"'$${JAVA}'"} kawa.repl "$$@"' >>tmp
+	  echo 'exec $${JAVA-"'$${JAVA}'"} kawa.repl "$$@"' >>tmp-kawa.sh.out
 endif
 endif
-	chmod +x tmp
-	mv tmp kawa.sh
+	chmod +x tmp-kawa.sh.out
+	mv tmp-kawa.sh.out kawa.sh
 
 gckawa: Makefile
-	echo '#!/bin/sh' >tmp
-	echo 'LD_LIBRARY_PATH=$(libdir):$$LD_LIBRARY_PATH' >>tmp
-	echo 'KAWALIB=$${KAWALIB-$(KAWALIB)}' >>tmp
-	echo 'CLASSPATH=$${KAWALIB}:$${CLASSPATH-$(CLASSPATH)}' >>tmp
-	echo 'export CLASSPATH LD_LIBRARY_PATH' >>tmp
-	echo 'exec gcj $(EXTRA_GCJFLAGS) "$$@" -L$(libdir) $(LDFLAGS_DBTOOL) -lkawa' >>tmp
-	chmod +x tmp
-	mv tmp gckawa
+	echo '#!/bin/sh' >tmp-gckawa.out
+	echo 'LD_LIBRARY_PATH=$(libdir):$$LD_LIBRARY_PATH' >>tmp-gckawa.out
+	echo 'KAWALIB=$${KAWALIB-$(KAWALIB)}' >>tmp-gckawa.out
+	echo 'CLASSPATH=$${KAWALIB}:$${CLASSPATH-$(CLASSPATH)}' >>tmp-gckawa.out
+	echo 'export CLASSPATH LD_LIBRARY_PATH' >>tmp-gckawa.out
+	echo 'exec gcj $(EXTRA_GCJFLAGS) "$$@" -L$(libdir) $(LDFLAGS_DBTOOL) -lkawa' >>tmp-gckawa.out
+	chmod +x tmp-gckawa.out
+	mv tmp-gckawa.out gckawa
 
 kawa.bat: $(srcdir)/kawa.bat.in
 	sed -e 's|%DEFAULT_KAWA_VERSION%|$(VERSION)|' \
@@ -126,23 +126,23 @@ kawa.bat: $(srcdir)/kawa.bat.in
 	  <$(srcdir)/kawa.bat.in > kawa.bat
 
 qexo:
-	echo '#!/bin/sh' >tmp
-	echo 'case $$0 in' >>tmp
-	echo '  */qexo)' >>tmp
-	echo '    kawa=`echo $$0 | sed -e '"'"'s|qexo$$|kawa|'"'"'`' >>tmp
-	echo '    if test -x $$kawa.sh; then' >>tmp
-	echo '      kawa=$$kawa.sh' >>tmp
-	echo '    elif test -x $$kawa; then true' >>tmp
-	echo '    else' >>tmp
-	echo '      kawa="kawa"' >>tmp
-	echo '    fi' >>tmp
-	echo '  ;;' >>tmp
-	echo '  *)' >>tmp
-	echo '    kawa="kawa";' >>tmp
-	echo 'esac' >>tmp
-	echo 'exec $$kawa --xquery "$$@"' >>tmp
-	chmod +x tmp
-	mv tmp qexo
+	echo '#!/bin/sh' >tmp-qexo.out
+	echo 'case $$0 in' >>tmp-qexo.out
+	echo '  */qexo)' >>tmp-qexo.out
+	echo '    kawa=`echo $$0 | sed -e '"'"'s|qexo$$|kawa|'"'"'`' >>tmp-qexo.out
+	echo '    if test -x $$kawa.sh; then' >>tmp-qexo.out
+	echo '      kawa=$$kawa.sh' >>tmp-qexo.out
+	echo '    elif test -x $$kawa; then true' >>tmp-qexo.out
+	echo '    else' >>tmp-qexo.out
+	echo '      kawa="kawa"' >>tmp-qexo.out
+	echo '    fi' >>tmp-qexo.out
+	echo '  ;;' >>tmp-qexo.out
+	echo '  *)' >>tmp-qexo.out
+	echo '    kawa="kawa";' >>tmp-qexo.out
+	echo 'esac' >>tmp-qexo.out
+	echo 'exec $$kawa --xquery "$$@"' >>tmp-qexo.out
+	chmod +x tmp-qexo.out
+	mv tmp-qexo.out qexo
 
 gnu-commonlisp-lang$(OEXT):
 	cd ../gnu/commonlisp/lang && $(MAKE)
Index: doc/Makefile.am
===================================================================
--- doc/Makefile.am	(revision 7600)
+++ doc/Makefile.am	 (working copy)
@@ -23,18 +23,18 @@ TEXI2PDF = texi2pdf
 
 man_MANS = kawa.1 qexo.1
 kawa.1: $(srcdir)/kawa.man
-	nroff -man $(srcdir)/kawa.man > kawa1.tmp
-	mv kawa1.tmp kawa.1
+	nroff -man $(srcdir)/kawa.man > tpm-kawa.1.out
+	mv tpm-kawa.1.out kawa.1
 
 qexo.1: $(srcdir)/qexo.man
-	nroff -man $(srcdir)/qexo.man > qexo1.tmp
-	mv qexo1.tmp qexo.1
+	nroff -man $(srcdir)/qexo.man > tpm-qexo1.out
+	mv tpm-qexo1.out qexo.1
 
 ../kawa-doc-$(VERSION).tar.gz: kawa/index.html kawa.pdf
 	tar cf - kawa/*.html kawa.pdf|gzip -c --best >$@
 
 clean-local:
-	-rm -rf $(KAWA_HTMLDIR) kawa1.tmp kawa.1 qexo.1
+	-rm -rf $(KAWA_HTMLDIR) tpm-qexo1.out tpm-qexo1.out kawa.1 qexo.1
 
 EXTRA_DIST = scm2java.html kawa.man qexo.man mdate-sh
 info_TEXINFOS = kawa.texi

      reply	other threads:[~2013-09-21  6:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20 18:51 Matthieu Vachon
2013-09-20 19:53 ` Per Bothner
2013-09-21  6:05   ` Matthieu Vachon [this message]

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='CAOTvmomrgwrGN6d+rmVVgiwOQHgu-5Lmbi=DcNpfdfXn95trNw@mail.gmail.com' \
    --to=matthieu.o.vachon@gmail.com \
    --cc=kawa@sourceware.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.
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).