Bug 234409 - lang/python37: Python 3.7.2 fails to build
Summary: lang/python37: Python 3.7.2 fails to build
Status: Closed DUPLICATE of bug 232510
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Kubilay Kocak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-26 10:03 UTC by Simeon Simeonov
Modified: 2018-12-29 02:11 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (python)


Attachments
Patch to fix install of python37 (583 bytes, text/plain)
2018-12-26 13:31 UTC, Wen Heping
no flags Details
Successful build log after applying Wen's patch (822.34 KB, text/plain)
2018-12-29 01:04 UTC, hakan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simeon Simeonov 2018-12-26 10:03:26 UTC
The latest port python37-3.7.2 fails to build with:

--- Programs/_testembed ---
cc -pthread  -L/usr/local/lib -Wl,-rpath,/usr/local/lib -fstack-protector    -Wl,--export-dynamic -o Programs/_testembed Programs/_testembed.o -L. -lpython3.7m -lintl -ldl -L/usr/local/lib -lintl -lutil   -lm  
Programs/_testembed.o: In function `dump_config':
_testembed.c:(.text+0xfac): undefined reference to `_Py_GetGlobalVariablesAsDict'
_testembed.c:(.text+0xff7): undefined reference to `_PyCoreConfig_AsDict'
_testembed.c:(.text+0x103c): undefined reference to `_PyMainInterpreterConfig_AsDict'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
--- pybuilddir.txt ---
LD_LIBRARY_PATH=/usr/ports/lang/python37/work/Python-3.7.2 ./python -E -S -m sysconfig --generate-posix-vars ; if test $? -ne 0 ; then  echo "generate-posix-vars failed" ;  rm -f ./pybuilddir.txt ;  exit 1 ;  fi
--- Programs/_testembed ---
*** [Programs/_testembed] Error code 1

make[2]: stopped in /usr/ports/lang/python37/work/Python-3.7.2
1 error

make[2]: stopped in /usr/ports/lang/python37/work/Python-3.7.2
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/python37
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/python37
Comment 1 Simeon Simeonov 2018-12-26 11:04:23 UTC
The port builds just fine on a completely "fresh" system / jail.
That is system with no preexisting python3 installation.
The problem seems to be similar to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=232510
Comment 2 Wen Heping freebsd_committer freebsd_triage 2018-12-26 13:31:21 UTC
Created attachment 200526 [details]
Patch to fix install of python37

Would you have a test of it ?
Thanks !

wen
Comment 3 hakan 2018-12-28 10:55:08 UTC
What is the right way to apply this patch? I ran

patch /usr/ports/lang/python37/work/Python-3.7.2/Makefile.pre.in.orig ~/python372patch

to apply it without an error but then running

portmaster -d lang/python37

results in

/usr/bin/ld: error: undefined symbol: _Py_GetGlobalVariablesAsDict
>>> referenced by _testembed.c
>>>               Programs/_testembed.o:(dump_config)
/usr/bin/ld: error: undefined symbol: _PyCoreConfig_AsDict
>>> referenced by _testembed.c
>>>               Programs/_testembed.o:(dump_config)

/usr/bin/ld: error: undefined symbol: _PyMainInterpreterConfig_AsDict
>>> referenced by _testembed.c
>>>               Programs/_testembed.o:(dump_config)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [Programs/_testembed] Error code 1

make[2]: stopped in /usr/ports/lang/python37/work/Python-3.7.2
1 error

make[2]: stopped in /usr/ports/lang/python37/work/Python-3.7.2
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1
Comment 4 wen 2018-12-28 13:04:25 UTC
(In reply to hakan from comment #3)
Just put this patch into files directory.
Comment 5 hakan 2018-12-28 13:54:26 UTC
(In reply to wen from comment #4)
Alright, I just did that and now the error as changed slightly:


--- Programs/_testembed ---
/usr/bin/ld: error: undefined symbol: _Py_GetGlobalVariablesAsDict
>>> referenced by _testembed.c
>>>               Programs/_testembed.o:(dump_config)

/usr/bin/ld: error: undefined symbol: _PyCoreConfig_AsDict
>>> referenced by _testembed.c
>>>               Programs/_testembed.o:(dump_config)

/usr/bin/ld: error: undefined symbol: _PyMainInterpreterConfig_AsDict
>>> referenced by _testembed.c
>>>               Programs/_testembed.o:(dump_config)
--- pybuilddir.txt ---
LD_LIBRARY_PATH=/usr/ports/lang/python37/work/Python-3.7.2 ./python -E -S -m sysconfig --generate-posix-vars ; if test $? -ne 0 ; then  echo "generate-posix-vars failed" ;  rm -f ./pybuilddir.txt ;  exit 1 ;  fi
--- Programs/_testembed ---
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [Programs/_testembed] Error code 1

make[2]: stopped in /usr/ports/lang/python37/work/Python-3.7.2
1 error

make[2]: stopped in /usr/ports/lang/python37/work/Python-3.7.2
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/python37
*** Error code 1
Comment 6 hakan 2018-12-28 13:56:48 UTC
(In reply to hakan from comment #5)
I forgot to mention it but I also ran

make clean

in lang/python37 before the previous try.
Comment 7 wen 2018-12-29 00:48:15 UTC
(In reply to hakan from comment #5)
Would you sent me a complete build log ?
I can build it with the patch when python-3.7.1 installed.

wen
Comment 8 hakan 2018-12-29 01:04:06 UTC
Created attachment 200595 [details]
Successful build log after applying Wen's patch

(In reply to wen from comment #7)

I renamed your patchfile into `patch-issue234409` to obey the naming convention of the other patch files and now I could build and install Python 3.7.2 on top of the already existing 3.7.1 installation. :)

Just in case I attached the log of the successful build.
Comment 9 wen 2018-12-29 01:34:38 UTC
(In reply to hakan from comment #8)
Thanks !

wen
Comment 10 Kubilay Kocak freebsd_committer freebsd_triage 2018-12-29 02:11:29 UTC
This is a duplicate of bug 232510, can we please move the any patches and conversation there please

*** This bug has been marked as a duplicate of bug 232510 ***