FS#64437 - [ledger] Python support got removed in 3.1.3-3

Attached to Project: Community Packages
Opened by Baptiste (zorun) - Saturday, 09 November 2019, 18:36 GMT
Last edited by Ivy Foster (escondida) - Friday, 01 May 2020, 23:11 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Baptiste (zorun)
Ivy Foster (escondida)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Up until ledger 3.1.3-2, the ledger Python library was bundled with the package and working. However, it got removed in ledger 3.1.3-3, and the commit message does not explain why.

Can you please enable Python support again?
This task depends upon

Closed by  Ivy Foster (escondida)
Friday, 01 May 2020, 23:11 GMT
Reason for closing:  Fixed
Additional comments about closing:  Ledger 3.2.0 includes python3 support.
Comment by Baptiste (zorun) - Saturday, 09 November 2019, 18:48 GMT
Hmm, right, building with python support seems to be failing :/

I'll see if I can fix it. Do you have any objection if I push a patch to fix & re-enable python support?

<pre>
[ 98%] Linking CXX executable ../ledger
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_AsUTF8String'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_FromFormat'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyModule_Create2'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_FromString'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `_Py_fopen'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_FromStringAndSize'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyBytes_AsString'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyBytes_Size'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_AsWideChar'
/usr/bin/ld: ../libledger.so.3: undefined reference to `boost::python::detail::init_module(char const*, void (*)())'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_FromEncodedObject'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_AsUTF8'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_InternFromString'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/ledger.dir/build.make:111: ledger] Error 1
make[1]: *** [CMakeFiles/Makefile2:98: src/CMakeFiles/ledger.dir/all] Error 2
[100%] Linking CXX executable ../../MathTests
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_AsUTF8String'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_FromFormat'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyModule_Create2'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_FromString'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `_Py_fopen'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_FromStringAndSize'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyBytes_AsString'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyBytes_Size'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_AsWideChar'
/usr/bin/ld: ../../libledger.so.3: undefined reference to `boost::python::detail::init_module(char const*, void (*)())'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_FromEncodedObject'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_AsUTF8'
/usr/bin/ld: /usr/lib64/libboost_python37.so.1.71.0: undefined reference to `PyUnicode_InternFromString'
collect2: error: ld returned 1 exit status
make[2]: *** [test/unit/CMakeFiles/MathTests.dir/build.make:156: MathTests] Error 1
make[1]: *** [CMakeFiles/Makefile2:310: test/unit/CMakeFiles/MathTests.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
</pre>
Comment by Baptiste (zorun) - Saturday, 09 November 2019, 18:57 GMT
Alright, the fix is simple, we just need to pass another option to cmake: -DUSE_PYTHON27_COMPONENT:BOOL=TRUE
Comment by loqs (loqs) - Saturday, 09 November 2019, 20:38 GMT
Is python2 support going to be maintained after the upstream EOL on January 1, 2020?
Otherwise you would only be adding the feature back for seven weeks.
Comment by Ivy Foster (escondida) - Sunday, 15 December 2019, 22:28 GMT
Upstream's added python3 support to git master, so hopefully we'll see a release of that at some point. My bad (and good) on dropping python2.

https://github.com/ledger/ledger/compare/v3.1.3...master
Comment by Ivy Foster (escondida) - Friday, 01 May 2020, 23:11 GMT
Ledger 3.2.0 enables python3 support.

Loading...