Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 632578 - dev-python/mysql-python - fatal error: my_config.h: No such file or directory
Summary: dev-python/mysql-python - fatal error: my_config.h: No such file or directory
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 4 votes (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-30 21:08 UTC by Petr Cerny [:hrosik]
Modified: 2020-03-11 15:13 UTC (History)
26 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,15.69 KB, text/plain)
2019-08-19 18:00 UTC, Toralf Förster
Details
dev-python:mysql-python-1.2.5-r2:20190819-043822.log (dev-python:mysql-python-1.2.5-r2:20190819-043822.log,5.65 KB, text/plain)
2019-08-19 18:00 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,105.23 KB, text/plain)
2019-08-19 18:00 UTC, Toralf Förster
Details
environment (environment,122.76 KB, text/plain)
2019-08-19 18:00 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,10.79 KB, application/x-bzip)
2019-08-19 18:00 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,27.96 KB, application/x-bzip)
2019-08-19 18:00 UTC, Toralf Förster
Details
MySQL-python-1.2.5-my_config-missing.diff (MySQL-python-1.2.5-my_config-missing.diff,442 bytes, patch)
2019-08-21 14:45 UTC, Attila Tóth
Details | Diff
alarig-emerge--info (file_632578.txt,6.30 KB, text/plain)
2020-02-18 08:26 UTC, Alarig Le Lay
Details
alarig-emerge-pqv (file_632578.txt,467 bytes, text/plain)
2020-02-18 08:26 UTC, Alarig Le Lay
Details
alarig-build.log (file_632578.txt,5.73 KB, text/plain)
2020-02-18 08:27 UTC, Alarig Le Lay
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Cerny [:hrosik] 2017-09-30 21:08:12 UTC
dev-python/mysql-python fails to build (tried 1.2.5 and 1.2.3):

x86_64-pc-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/mysql/.. -I/usr/include/python2.7 -c _mysql.c -o /free/portage/dev-python/mysql-python-1.2.5-r1/work/MySQL-python-1.2.5-python2_7/temp.linux-x86_64-2.7/_mysql.o
_mysql.c:44:10: fatal error: my_config.h: No such file or directory

After some investigation, the problem seems to be that MariaDB 10.2.8 cleaned up the install process so that headers are installed in more sensible locations [1]. This involved my_config being moved into the server/ subdiorectory, a change python-mysql (and others) are not aware of.

Is there any way to detect this in the ebuild and modify CFLAGS accordingly, until upstream fixes it [2]?

[1]: https://jira.mariadb.org/browse/MDEV-13370
[2]: https://github.com/farcepest/MySQLdb1/issues/132
Comment 1 Leho Kraav (:macmaN @lkraav) 2019-03-15 18:46:40 UTC
Yep, confirmed, this is happening w/ dev-db/mariadb-10.2
Comment 2 Toralf Förster gentoo-dev 2019-08-19 18:00:22 UTC
appeared recently at the tinderbox image 17.1_desktop_gnome_systemd-20190816-151832
Comment 3 Toralf Förster gentoo-dev 2019-08-19 18:00:25 UTC
Created attachment 587460 [details]
emerge-info.txt
Comment 4 Toralf Förster gentoo-dev 2019-08-19 18:00:28 UTC
Created attachment 587462 [details]
dev-python:mysql-python-1.2.5-r2:20190819-043822.log
Comment 5 Toralf Förster gentoo-dev 2019-08-19 18:00:31 UTC
Created attachment 587464 [details]
emerge-history.txt
Comment 6 Toralf Förster gentoo-dev 2019-08-19 18:00:35 UTC
Created attachment 587466 [details]
environment
Comment 7 Toralf Förster gentoo-dev 2019-08-19 18:00:38 UTC
Created attachment 587468 [details]
etc.portage.tbz2
Comment 8 Toralf Förster gentoo-dev 2019-08-19 18:00:41 UTC
Created attachment 587470 [details]
temp.tbz2
Comment 9 Attila Tóth 2019-08-21 14:44:03 UTC
It's happenning with mysql-8 and mysql-connector-c-8 as well.
Comment 10 Attila Tóth 2019-08-21 14:45:46 UTC
Created attachment 587766 [details, diff]
MySQL-python-1.2.5-my_config-missing.diff

Couldn't we just get rid of this include? Works for me.
Comment 11 Kees Bergwerf 2019-08-24 17:26:14 UTC
here only rdflib was depending on mysql-python and nothing depended on rdflib, so..

emerge -a --depclean rdflib mysql-python

solved the problem.
Comment 12 Preston Crow 2019-09-06 14:48:39 UTC
This package is a dependency for MythTV, so I can't drop it, but the comment above about the include not being needed provided a trivial workaround.  Until this is fixed in the ebuild, this gets me going:

touch /usr/include/my_config.h
emerge -1v dev-python/mysql-python
rm /usr/include/my_config.h
Comment 13 Ștefan Talpalaru 2019-09-07 17:17:37 UTC
A patched dev-python/mysql-python-1.2.5-r3 is available in my overlay: https://github.com/stefantalpalaru/gentoo-overlay
Comment 14 Fred Krogh 2019-09-11 00:47:51 UTC
I was not able to figure out how to access the fix in comment 13, but the one in comment 12 worked fine, and seems safe to me.  Thanks, Preston
Comment 15 Dennis Schridde 2019-10-19 20:38:08 UTC
(In reply to Petr Cerny [:hrosik] from comment #0)
> Is there any way to detect this in the ebuild and modify CFLAGS accordingly,
> until upstream fixes it [2]?

Upstream says they are not going to fix it and the whole project is unmaintained: https://github.com/farcepest/MySQLdb1/issues/132#issuecomment-334560666

People shall use the "mysqlclient" fork instead: https://pypi.org/project/mysqlclient/

I assume we should last rite dev-python/mysql-python and move its reverse dependencies to dev-python/mysqlclient.
Comment 16 Frank Krömmelbein 2020-02-15 23:47:25 UTC
Just run into this issue too.
Comment 17 Anton Bolshakov 2020-02-16 01:53:16 UTC
hit this bug after recent sync and being forced to rebuild dev-python/mysql-python.

The current version 1.2.5-r1 is marked is stable but it's broken.
Please apply patches asap.
Comment 18 Tomáš Mózes 2020-02-17 08:28:59 UTC
Same issue here.
Comment 19 Alarig Le Lay 2020-02-18 08:26:06 UTC
Created attachment 614234 [details]
alarig-emerge--info
Comment 20 Alarig Le Lay 2020-02-18 08:26:43 UTC
Created attachment 614236 [details]
alarig-emerge-pqv
Comment 21 Alarig Le Lay 2020-02-18 08:27:19 UTC
Created attachment 614238 [details]
alarig-build.log
Comment 22 Alarig Le Lay 2020-02-18 08:28:03 UTC
Same here, see my previous attachments for the requested outputs.
Comment 23 Alarig Le Lay 2020-02-18 15:58:38 UTC
Thanks for the pointer to dev-python/mysqlclient, it worked for my usecase (LibreNMS).
Comment 24 Nikita Melnichenko 2020-02-23 06:27:22 UTC
I understand there is ongoing effort to replace dev-python/mysql-python with dev-python/mysqlclient, however please apply the proposed patch and create the -r3, so it doesn't break world updates.
Comment 25 Larry the Git Cow gentoo-dev 2020-03-08 01:31:42 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13926f810426bd99d4d580bf6facc29d552e5e6f

commit 13926f810426bd99d4d580bf6facc29d552e5e6f
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-03-08 01:23:05 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-03-08 01:31:32 +0000

    dev-python/mysql-python: fix building against dev-db/mysql-8+
    
    Closes: https://bugs.gentoo.org/632578
    Package-Manager: Portage-2.3.91, Repoman-2.3.20
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 ...sql-python-1.2.5-drop-my_config.h-include.patch | 15 +++++++
 .../mysql-python/mysql-python-1.2.5-r3.ebuild      | 46 ++++++++++++++++++++++
 2 files changed, 61 insertions(+)