Bug#874217: rlwrap FTCBFS: /proc//cwd check not cacheable

2018-02-23 Thread Mike Miller
On Mon, Sep 04, 2017 at 12:17:12 +0200, Helmut Grohne wrote:
> rlwrap fails to cross build from source, because it uses an uncacheable
> AC_CHECK_FILES where the cache variable contains the process id of
> ./configure. After thinking about it, I figured that replacing
> "/proc/$$" with "/proc/self" would be a reasonable compromise making the
> cache variable predictable. Thus it can be provided with a cross build.
> When using the attached patch and providing
> ac_cv_file__proc_self_cwd_cwdcheck (yes for linux-any and kfreebsd-any,
> no for hurd-any), rlwrap cross build successfully. Please consider
> applying the patch.

Thank you for taking the time to write a patch for this problem. In
working on packaging the latest upstream release, I've noticed that the
configure script has diverged from the affected code.

With the 0.43 release (uploading soon to unstable), it should be
possible to cross-build by defining ENABLE_MIRROR_ARGS on linux-any and
kfreebsd-any.

-- 
mike


signature.asc
Description: PGP signature


Bug#874217: rlwrap FTCBFS: /proc//cwd check not cacheable

2017-09-04 Thread Helmut Grohne
Source: rlwrap
Version: 0.42-3
Severity: normal
Tags: patch upstream
User: helm...@debian.org
Usertags: rebootstrap

rlwrap fails to cross build from source, because it uses an uncacheable
AC_CHECK_FILES where the cache variable contains the process id of
./configure. After thinking about it, I figured that replacing
"/proc/$$" with "/proc/self" would be a reasonable compromise making the
cache variable predictable. Thus it can be provided with a cross build.
When using the attached patch and providing
ac_cv_file__proc_self_cwd_cwdcheck (yes for linux-any and kfreebsd-any,
no for hurd-any), rlwrap cross build successfully. Please consider
applying the patch.

Helmut
From: Helmut Grohne 
Subject: make cross building feasible

The file chosen has two problems:
 * $$ varies across builds, so the variable essentially is not cacheable, but
   AC_CHECK_FILES must be cacheable for cross compilation.
 * configure.ac may not be present for out-of-tree builds. Create a file to
   be sure it actually exists.

Index: rlwrap-0.42/configure.ac
===
--- rlwrap-0.42.orig/configure.ac
+++ rlwrap-0.42/configure.ac
@@ -349,10 +349,12 @@
 # but they wil fail unless /no is a procfs mountpoint ;-)
 
 echo "Will rlwrap find command's working directory under ${opt_proc_mountpoint}//cwd? let's see..." 
-AC_CHECK_FILES($opt_proc_mountpoint/$$/cwd/configure.ac,[  
+touch cwdcheck
+AC_CHECK_FILES($opt_proc_mountpoint/self/cwd/cwdcheck,[
  AC_DEFINE(HAVE_PROC_PID_CWD, 1 ,[Define to 1 if //cwd is a link to working directory of process ]) 
  AC_SUBST(HAVE_PROC_PID_CWD,[yes])
   ],[AC_SUBST(HAVE_PROC_PID_CWD,[no])])
+rm -f $cwdcheck
 
 
 AC_DEFINE_UNQUOTED(PROC_MOUNTPOINT, "[$opt_proc_mountpoint]", [Define to location of Linux-style procfs mountpoint if provided and valid])