classification
Title: selectmodule build fails
Type: compile error Stage: resolved
Components: Build, Cross-Build Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Alex.Willmer, berker.peksag, offby1, sxsns243, vstinner, yan12125
Priority: normal Keywords: patch

Created on 2016-12-09 00:35 by sxsns243, last changed 2018-01-30 13:06 by vstinner. This issue is now closed.

Files
File name Uploaded Description Edit
selectmodule.patch sxsns243, 2016-12-09 00:35 review
Pull Requests
URL Status Linked Edit
PR 5447 merged vstinner, 2018-01-30 10:43
Messages (8)
msg282746 - (view) Author: Wataru Matsumoto (sxsns243) * Date: 2016-12-09 00:35
selectmodule build fails with the linux without epoll_create1(before kernel 2.6.27).


building 'select' extension
gcc -pthread -fPIC -fno-strict-aliasing -Wsign-compare -g -O0 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I./Include -I. -I/usr/local/include -I/home/wmatsumo/download/cpython/Include -I/home/wmatsumo/download/cpython -c /home/wmatsumo/download/cpython/Modules/selectmodule.c -o build/temp.linux-x86_64-3.7-pydebug/home/wmatsumo/download/cpython/Modules/selectmodule.o
/home/wmatsumo/download/cpython/Modules/selectmodule.c: In function 'pyepoll_new':
/home/wmatsumo/download/cpython/Modules/selectmodule.c:1306: error: 'EPOLL_CLOEXEC' undeclared (first use in this function)
/home/wmatsumo/download/cpython/Modules/selectmodule.c:1306: error: (Each undeclared identifier is reported only once
/home/wmatsumo/download/cpython/Modules/selectmodule.c:1306: error: for each function it appears in.)

It seems due to the below change.
http://bugs.python.org/issue20100
It have to check HAVE_EPOLL_CREATE1 is defined before using EPOLL_CLOEXEC.
msg282750 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-12-09 01:16
Probably a regression caused by the change ac24e5c2fd3e.

I'm curious: what is your Linux distribution? (Can't you get a more Linux kernel?)
msg282757 - (view) Author: Wataru Matsumoto (sxsns243) * Date: 2016-12-09 03:07
I'm using Red Hat Enterprise.
cat /proc/version 
Linux version 2.6.18-238.9.1.el5 (mockbuild@x86-002.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Fri Mar 18 12:42:39 EDT 2011
msg309864 - (view) Author: Chris Rose (offby1) * Date: 2018-01-12 17:14
Is this patch mergeable? I'm trialing the 3.7.0a4 build on some systems here and am unable to build due to this issue, on libc 2.12:

± /lib/libc.so.6
GNU C Library stable release version 2.12, by Roland McGrath et al.
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.4.6 20110731 XXXXXXXXXXXX.
Compiled on a Linux 3.2.5 system on 2017-10-20.
Available extensions:
	The C stubs add-on version 2.1.2.
	crypt add-on version 2.1 by Michael Glad and others
	GNU Libidn by Simon Josefsson
	Native POSIX Threads Library by Ulrich Drepper et al
	BIND-8.2.3-T5B
	RT using linux kernel aio
msg309865 - (view) Author: Chris Rose (offby1) * Date: 2018-01-12 17:16
Ach; ignore the libc version below; that's a PEBKAC error on my part. The libc version on the system that's failing is older (and hard to get; just trust me, it's older) and doesn't have the relevant epoll value.
msg311242 - (view) Author: Chih-Hsuan Yen (yan12125) * Date: 2018-01-30 06:36
As a side note, EPOLL_CLOEXEC is also missing on Android if *both* of the following conditions hold:

1. The build target is Android API < 21 (issue 32654)
2. Android NDK r15 or newer is used

The second condition is related to a workaround in NDK [1]. For now it's proposed to use NDK r14 to build CPython [2], so this issue can be left to the future. I've also asked if the relevant workaround in NDK can be reverted [3].

[1] https://android-review.googlesource.com/c/platform/bionic/+/401372
[2] https://github.com/python/cpython/pull/1629
[3] https://github.com/android-ndk/ndk/issues/302#issuecomment-361488327
msg311267 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-01-30 11:18
New changeset b8d90328ad2abc9d6d2c9b8ce769fb82b18bbc10 by Victor Stinner in branch 'master':
bpo-28914: Fix compilation of select on Android (#5447)
https://github.com/python/cpython/commit/b8d90328ad2abc9d6d2c9b8ce769fb82b18bbc10
msg311271 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-01-30 13:06
I merged a PR based on selectmodule.patch. Thanks Wataru Matsumoto for your contribution!

Python 3.6 doesn't seem to be affected by the issue. I close the issue.
History
Date User Action Args
2018-01-30 13:06:04vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg311271

stage: patch review -> resolved
2018-01-30 11:18:56vstinnersetmessages: + msg311267
2018-01-30 10:43:10vstinnersetstage: patch review
pull_requests: + pull_request5279
2018-01-30 06:36:24yan12125setnosy: + Alex.Willmer, yan12125
messages: + msg311242
components: + Build, Cross-Build
2018-01-12 17:16:20offby1setmessages: + msg309865
2018-01-12 17:14:47offby1setnosy: + offby1
messages: + msg309864
2016-12-09 03:07:30sxsns243setmessages: + msg282757
2016-12-09 01:16:25vstinnersetnosy: + vstinner
messages: + msg282750
2016-12-09 00:41:01ned.deilysetnosy: + berker.peksag
2016-12-09 00:35:21sxsns243create