Re: [PATCH v2] fix out of tree build

2016-11-20 Thread Tomi Ollila
On Sun, Nov 20 2016, David Bremner  wrote:

> Tomi Ollila  writes:
>
>> With working tests.
>> ---
>>
>> This is v2 of id:1479066903-28310-1-git-send-email-tomi.oll...@iki.fi
>>
>> with this ${srcdir} being absolute path will also work (relevant in tests!)
>>
>> ... and commit message is fixed: I accuse qt for "shadow build" ;)
>>
>> Out of tree builds breaks every now and then; perhaps it is broken less
>> often in the future as I plan to start doing my "production" builds
>> out of tree...
>
> Hi Tomi;
>
> Did you test this with ruby-dev installed? for me out-of-tree-build
> fails with your patch with

Hi David;

Thanks for testing this.

I (must confess I) did not test with ruby-dev installed...

... now I installed 'ruby-dev' *and* 'ruby' to my test debian:8.6
container -- and got exactly the same problem.

I tried to "trivial" change and added (*)

   cp -a "$srcdir"/bindings/ruby bindings

to ./configure


(*) the '-a' option is supported by at least linux, freebsd & macos
cp command, but not by solaris 10 cp. tough for solaris users ;(

next it fails

  make -C bindings/ruby
  make[1]: Entering directory
  '/home/too/tmp/nm-docker-tst/twd-notmuch-too-8.6/bindings/ruby'
  compiling messages.c
  In file included from messages.c:21:0:
  defs.h:24:21: fatal error: notmuch.h: No such file or directory
   #include 

I looked a bit of the generated bindings/ruby/Makefile and did not
find out a "SMOP" solution (P meaning 'patching' this time). Also
it *looks to me that* building ruby bindings out-of-tree has never
worked...

Anyway, this makes my bold statement: 'With working tests.' false.

On IRC you asked whether out of tree build is documented. at least
command:
 grep -nIri out.*of.*tree notmuch notmuch-wiki

doesn't print any relevant matches.


The patch is useful but in this light I drop my suggestion to add
it to next 0.23.x release. I'll work on the commit message so
it could be added to master later...

... I am (slowly) creating a tool that runs (notmuch) tests
(in parallel!) in containers: debian:7.11, debian:8.6,
ubuntu:14.04.5, ubuntu:16.04, fedora:24 and debian:unstable.
Out-of-tree builds makes setupping build directories
(from same source directory) easier.


Tomi


> cd bindings/ruby && \
>   EXTRA_LDFLAGS="-Wl,--no-undefined" \
>   LIBNOTMUCH="../../lib/libnotmuch.so" \
>   ruby extconf.rb --vendor
> /bin/sh: 1: cd: can't cd to bindings/ruby
> bindings/Makefile.local:8: recipe for target 'ruby-bindings' failed
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v2] fix out of tree build

2016-11-19 Thread David Bremner
Tomi Ollila  writes:

> With working tests.
> ---
>
> This is v2 of id:1479066903-28310-1-git-send-email-tomi.oll...@iki.fi
>
> with this ${srcdir} being absolute path will also work (relevant in tests!)
>
> ... and commit message is fixed: I accuse qt for "shadow build" ;)
>
> Out of tree builds breaks every now and then; perhaps it is broken less
> often in the future as I plan to start doing my "production" builds
> out of tree...

Hi Tomi;

Did you test this with ruby-dev installed? for me out-of-tree-build
fails with your patch with

cd bindings/ruby && \
EXTRA_LDFLAGS="-Wl,--no-undefined" \
LIBNOTMUCH="../../lib/libnotmuch.so" \
ruby extconf.rb --vendor
/bin/sh: 1: cd: can't cd to bindings/ruby
bindings/Makefile.local:8: recipe for target 'ruby-bindings' failed
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH v2] fix out of tree build

2016-11-14 Thread Tomi Ollila
With working tests.
---

This is v2 of id:1479066903-28310-1-git-send-email-tomi.oll...@iki.fi

with this ${srcdir} being absolute path will also work (relevant in tests!)

... and commit message is fixed: I accuse qt for "shadow build" ;)

Out of tree builds breaks every now and then; perhaps it is broken less
often in the future as I plan to start doing my "production" builds
out of tree...

 configure   | 6 --
 test/test-lib-common.sh | 7 +++
 test/test-lib.sh| 6 +++---
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 2a0ce9e..8174383 100755
--- a/configure
+++ b/configure
@@ -342,8 +342,8 @@ int main(void) {
 return 0;
 }
 EOF
-if ${CC} ${CFLAGS} _libversion.c -o _libversion > /dev/null 2>&1 && \
-   ./_libversion > _libversion.sh && . ./_libversion.sh
+if ${CC} ${CFLAGS} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
+   && ./_libversion > _libversion.sh && . ./_libversion.sh
 then
 printf "OK.\n"
 else
@@ -1158,6 +1158,8 @@ cat > sh.config < OUTPUT
 }
 
 test_ruby() {
-MAIL_DIR=$MAIL_DIR ruby -I $TEST_DIRECTORY/../bindings/ruby> OUTPUT
+MAIL_DIR=$MAIL_DIR ruby -I $SOURCE_DIRECTORY/bindings/ruby> OUTPUT
 }
 
 test_C () {
 exec_file="test${test_count}"
 test_file="${exec_file}.c"
 cat > ${test_file}
-${TEST_CC} ${TEST_CFLAGS} -I${TEST_DIRECTORY} -I${TEST_DIRECTORY}/../lib 
-o ${exec_file} ${test_file} -L${TEST_DIRECTORY}/../lib/ -lnotmuch -ltalloc
+${TEST_CC} ${TEST_CFLAGS} -I${TEST_DIRECTORY} -I${SOURCE_DIRECTORY}/lib -o 
${exec_file} ${test_file} -L${TEST_DIRECTORY}/../lib/ -lnotmuch -ltalloc
 echo "== stdout ==" > OUTPUT.stdout
 echo "== stderr ==" > OUTPUT.stderr
 ./${exec_file} "$@" 1>>OUTPUT.stdout 2>>OUTPUT.stderr
-- 
2.7.4

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch