Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurs during the installation of opentelemetry using pecl. #1283

Closed
nalcoder0913 opened this issue Apr 22, 2024 · 7 comments · Fixed by open-telemetry/opentelemetry-php-instrumentation#143
Labels
bug Something isn't working

Comments

@nalcoder0913
Copy link

Describe your environment
$ pear version
PEAR Version: 1.10.15
PHP Version: 8.1.28
Zend Engine Version: 4.1.28

$ sw_vers
ProductName: macOS
ProductVersion: 13.3
BuildVersion: 22E252

etc.
gcc 13.2.0
make 4.4.1
autoconf 2.72
(I installed gcc make autoconf using homebrew)

Steps to reproduce

$ pecl install opentelemetry

What is the expected behavior?

installation of the opentelemetry extension.

What is the actual behavior?

running: make
/bin/sh /private/tmp/pear/temp/pear-build-nalcoderj0mc5u/opentelemetry-1.0.2/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/opentelemetry -I/private/tmp/pear/temp/pear-build-nalcoderj0mc5u/opentelemetry-1.0.2/include -I/private/tmp/pear/temp/pear-build-nalcoderj0mc5u/opentelemetry-1.0.2/main -I/private/tmp/pear/temp/opentelemetry -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/main -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/TSRM -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/Zend -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -Wextra -Werror -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/opentelemetry/opentelemetry.c -o opentelemetry.lo -MMD -MF opentelemetry.dep -MT opentelemetry.lo
mkdir .libs
cc -I. -I/private/tmp/pear/temp/opentelemetry -I/private/tmp/pear/temp/pear-build-nalcoderj0mc5u/opentelemetry-1.0.2/include -I/private/tmp/pear/temp/pear-build-nalcoderj0mc5u/opentelemetry-1.0.2/main -I/private/tmp/pear/temp/opentelemetry -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/main -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/TSRM -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/Zend -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -Wextra -Werror -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/opentelemetry/opentelemetry.c -MMD -MF opentelemetry.dep -MT opentelemetry.lo -fno-common -DPIC -o .libs/opentelemetry.o
/bin/sh /private/tmp/pear/temp/pear-build-nalcoderj0mc5u/opentelemetry-1.0.2/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/opentelemetry -I/private/tmp/pear/temp/pear-build-nalcoderj0mc5u/opentelemetry-1.0.2/include -I/private/tmp/pear/temp/pear-build-nalcoderj0mc5u/opentelemetry-1.0.2/main -I/private/tmp/pear/temp/opentelemetry -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/main -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/TSRM -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/Zend -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -Wextra -Werror -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/opentelemetry/otel_observer.c -o otel_observer.lo -MMD -MF otel_observer.dep -MT otel_observer.lo
cc -I. -I/private/tmp/pear/temp/opentelemetry -I/private/tmp/pear/temp/pear-build-nalcoderj0mc5u/opentelemetry-1.0.2/include -I/private/tmp/pear/temp/pear-build-nalcoderj0mc5u/opentelemetry-1.0.2/main -I/private/tmp/pear/temp/opentelemetry -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/main -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/TSRM -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/Zend -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -Wextra -Werror -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/opentelemetry/otel_observer.c -MMD -MF otel_observer.dep -MT otel_observer.lo -fno-common -DPIC -o .libs/otel_observer.o
/private/tmp/pear/temp/opentelemetry/otel_observer.c:231:24: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
if ((type_mask == IS_UNDEF)) {
~~~~~~~~~~^~~~~~~~~~~
/private/tmp/pear/temp/opentelemetry/otel_observer.c:231:24: note: remove extraneous parentheses around the comparison to silence this warning
if ((type_mask == IS_UNDEF)) {
~ ^ ~
/private/tmp/pear/temp/opentelemetry/otel_observer.c:231:24: note: use '=' to turn this equality comparison into an assignment
if ((type_mask == IS_UNDEF)) {
^~
=
1 error generated.
make: *** [otel_observer.lo] Error 1
ERROR: `make' failed

Additional context

How do I install the opentelemetry extension?
Installation using pickle also causes make failed.

@brettmc
Copy link
Collaborator

brettmc commented Apr 23, 2024

Hi, and thanks for the bug report. It looks like a simple fix, but I'd like to understand why our CI checks didn't complain about it. We compile with -Wall, which AFAICT includes -Wparentheses. Even by explicitly including -Wparentheses I can't make it complain, so is it the version of cc that's different here?
Removing the extra parentheses doesn't seem to cause any problems with our build, but if we can't replicate it, it might break again in the future. And, it might be stopping on the first of multiple occurrences too.

@gareththackeray
Copy link

gareththackeray commented Apr 23, 2024

I have the same problem

$ pear version
PEAR Version: 1.10.15
PHP Version: 8.3.6
Zend Engine Version: 4.3.6
Running on: Darwin SBUKDH212PC.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020 arm64

$ sw_vers     
ProductName:            macOS
ProductVersion:         14.4.1
BuildVersion:           23E224

$ gcc -v
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix

$ make -v
GNU Make 3.81

@mchristie
Copy link

I too have the same problem

$ pear version              
PEAR Version: 1.10.15
PHP Version: 8.3.6
Zend Engine Version: 4.3.6
Running on: Darwin 192.168.1.151 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64

$ sw_vers
ProductName:            macOS
ProductVersion:         14.4.1
BuildVersion:           23E224

$ gcc -v
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix

$ make -v
GNU Make 3.81

@brettmc
Copy link
Collaborator

brettmc commented Apr 27, 2024

Thanks for the extra details. So it seems to be that clang is more picky than gcc, so I'll try to get a macos build running in our CI.

@gpupo
Copy link

gpupo commented May 3, 2024

Thank you. I managed to install it correctly using the latest version.

pecl install opentelemetry-1.0.3beta1

@brettmc
Copy link
Collaborator

brettmc commented May 4, 2024

This is now released as https://pecl.php.net/package/opentelemetry/1.0.3

@nalcoder0913
Copy link
Author

thank you
It was installed normally.

$ pecl install opentelemetry

running: make
/bin/sh /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/opentelemetry -I/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/include -I/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/main -I/private/tmp/pear/temp/opentelemetry -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/main -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/TSRM -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/Zend -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -Wall -Wextra -Werror -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/opentelemetry/opentelemetry.c -o opentelemetry.lo  -MMD -MF opentelemetry.dep -MT opentelemetry.lo
mkdir .libs
 cc -I. -I/private/tmp/pear/temp/opentelemetry -I/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/include -I/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/main -I/private/tmp/pear/temp/opentelemetry -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/main -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/TSRM -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/Zend -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -Wextra -Werror -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/opentelemetry/opentelemetry.c -MMD -MF opentelemetry.dep -MT opentelemetry.lo  -fno-common -DPIC -o .libs/opentelemetry.o
/bin/sh /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/opentelemetry -I/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/include -I/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/main -I/private/tmp/pear/temp/opentelemetry -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/main -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/TSRM -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/Zend -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -Wall -Wextra -Werror -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/opentelemetry/otel_observer.c -o otel_observer.lo  -MMD -MF otel_observer.dep -MT otel_observer.lo
 cc -I. -I/private/tmp/pear/temp/opentelemetry -I/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/include -I/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/main -I/private/tmp/pear/temp/opentelemetry -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/main -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/TSRM -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/Zend -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -Wextra -Werror -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/opentelemetry/otel_observer.c -MMD -MF otel_observer.dep -MT otel_observer.lo  -fno-common -DPIC -o .libs/otel_observer.o
/bin/sh /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/libtool --mode=link cc -shared -I/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/include -I/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/main -I/private/tmp/pear/temp/opentelemetry -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/main -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/TSRM -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/Zend -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext -I/opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2    -o opentelemetry.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/modules  opentelemetry.lo otel_observer.lo
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/opentelemetry.so -bundle  .libs/opentelemetry.o .libs/otel_observer.o
dsymutil .libs/opentelemetry.so || :
creating opentelemetry.la
(cd .libs && rm -f opentelemetry.la && ln -s ../opentelemetry.la opentelemetry.la)
/bin/sh /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/libtool --mode=install cp ./opentelemetry.la /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/modules
cp ./.libs/opentelemetry.so /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/modules/opentelemetry.so
cp ./.libs/opentelemetry.lai /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/modules/opentelemetry.la
----------------------------------------------------------------------
Libraries have been installed in:
   /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/opentelemetry-1.0.3/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3" install
Installing shared extensions:     /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3/opt/homebrew/Cellar/php@8.1/8.1.28/pecl/20210902/
running: find "/private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3" | xargs ls -dils
39991552   0 drwxr-xr-x@ 3 nalcoder  wheel     96  5  7 10:10 /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3
39991885   0 drwxr-xr-x@ 3 nalcoder  wheel     96  5  7 10:10 /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3/opt
39991886   0 drwxr-xr-x@ 3 nalcoder  wheel     96  5  7 10:10 /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3/opt/homebrew
39991887   0 drwxr-xr-x@ 3 nalcoder  wheel     96  5  7 10:10 /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3/opt/homebrew/Cellar
39991888   0 drwxr-xr-x@ 3 nalcoder  wheel     96  5  7 10:10 /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3/opt/homebrew/Cellar/php@8.1
39991889   0 drwxr-xr-x@ 3 nalcoder  wheel     96  5  7 10:10 /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3/opt/homebrew/Cellar/php@8.1/8.1.28
39991890   0 drwxr-xr-x@ 3 nalcoder  wheel     96  5  7 10:10 /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3/opt/homebrew/Cellar/php@8.1/8.1.28/pecl
39991891   0 drwxr-xr-x@ 3 nalcoder  wheel     96  5  7 10:10 /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3/opt/homebrew/Cellar/php@8.1/8.1.28/pecl/20210902
39991892 120 -rwxr-xr-x@ 1 nalcoder  wheel  59005  5  7 10:10 /private/tmp/pear/temp/pear-build-nalcoder2SaSy4/install-opentelemetry-1.0.3/opt/homebrew/Cellar/php@8.1/8.1.28/pecl/20210902/opentelemetry.so

Build process completed successfully
Installing '/opt/homebrew/Cellar/php@8.1/8.1.28/pecl/20210902/opentelemetry.so'
install ok: channel://pecl.php.net/opentelemetry-1.0.3
Extension opentelemetry enabled in php.ini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants