Closed (fixed)
Project:
Drupal core
Version:
8.9.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
31 May 2017 at 12:39 UTC
Updated:
4 Aug 2020 at 15:49 UTC
Jump to comment: Most recent
PECL's yaml module can incorrectly parse floating point values in yaml files when running on Alpine.
Resolve upstream: https://bugs.php.net/bug.php?id=75213
I am getting a testing failure from the Serialization Component when running PHPUnit tests.
Environment:
PHP: 7.1.5 OS: Linux - Alpine v3.4.6 Drupal: 8.3.2
Yaml extension installed via:
pecl install yaml-2.0.0
Running tests:
cd core ../vendor/bin/phpunit --testsuite=unit -v
Results in:
There was 1 failure:
1) Drupal\Tests\Component\Serialization\YamlTest::testYamlFiles with data set #178 ('/home/app/src/docroot/core/mo...es.yml')
/home/app/src/docroot/core/modules/config/tests/config_test/config/install/config_test.types.yml
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
'array' => Array ()
'boolean' => true
- 'exp' => 1.2E+34
- 'float' => 3.14159
+ 'exp' => 1.2000000000000467E+34
+ 'float' => 3.1415900000001784
'float_as_integer' => 1.0
'hex' => 12
'int' => 99
'octal' => 509
'string' => 'string'
'string_int' => '1'
)
/home/app/src/docroot/core/tests/Drupal/Tests/Component/Serialization/YamlTest.php:71Looks like an error relating to precision.
This could potentially be an issue with the compiled yaml and yaml-dev packages used when compiling the Yaml PHP extension. I will verify against a different operation system (Debian).
Any one else hitting this failure?
Comments
Comment #2
ellioseven commentedComment #3
ellioseven commentedComment #4
ellioseven commentedComment #5
wim leersThis is not in the serialization module, but in the component, which is a very different kind of serialization.
(Yes, this is confusing :/)
Comment #6
wim leersComment #7
wim leersneclimdul spearheaded the PECL YAML support. Assigning to him.
Comment #9
henk commentedI have same problem, when I run unit tests from PHP 7.0 or PHP 7.1.
Comment #10
neclimdulYeah I've seen that too. Have you tested it against Debian? Curious if it's musl related.
Comment #11
neclimdulConfirmed it works fine in the default docker debian image so this isn't just magically passing on d.o there seems to be a bug in pecl's yaml module when built on alpine. Reported upstream with simplified test scripts: https://bugs.php.net/bug.php?id=75213
We don't really have a "tracking upstream" status as far as I know so marking this postponed since there isn't anything for Drupal to do ATM.
Comment #13
neclimdulFix was merged upstream yesterday and hopefully we'll get a release soon with the fix.
Comment #17
wiifmAccording to https://bugs.php.net/bug.php?id=75213, the fix was released in Yaml 2.0.3. The latest version today is 2.1.0. I think this issue can be closed (unless we can set Drupal's minimum requirements for the Yaml PECL library).
Comment #18
neclimdulDefinitely fixed and I'm not sure its worth the requirements at this point. :-D Thanks for following up and closing this, I had no idea the issue was still open.