[MDEV-23306] fatal error: pcre2.h: No such file or directory Created: 2020-07-28 Updated: 2021-09-28 Resolved: 2021-09-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Compiling |
| Affects Version/s: | 10.5.4 |
| Fix Version/s: | 10.5.13, 10.6.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Mingli-Yu | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
ubuntu 18.04 |
||
| Description |
|
Build fails sometimes with below error, seems it is a race condition, not occurs every time.
|
| Comments |
| Comment by Mingli-Yu [ 2020-08-03 ] | |||||||||||||
|
Notice there is below logic in sql/CMakeLists.txt, it should gurantee the pcre2 built first and then start to build sql, but through the error info, seems the pcre2 build doesn't complete when begin to build sql.
BTW, I notice below logic in build/sql/CMakeFiles/sql.dir/depend.make in a successfull build env.
But in the failed build env, the file build/sql/CMakeFiles/sql.dir/depend.make only contains below two lines:
| |||||||||||||
| Comment by Sergei Golubchik [ 2020-08-03 ] | |||||||||||||
|
supposedly it happens because pcre2 build in cmake/pcre.cmake does not specify that pcre2.h is generated in that build, so the build tool might think that pcre2.h would exist even before pcre2 libraries are built. Mingli-Yu, what cmake generator (make? ninja? something else?) do you use and how do you invoke it? (make? ninja? cmake --build?) | |||||||||||||
| Comment by Mingli-Yu [ 2020-08-04 ] | |||||||||||||
|
Hi Sergei Golubchik, The cmake generator is make in my env. Is it possible to define the dependency for pcre2.h in sql/CMakeLists.txt? BTW, what's the difference for -DWITH_PCRE=system and -DWITH_PCRE=auto? Anyway I switch to use -DWITH_PCRE=system to avoid the occasional build failure. Thanks, | |||||||||||||
| Comment by Sergei Golubchik [ 2020-08-08 ] | |||||||||||||
|
system will make the build to use the system pcre2. The build will fail if system pcre2 isn't usable. Yes, it's possible to specify the dependency explicitly. cmake needs to know that
I suspect cmake can detect the former automatically, but it definitely should be told about the latter. | |||||||||||||
| Comment by Alexander Miloslavskiy [ 2021-07-10 ] | |||||||||||||
|
To my understanding, the problem is that libmysqld\CMakeLists.txt doesn't depend on pcre2. This fixes it for me:
The problem is reproducible when using bundled PCRE from a very clean repo. | |||||||||||||
| Comment by Alexander Miloslavskiy [ 2021-07-10 ] | |||||||||||||
|
Note that there are two projects that use item_cmpfunc.cc: libmysqld\CMakeLists.txt and sql\CMakeLists.txt, and only the latter depends on pcre2. Therefore, depending on which is built first, it will either fail or succeed. | |||||||||||||
| Comment by Vladislav Vaintroub [ 2021-09-28 ] | |||||||||||||
|
reproducible when building sql_embedded only, e.g ninja sql_embedded Any target should be buildable by itself, and not depend on some order buildtool chooses. Here, dependencies are broken
|