[issue8746] *chflags detection broken on FreeBSD 9-CURRENT

Garrett Cooper report at bugs.python.org
Tue May 18 11:05:22 CEST 2010


New submission from Garrett Cooper <yanegomi at gmail.com>:

os.chflags isn't `available' even though chflags support is available on the system:

>>> filter(lambda x: x.startswith('chflags'), dir(os))
[]
>>> platform.uname()
('FreeBSD', 'bayonetta.local', '9.0-CURRENT', 'FreeBSD 9.0-CURRENT #0 r206173M: Mon Apr 26 22:45:06 PDT 2010     root at bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA.ata', 'amd64', 'amd64')
>>> filter(lambda x: x.startswith('chflags'), dir(os))
[]
>>> sys.version
'2.6.5 (r265:79063, May 16 2010, 23:37:42) \n[GCC 4.2.1 20070719  [FreeBSD]]'

I'm looking into why this is not properly detected via configure (here's the snippet though):

configure:17257: checking for chflags
configure:17288: cc -o conftest -O2 -pipe -fno-strict-aliasing -pipe -O2 -march=nocona -D__wchar_t=wchar_t  -DTHREAD_STACK_SIZE=0x100000  -pthread  conftest.c  >&5
conftest.c:173: error: expected identifier or '(' before '[' token
In file included from /usr/include/sys/_types.h:33,
                 from /usr/include/sys/_timespec.h:37,
                 from /usr/include/sys/stat.h:42,
                 from conftest.c:174:
/usr/include/machine/_types.h:75: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__int_least8_t'
In file included from /usr/include/sys/time.h:37,
                 from /usr/include/sys/stat.h:99,
                 from conftest.c:174:
/usr/include/sys/types.h:64: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int8_t'
conftest.c:182: error: expected identifier or '(' before ']' token
configure:17291: $? = 1

Compiling the standalone test works:

$ cat ~/test_chflags.c 
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char*argv[])
{
  if(chflags(argv[0], 0) != 0)
    return 1;
  return 0;
}
$ gcc -o ~/test_chflags ~/test_chflags.c
$ echo $?
0

Also, another sidenote: nowhere is *chflags(2) considered a POSIX feature (I doublechecked opengroup.org and Google). It is strictly a _Unix_ feature. I say this because the POSIX functionality tester explicitly looks for this `POSIX' compatible feature.

----------
messages: 105957
nosy: yaneurabeya
priority: normal
severity: normal
status: open
title: *chflags detection broken on FreeBSD 9-CURRENT
type: compile error
versions: Python 2.6, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8746>
_______________________________________


More information about the Python-bugs-list mailing list