Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

About Overtrue's phonetic library overtrue/pinyin, why is travis error?

Shulou Source: shulou.com Published: 2022-06-03 06:08:52 10月02日 Update

What is ThinkSNS?

ThinkSNS (TS for short), a platform-wide comprehensive social system, provides social software development and technical solutions for large, small and medium-sized enterprises and entrepreneurs at home and abroad.

1.png

This is the continuous integration status in the https://github.com/overtrue/pinyin home page README.

A friend asked me earlier, can I use error in this travis state? It must work. Let's take a look at what went wrong on travis:

2.png

It's already shown, and the unit tests that failed are php 5.5and php 5.6. let's just click on one to take a look at it.

3.png

No output was received over 10m, so travis thought there was a problem with the build. As a matter of fact, there is a problem, and I have been upset for a long time. The build that did not receive the output is tests/GeneratorFileDictLoaderTest.php, which tests the loader Overtrue\ Pinyin\ GeneratorFileDictLoader.

Explain the loader, because the phonetic library is based on the thesaurus, which is so large that it is not allowed to load so much data in memory in many scenarios. So the loader uses the Generator feature of php5.5+ to generate data at the cost of a large amount of disk IO and an increase of more than 90% of the allowable time. (as described in the PHP official documentation).

Travis believes that the reason for the build failure: this problem may be caused by the fake death caused by the file system of PHP 5.5-5.6 (see the PHP change log), coupled with the low IO ability of travis itself. So it faked death after causing the generator to open multiple file streams at the same time.

How to repair it

Well, I'm here to be funny. Do not know how to solve the problem of build failure, this problem I used to fork brother library this code, and did not find a good solution.

Maybe it would be good to delete this "generator" loader.

In fact, I specially posted this article to show Brother Chao how to make the construction run well.

Past R & D Diary Portal:

"ThinkSNS+ is based on the   Laravel master   branch [R & D Diary I]"

"webpack/Vue at the front end of ThinkSNS+ R & D [R & D Diary II]

"  ThinkSNS+ Component based on   Laravel Route   [R & D Diary 3]"

"how to configure   Laravel   can be configured at the backend of the website [R & D Diary 4]"

"how does ThinkSNS+   calculate the character display length [R & D Diary 5]"

"release of   ThinkSNS+ alpha.2   version based on   Laravel   [R & D Diary 6]"

"talk about the" automatic discovery "of Laravel 5.5and the mood at the moment [R & D Diary 7].

"following: one of my unique needs-0.5 English characters and 1 Chinese characters [R & D Diary 8]"

"using   Docker package Laradock server to deploy Laravel & ThinkSNS+ and other programs (multi-project) [R & D Diary 9]"

Tags: Diary problem generation character data generator test file status system thesaurus output configuration pinyin distress cost code memory branch entrepreneur Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MySQL Shulou Technology NVidia Microsoft