This repository was archived by the owner on Jul 5, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 5, 2023. It is now read-only.
Does not compile under Cygwin #11
Copy link
Copy link
Closed
Description
In a Python 3 inside Cygwin, meaning that it was installed over the Cygwin package manager and is not a Windows one accessed from Cygwin, python3 setup.py build will fail:
running build
running build_py
running build_ext
building '_ast27' extension
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Parser/acceler.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/acceler.o
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Parser/bitset.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/bitset.o
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Parser/grammar.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/grammar.o
ast27/Parser/grammar.c:16:12: warning: ‘Py_DebugFlag’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
extern int Py_DebugFlag;
^
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Parser/grammar1.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/grammar1.o
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Parser/node.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/node.o
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Parser/parser.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/parser.o
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Parser/parsetok.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/parsetok.o
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Parser/tokenizer.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/tokenizer.o
ast27/Parser/tokenizer.c:41:7: warning: ‘_Ta27Parser_TokenNames’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
char *_Ta27Parser_TokenNames[] = {
^
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Python/ast.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/ast.o
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Python/graminit.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/graminit.o
ast27/Python/graminit.c:2332:9: warning: ‘_Ta27Parser_Grammar’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
grammar _Ta27Parser_Grammar = {
^
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Python/mystrtoul.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/mystrtoul.o
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Python/Python-ast.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/Python-ast.o
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -Iast27/Include -I/usr/include/python3.4m -c ast27/Custom/typed_ast.c -o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Custom/typed_ast.o
gcc -shared -Wl,--enable-auto-image-base build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/acceler.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/bitset.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/grammar.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/grammar1.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/node.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/parser.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/parsetok.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/tokenizer.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/ast.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/graminit.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/mystrtoul.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/Python-ast.o build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Custom/typed_ast.o -L/usr/lib/python3.4/config -L/usr/lib -lpython3.4m -o build/lib.cygwin-2.6.0-x86_64-3.4/_ast27.cpython-34m.dll
build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/grammar.o: In function `_Py_translatelabels':
/home/phili/typed_ast/ast27/Parser/grammar.c:144: undefined reference to `__imp__Ta27Parser_TokenNames'
/home/phili/typed_ast/ast27/Parser/grammar.c:144:(.text+0x3ac): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp__Ta27Parser_TokenNames'
build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Parser/grammar1.o: In function `Ta27Grammar_LabelRepr':
/home/phili/typed_ast/ast27/Parser/grammar1.c:52: undefined reference to `__imp__Ta27Parser_TokenNames'
/home/phili/typed_ast/ast27/Parser/grammar1.c:52:(.text+0x48): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp__Ta27Parser_TokenNames'
/home/phili/typed_ast/ast27/Parser/grammar1.c:50: undefined reference to `__imp__Ta27Parser_TokenNames'
/home/phili/typed_ast/ast27/Parser/grammar1.c:50:(.text+0xb3): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp__Ta27Parser_TokenNames'
build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/ast.o: In function `compiler_complex_args':
/home/phili/typed_ast/ast27/Python/ast.c:681: undefined reference to `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/ast.c:681:(.text+0x8ec): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_Py_asdl_seq_new'
build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/ast.o: In function `ast_for_exprlist':
/home/phili/typed_ast/ast27/Python/ast.c:2448: undefined reference to `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/ast.c:2448:(.text+0x117f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_Py_asdl_seq_new'
build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/ast.o: In function `ast_for_expr':
/home/phili/typed_ast/ast27/Python/ast.c:1992: undefined reference to `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/ast.c:1992:(.text+0x131b): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/ast.c:2028: undefined reference to `_Py_asdl_int_seq_new'
/home/phili/typed_ast/ast27/Python/ast.c:2028:(.text+0x15ac): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_Py_asdl_int_seq_new'
/home/phili/typed_ast/ast27/Python/ast.c:2031: undefined reference to `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/ast.c:2031:(.text+0x15cf): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_Py_asdl_seq_new'
build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/ast.o: In function `ast_for_atom':
/home/phili/typed_ast/ast27/Python/ast.c:1597: undefined reference to `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/ast.c:1597:(.text+0x17dc): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/ast.c:1601: undefined reference to `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/ast.c:1601:(.text+0x17f3): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_Py_asdl_seq_new'
build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/ast.o: In function `ast_for_trailer':
/home/phili/typed_ast/ast27/Python/ast.c:1817: undefined reference to `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/ast.c:1817:(.text+0x193a): additional relocation overflows omitted from the output
/home/phili/typed_ast/ast27/Python/ast.c:1833: undefined reference to `_Py_asdl_seq_new'
build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/ast.o:/home/phili/typed_ast/ast27/Python/ast.c:1578: more undefined references to `_Py_asdl_seq_new' follow
build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/Python-ast.o: In function `obj2ast_expr':
/home/phili/typed_ast/ast27/Python/Python-ast.c:5516: undefined reference to `_Py_asdl_int_seq_new'
/home/phili/typed_ast/ast27/Python/Python-ast.c:5593: undefined reference to `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/Python-ast.c:5541: undefined reference to `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/Python-ast.c:5618: undefined reference to `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/Python-ast.c:5880: undefined reference to `_Py_asdl_seq_new'
/home/phili/typed_ast/ast27/Python/Python-ast.c:5929: undefined reference to `_Py_asdl_seq_new'
build/temp.cygwin-2.6.0-x86_64-3.4/ast27/Python/Python-ast.o:/home/phili/typed_ast/ast27/Python/Python-ast.c:5284: more undefined references to `_Py_asdl_seq_new' follow
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
/edit: Same for 32 Bit and MSYS2.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
ddfisher commentedon Aug 23, 2016
Thanks for the bug report! I won't have time to investigate this soon, unfortunately, and I don't have much experience developing on Windows systems.
If you have the time and the inclination, PRs very welcome!
refi64 commentedon Aug 23, 2016
Question: what version of GCC are you using?
Herst commentedon Aug 24, 2016
Cygwin:
MSYS2:
At first I thought the issue might be just some wrong environment variable but apparently it's more than that or I was looking at the wrong place.
Herst commentedon Sep 17, 2016
The following Cygwin mailing list thread is probably related as it hints on what could be at fault here: https://www.cygwin.com/ml/cygwin/2016-09/threads.html#00063
Summary: Python apparently assumes it is being compiled under native Windows using MSVC. Checking out the Cygwin-specific patches might yield some hints at what should be done, it could be that change some
#ifblocks might suffice.gvanrossum commentedon Sep 17, 2016
Getting typed_ast to work with Cygwin is always going to be a struggle. None of the developers use Cygwin. Honestly we don't even use Windows, but we are committed to make it work with the standard Python installers for Windows from python.org. Of course you can submit PRs with patches, and we may even accept those of they don't interfere with our other goals, but we won't have any QA time dedicated to make sure that typed_ast or mypy keeps working on Cygwin.
Maybe if enough Cygwin enthusiasts care you can just fork the project and maintain your patches there?
Herst commentedon Jan 6, 2017
It works now, probably because of a3f63eb and maybe also because of some changes on Cygwin's side:
ddfisher commentedon Jan 6, 2017
Great! Thanks for the update.
Merge pull request python#11 from darkk/master