Skip to content

Version 2.0.2 has install issue with centos 7 #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
avisual opened this issue Dec 10, 2020 · 9 comments · Fixed by #468
Closed

Version 2.0.2 has install issue with centos 7 #460

avisual opened this issue Dec 10, 2020 · 9 comments · Fixed by #468

Comments

@avisual
Copy link

avisual commented Dec 10, 2020

MySQLdb/_mysql.c: In function ‘_mysql_row_to_dict_cached’:
MySQLdb/_mysql.c:1340:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (unsigned int i=0; i<n; i++) {
^
MySQLdb/_mysql.c:1340:5: note: use option -std=c99 or -std=gnu99 to compile your code
error: command 'gcc' failed with exit status 1

rolling back to 2.0.1 works

@methane
Copy link
Member

methane commented Dec 10, 2020

Try export CFLAGS="-std=c99"

@dwt
Copy link

dwt commented Dec 10, 2020

Same problem here.

@methane that will likely be a workaround, but should be fixed somewhere in https://github.com/PyMySQL/mysqlclient/blob/master/setup_posix.py as far as I can. tell.

@dwt
Copy link

dwt commented Dec 10, 2020

Can confirm CFLAGS="-std=c99" pip install mysqlclient works as a workaround.

Not sure how I would apply that via a requirements.txt file, so I've constrained to the previous version which is ok.

@boagg
Copy link

boagg commented Dec 11, 2020

Hi, same problem here with debian Jessie (Yeah we have some servers work with a oldoldstable.. :/ We work on it !)

Meanwhile, CFLAGS="-std=c99" works as a workaround too.

@bac
Copy link

bac commented Dec 11, 2020

#455 Reverts the Maria version and should solve this issue. 2.0.3 needs to be released.

@nyashabryan
Copy link

nyashabryan commented Dec 11, 2020

@methane error on Centos7 with gcc~4.8.5 comes from this commit . The solution is either to refactor method or add the CFLAG="-std=99".

@methane
Copy link
Member

methane commented Dec 12, 2020

error on Centos7 with gcc~4.8.5 comes from this commit .

Thanks. I know it of course. I just don't have time to create new release.

The solution is either to refactor method

Rewriting code from C99 to C89 is not "refactoring". As you know, it's 2020 already.

or add the CFLAG="-std=99".

I know it of course. Everyone who can understand compiler error know it.

And all CentOS user should know it too and expect this kind of errors when using new OSS softwares on old CentOS.

Many OSS use recent Ubuntu LTS for CI. And CentOS users chose "self support" instead of paying red hat supoprt.
So CentOS users should expect all troubles caused by running new software on old platform, and can fix them by themselves.

If you think this trouble is so serious, I recommend you to switch to Ubuntu TLS. Ubuntu is the default OS for OSS CIs (Github Actions, Travis-CI, and so on). Or you can use RHEL for paid support.
CentOS is going to die except CentOS Stream. https://blog.centos.org/2020/12/future-is-centos-stream/ .

@dwt
Copy link

dwt commented Dec 12, 2020

@methane Not sure I'm getting what you are proposing. Do you imply that the setting --std=c99 should not be handed to the compiler, even though the project is written in it?

@methane
Copy link
Member

methane commented Dec 12, 2020

What I'm proposing is to stop sending more "me too" message or any other advices. All comments in this thread are just spam to me.

@PyMySQL PyMySQL locked and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants