Bug 1536881
| Summary: | FTBFS with libxcrypt | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Michal Schorm <mschorm> | ||||
| Component: | community-mysql | Assignee: | Michal Schorm <mschorm> | ||||
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | rawhide | CC: | besser82, fweimer, hhorak, jstanek, mschorm | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2018-01-22 15:32:07 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1534789, 1535520 | ||||||
| Attachments: |
|
||||||
Is that expected? (Is the function known for not being provided by libxcrypt header files?) What's the suggested process? (In reply to Michal Schorm from comment #1) > Is that expected? > (Is the function known for not being provided by libxcrypt header files?) > > What's the suggested process? Well, no… It is the `crypt()` function well supported by libxcrypt. All files using this function should not make the blind assumption it will be declared in <unistd.h>. One can only rely on having it declared in that header file, if `_XOPEN_CRYPT` is defined *after* including it… Putting this in the affected file after importing all other header files will fix that particular problem: #if defined(__GLIBC__) && !defined(_XOPEN_CRYPT) #include <crypt.h> #endif Do you want to provide a patch and upstream it, or shall I provide an upstreamable one? Another option would be to have CMake check for `crypt.h` being present and define a macro like `HAVE_CRYPT_H`; then add this in the affected files: #ifdef HAVE_CRYPT_H #include <crypt.h> #endif You also rebuilt MariaDB, but no problem was there. So I checked, how MariaDB does it. It uses: mariadb-10.2.12/libmariadb/cmake/CheckIncludeFiles.cmake CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H) mariadb-10.2.12/include/my_global.h: #if defined(HAVE_CRYPT_H) #include <crypt.h> #endif So they check the crypt.h library file directly. --- MySQL uses the same system, so I'd stick to it and use the "CHECK_INCLUDE_FILES" cmake function. Created attachment 1384165 [details]
patch 1
Looking at MariaDB, I think this patch should get the stuff done.
Do you agree? Test build with the patch: https://koji.fedoraproject.org/koji/taskinfo?taskID=24358755 (In reply to Michal Schorm from comment #6) > Do you agree? LGTM. =) Very well then. Built: https://koji.fedoraproject.org/koji/taskinfo?taskID=24369733 |
FTBFS /builddir/build/BUILD/mysql-5.7.21/sql/item_strfunc.cc:2276:14: error: 'crypt' was not declared in this scope char *tmp= crypt(res->c_ptr_safe(),salt_ptr); ^~~~~ --- Cause: https://fedoraproject.org/wiki/Changes/Replace_glibc_libcrypt_with_libxcrypt --- Build Logs to examine: https://koji.fedoraproject.org/koji/taskinfo?taskID=24346348 https://koji.fedoraproject.org/koji/taskinfo?taskID=24330771