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

phpExtensions.protobuf: fix build with PHP 8 #109443

Merged
merged 1 commit into from Jan 15, 2021
Merged

Conversation

jojosch
Copy link
Member

@jojosch jojosch commented Jan 15, 2021

Motivation for this change

Wanted to try PHP 8 with an application from work which uses the protobuf extension. The build fails with:

builder for '/nix/store/7nci6jwbp0lcvggknpbfn3lv53synxdx-php-protobuf-3.14.0.drv' failed with exit code 2; last 10 log lines:
  /nix/store/kl6lr3czkbnr6m5crcy8ffwfzbj8a22i-bash-4.4-p23/bin/bash /build/protobuf-3.14.0/libtool --mode=compile gcc -I. -I/build/protobuf-3.14.0 -I/build/protobuf-3.14.0/include -I/build/protobuf-3.14.0/main -I/build/protobuf-3.14.0 -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/main -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/TSRM -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/Zend -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/ext -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -std=gnu99 -c /build/protobuf-3.14.0/arena.c -o arena.lo
  mkdir .libs
   gcc -I. -I/build/protobuf-3.14.0 -I/build/protobuf-3.14.0/include -I/build/protobuf-3.14.0/main -I/build/protobuf-3.14.0 -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/main -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/TSRM -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/Zend -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/ext -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -std=gnu99 -c /build/protobuf-3.14.0/arena.c  -fPIC -DPIC -o .libs/arena.o
  /nix/store/kl6lr3czkbnr6m5crcy8ffwfzbj8a22i-bash-4.4-p23/bin/bash /build/protobuf-3.14.0/libtool --mode=compile gcc -I. -I/build/protobuf-3.14.0 -I/build/protobuf-3.14.0/include -I/build/protobuf-3.14.0/main -I/build/protobuf-3.14.0 -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/main -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/TSRM -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/Zend -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/ext -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -std=gnu99 -c /build/protobuf-3.14.0/array.c -o array.lo
   gcc -I. -I/build/protobuf-3.14.0 -I/build/protobuf-3.14.0/include -I/build/protobuf-3.14.0/main -I/build/protobuf-3.14.0 -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/main -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/TSRM -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/Zend -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/ext -I/nix/store/xy3fdbc89l3p91dg5yafbmwrmsrm25ip-php-8.0.1-dev/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -std=gnu99 -c /build/protobuf-3.14.0/array.c  -fPIC -DPIC -o .libs/array.o
  /build/protobuf-3.14.0/array.c: In function 'Array_ModuleInit':
  /build/protobuf-3.14.0/array.c:639:4: error: 'zend_object_handlers' {aka 'struct _zend_object_handlers'} has no member named 'compare_objects'
    639 |   h->compare_objects = RepeatedField_compare_objects;
        |    ^~
  make: *** [Makefile:210: array.lo] Error 1

Grabbed the changes from protocolbuffers/protobuf#8105

Result of nixpkgs-review run on x86_64-linux 1

3 packages built:
  • php73Extensions.protobuf
  • php74Extensions.protobuf
  • php80Extensions.protobuf
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@etu
Copy link
Contributor

etu commented Jan 15, 2021

@ofborg build php73Extensions.protobuf php74Extensions.protobuf php80Extensions.protobuf

@etu etu merged commit 17631db into NixOS:master Jan 15, 2021
@jojosch jojosch deleted the php8-protobuf branch January 15, 2021 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants