awslabs / aws-crt-php

Apache License 2.0
322 stars 13 forks source link

Build and test failures #60

Closed sapphirecat closed 2 years ago

sapphirecat commented 2 years ago

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug I followed the directions in the README in this repository, using the latest release downloaded from PECL, and the tests do not run.

SDK version number Unclear what this means?

Platform/OS/Hardware/Device Ubuntu 20.04 amd64 VM with Ondrej Sury's PPA, PHP 8.1.3 (cli) (built: Feb 21 2022 14:48:42) (NTS).

To Reproduce (observed behavior)

sudo apt install --no-install-recommends php8.1-dev cmake
tar zxf awscrt-1.0.9.tgz
cd awscrt-1.0.9
phpize
./configure
make
make test

Expected behavior Tests should run, and preferably even pass.

Logs/output Using PECL:

% make test

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

cp -v /home/ubuntu/awscrt-1.0.9/composer.json .
cp: '/home/ubuntu/awscrt-1.0.9/composer.json' and './composer.json' are the same file
make: *** [Makefile:267: vendor/bin/phpunit] Error 1

EDIT: git clone output deleted. Realized the clone was non-recursive. See below for updates.

Additional context I wanted to install/test this, to see if it's worth deploying to production. It's not looking great. The version alleged on PECL isn't tagged here.

I don't know if the packages noted in the reproduction step are sufficient when starting from a basic Ubuntu image; my VM already had php8.1-cli and several extensions (including php8.1-curl) installed.

sapphirecat commented 2 years ago

1.0.8 (latest release marked stable from PECL) also fails tests against PHP 8.1.3.

Starting test 'CoreTest::testIsAvailable'.

Fatal error: During inheritance of Countable: Uncaught Return type of PHPUnit_Framework_Constraint::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

/home/ubuntu/awscrt-1.0.8/tests/000_CoreTest.php:15
/home/ubuntu/awscrt-1.0.8/vendor/phpunit/phpunit/phpunit:52
 in /home/ubuntu/awscrt-1.0.8/vendor/phpunit/phpunit/src/Framework/Constraint.php on line 16

ETA: For the record, the sha256 and sha384 hashes of the files received from PECL:

904a29d93d3f196d4ab6d149936367207322bacfae21794752659b9f1861934d  awscrt-1.0.8.tgz
68ca363132ba2d9a2766add2ccef6a7948dcc17fb79558cffb8b0306b63057cf  awscrt-1.0.9.tgz

6361799401594a7a1e454487be98cc982e9888bdd772a599420d168f45a2b464a650e30183de26294ceb255893906f3c  awscrt-1.0.8.tgz
57dde8508c2f0d88dc76d580469fe5a38cb373b412753f325655c80fdb6d6193f569637f962f84d3690edee2f96908fd  awscrt-1.0.9.tgz
sapphirecat commented 2 years ago

Update: I realized the problem with git clone was that it was non-recursive. Mea culpa!

Doing the clone correctly results in a build that fails tests like awscrt-1.0.8.tgz.

sapphirecat commented 2 years ago

I am no longer interested in this issue.