Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 625268

Summary: dev-libs/xapian-bindings-1.4.4 : php7/xapian_wrap.cc:1096:27: error: xapian_globals was not declared in this scope
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: CONFIRMED ---    
Severity: normal CC: knoeferl, mattst88, sam, whissi
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 669794    
Attachments: emerge-info.txt
dev-libs:xapian-bindings-1.4.4:20170716-010029.log.bz2
emerge-history.txt
environment
etc.portage.tbz2
logs.tbz2
temp.tbz2
PHP_TARGETS="php7-1" USE="php cli" emerge =dev-libs/xapian-bindings-1.4.7
PHP_TARGETS="php7-2" USE="php cli" emerge =dev-libs/xapian-bindings-1.4.7

Description Toralf Förster gentoo-dev 2017-07-16 08:03:25 UTC
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/lib64/php7.1/include/php -I/usr/lib64/php7.1/include/php/main -I/usr/lib64/php7.1/include/php/TSRM -I/usr/lib64/php7.1/include/php/Zend -I/usr/lib64/php7.1/include/php/ext -I/usr/lib64/php7.1/include/php/ext/date/lib -fno-strict-aliasing -Wall -Wno-unused -Wno-uninitialized -fvisibility=hidden -Werror=terminate -O2 -pipe -march=native -c php7/xapian_wrap.cc  -fPIC -DPIC -o php7/.libs/xapian_wrap.o
php7/xapian_wrap.cc: In function ‘void SWIG_FAIL()’:
php7/xapian_wrap.cc:1096:27: error: ‘xapian_globals’ was not declared in this scope
 #define SWIG_ErrorCode() (xapian_globals.error_code)
                           ^
php7/xapian_wrap.cc:1102:16: note: in expansion of macro ‘SWIG_ErrorCode’

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 13.0-desktop-gnome_abi32+64_20170706-200324

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-6.3.0 *

Available Python interpreters, in order of preference:
  [1]   python3.4
  [2]   python2.7 (fallback)
  [3]   pypy3 (fallback)
  [4]   pypy (fallback)
  [5]   jython2.7 (fallback)
Available Ruby profiles:
  [1]   ruby21 (with Rubygems) *
  [2]   ruby22 (with Rubygems)
java-config:
The following VMs are available for generation-2:
*)	IcedTea JDK 3.4.0 [icedtea-bin-8]
2)	IcedTea JDK 3.4.0 (x86) [icedtea-bin-8-x86]
Available Java Virtual Machines:
  [1]   icedtea-bin-8  system-vm
  [2]   icedtea-bin-8-x86
Comment 1 Toralf Förster gentoo-dev 2017-07-16 08:03:29 UTC
Created attachment 484960 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2017-07-16 08:03:32 UTC
Created attachment 484962 [details]
dev-libs:xapian-bindings-1.4.4:20170716-010029.log.bz2
Comment 3 Toralf Förster gentoo-dev 2017-07-16 08:03:36 UTC
Created attachment 484964 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2017-07-16 08:03:39 UTC
Created attachment 484966 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2017-07-16 08:03:42 UTC
Created attachment 484968 [details]
etc.portage.tbz2
Comment 6 Toralf Förster gentoo-dev 2017-07-16 08:03:46 UTC
Created attachment 484970 [details]
logs.tbz2
Comment 7 Toralf Förster gentoo-dev 2017-07-16 08:03:49 UTC
Created attachment 484972 [details]
temp.tbz2
Comment 8 HKnoeferl 2017-10-22 11:27:44 UTC
IS there a known workaround for this issue?
I am running iinto same problem and don't know how solve it.
Comment 9 Thomas Deutschmann (RETIRED) gentoo-dev 2018-10-28 21:14:13 UTC
Still happening with 1.4.7 on x86.
Comment 10 Matt Turner gentoo-dev 2019-02-06 06:20:59 UTC
(In reply to HKnoeferl from comment #8)
> IS there a known workaround for this issue?
> I am running iinto same problem and don't know how solve it.

Build with USE=-php.
Comment 11 Matt Turner gentoo-dev 2019-02-06 06:26:13 UTC
*** Bug 660488 has been marked as a duplicate of this bug. ***
Comment 12 Anthony Basile gentoo-dev 2019-02-06 10:53:29 UTC
Created attachment 563908 [details]
PHP_TARGETS="php7-1" USE="php cli" emerge =dev-libs/xapian-bindings-1.4.7
Comment 13 Anthony Basile gentoo-dev 2019-02-06 10:54:46 UTC
Created attachment 563910 [details]
PHP_TARGETS="php7-2" USE="php cli" emerge =dev-libs/xapian-bindings-1.4.7
Comment 14 Anthony Basile gentoo-dev 2019-02-06 10:55:10 UTC
@whissi @mattst

I'm going to need you're help here because I'm not sure why this "just works" for me.  Both of the following built fine on amd64:

1) PHP_TARGETS="php7-1" USE="php cli" emerge =dev-libs/xapian-bindings-1.4.7

2) PHP_TARGETS="php7-2" USE="php cli" emerge =dev-libs/xapian-bindings-1.4.7

I thought it was an arch dependent problem, but matt says he can reproduce it on amd64.

See the attached logs.
Comment 15 Thomas Deutschmann (RETIRED) gentoo-dev 2019-02-06 21:00:31 UTC
I cannot reproduce on ~amd64 but still on x86.
Comment 16 Matt Turner gentoo-dev 2019-02-09 23:41:00 UTC
(In reply to Anthony Basile from comment #14)
> @whissi @mattst
> 
> I'm going to need you're help here because I'm not sure why this "just
> works" for me.  Both of the following built fine on amd64:

Sometimes it's best to just look at the code. The code that causes the compile failure is php7/php7/xapian_wrap.cc around line 1096:

ZEND_BEGIN_MODULE_GLOBALS(xapian)
const char *error_msg;
int error_code;
ZEND_END_MODULE_GLOBALS(xapian)
ZEND_DECLARE_MODULE_GLOBALS(xapian)
#define SWIG_ErrorMsg() (xapian_globals.error_msg)
#define SWIG_ErrorCode() (xapian_globals.error_code)

I glanced in the php5 version of the code, and it contains

#ifdef ZTS
#define SWIG_ErrorMsg() TSRMG(xapian_globals_id, zend_xapian_globals *, error_msg )
#define SWIG_ErrorCode() TSRMG(xapian_globals_id, zend_xapian_globals *, error_code )
#else
#define SWIG_ErrorMsg() (xapian_globals.error_msg)
#define SWIG_ErrorCode() (xapian_globals.error_code)
#endif

which made me wonder what ZTS stood for. Evidently it's "Zend Thread Safety".

In /usr/lib64/php7.2/include/php/Zend/zend_API.h there's an #ifdef ZTS immediately before the definition of the macro ZEND_DECLARE_MODULE_GLOBALS (previously seen immediately before our code in xapian that causes the compile error).

Sure enough, building php with USE=-threads allows xapian-bindings to build for me. I see Toralf has USE=threads.

I assume that you have USE=-threads and therefore are not seeing the error.
Comment 17 Anthony Basile gentoo-dev 2019-02-12 00:32:31 UTC
(In reply to Matt Turner from comment #16)
> (In reply to Anthony Basile from comment #14)
> > @whissi @mattst
> > 
> > I'm going to need you're help here because I'm not sure why this "just
> > works" for me.  Both of the following built fine on amd64:
> 
> Sometimes it's best to just look at the code. The code that causes the
> compile failure is php7/php7/xapian_wrap.cc around line 1096:
> 

okay i've confirmed this (thanks!).  i don't want to force USE=-threads for php if someone needs php bindings for xapian.  i'll either try to come up with a patch myself or talk to upstream about it.
Comment 18 Anthony Basile gentoo-dev 2019-02-23 16:57:20 UTC
(In reply to Matt Turner from comment #16)
> I assume that you have USE=-threads and therefore are not seeing the error.

Until upstream address this, I've forced dependence on php[-threads].
Comment 19 Anthony Basile gentoo-dev 2019-03-15 15:10:29 UTC
(In reply to Anthony Basile from comment #18)
> (In reply to Matt Turner from comment #16)
> > I assume that you have USE=-threads and therefore are not seeing the error.
> 
> Until upstream address this, I've forced dependence on php[-threads].

I forwarded my fix to 1.4.11.  So its the next candidate for stabilization.
Comment 20 Matt Turner gentoo-dev 2019-08-19 04:40:51 UTC
(In reply to Anthony Basile from comment #19)
> (In reply to Anthony Basile from comment #18)
> > (In reply to Matt Turner from comment #16)
> > > I assume that you have USE=-threads and therefore are not seeing the error.
> > 
> > Until upstream address this, I've forced dependence on php[-threads].
> 
> I forwarded my fix to 1.4.11.  So its the next candidate for stabilization.

Did your fix make it in? Did it make it into 1.4.11? I still see the dependency on php[threads] in 1.4.11.ebuild.
Comment 21 Anthony Basile gentoo-dev 2019-08-19 15:04:12 UTC
(In reply to Matt Turner from comment #20)
> (In reply to Anthony Basile from comment #19)
> > (In reply to Anthony Basile from comment #18)
> > > (In reply to Matt Turner from comment #16)
> > > > I assume that you have USE=-threads and therefore are not seeing the error.
> > > 
> > > Until upstream address this, I've forced dependence on php[-threads].
> > 
> > I forwarded my fix to 1.4.11.  So its the next candidate for stabilization.
> 
> Did your fix make it in? Did it make it into 1.4.11? I still see the
> dependency on php[threads] in 1.4.11.ebuild.

How are you getting that?  Here's what I see in the ebuild (I checked on a couple of machines):

    php? ( dev-lang/php:=[-threads] )

That's in COMMONDEPEND which is included in DEPEND and RDEPEND.
Comment 22 Matt Turner gentoo-dev 2019-08-19 20:59:02 UTC
(In reply to Anthony Basile from comment #21)
> (In reply to Matt Turner from comment #20)
> > (In reply to Anthony Basile from comment #19)
> > > (In reply to Anthony Basile from comment #18)
> > > > (In reply to Matt Turner from comment #16)
> > > > > I assume that you have USE=-threads and therefore are not seeing the error.
> > > > 
> > > > Until upstream address this, I've forced dependence on php[-threads].
> > > 
> > > I forwarded my fix to 1.4.11.  So its the next candidate for stabilization.
> > 
> > Did your fix make it in? Did it make it into 1.4.11? I still see the
> > dependency on php[threads] in 1.4.11.ebuild.
> 
> How are you getting that?  Here's what I see in the ebuild (I checked on a
> couple of machines):
> 
>     php? ( dev-lang/php:=[-threads] )
> 
> That's in COMMONDEPEND which is included in DEPEND and RDEPEND.

Sorry, right, I meant php[-threads].

Did you submit a fix upstream? Where is the patch/bug report?
Comment 23 Anthony Basile gentoo-dev 2019-08-21 18:14:52 UTC
(In reply to Matt Turner from comment #22)
> (In reply to Anthony Basile from comment #21)
> > (In reply to Matt Turner from comment #20)
> > > (In reply to Anthony Basile from comment #19)
> > > > (In reply to Anthony Basile from comment #18)
> > > > > (In reply to Matt Turner from comment #16)
> > > > > > I assume that you have USE=-threads and therefore are not seeing the error.
> > > > > 
> > > > > Until upstream address this, I've forced dependence on php[-threads].
> > > > 
> > > > I forwarded my fix to 1.4.11.  So its the next candidate for stabilization.
> > > 
> > > Did your fix make it in? Did it make it into 1.4.11? I still see the
> > > dependency on php[threads] in 1.4.11.ebuild.
> > 
> > How are you getting that?  Here's what I see in the ebuild (I checked on a
> > couple of machines):
> > 
> >     php? ( dev-lang/php:=[-threads] )
> > 
> > That's in COMMONDEPEND which is included in DEPEND and RDEPEND.
> 
> Sorry, right, I meant php[-threads].
> 
> Did you submit a fix upstream? Where is the patch/bug report?

I spoke with upstream and the problem should be fixed in 1.4.12 which I just added to the tree.

Here's how I tested:

1) started with the latest stage3-amd64

2) i installed php[-threads]

3) i installed xapian-1.4.12 + xapian-bindings-1.4.12[php] - no problem

3) i reinstalled php[+threads]

4) i reinstalled xapian-bindings-1.4.12[php] - no problem

I'd appreciate testing.
Comment 24 Toralf Förster gentoo-dev 2019-08-21 20:13:29 UTC
Currently it passes 3 images.

But 2 of them does not have php in the USE flags
The 3rd has USE="php" with php[-threads] where this package builds fine too.

I did not change manually the USE flags at a tinderbox after setup usually.
Comment 25 cbi 2021-06-12 12:19:35 UTC
@AnthonyB

Is any work-around to use xapian-bindings-1.4.17 (amd64) on php7-4 CLI with switch +threads ??