Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664894 - sci-libs/tensorflow-1.10.0 doesn't build with Python3.7
Summary: sci-libs/tensorflow-1.10.0 doesn't build with Python3.7
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jason Zaman
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-08-30 15:20 UTC by Helmut Jarausch
Modified: 2018-09-20 13:30 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch part 1 (tensorflow-1.10.0-py37.patch,2.89 KB, patch)
2018-08-30 15:20 UTC, Helmut Jarausch
Details | Diff
patch part 2 (tensorflow-1.10.0-py37.patch2,1.52 KB, text/plain)
2018-08-30 15:20 UTC, Helmut Jarausch
Details
patch part 3 (tensorflow-1.10.0-py37.patch3,877 bytes, text/plain)
2018-08-30 15:21 UTC, Helmut Jarausch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2018-08-30 15:20:22 UTC
Created attachment 545510 [details, diff]
patch part 1

The current version of tensorflow doesn't build with Python3.7.
The main reason is that Python3.7 has changed the type of the function value of
PyUnicode_AsUTF8AndSize  from char* to const char*

For me it is difficult to try patches since I don't understand the bazel build system.
Furthermore, unfortunately, tensorflow packages a private copy of  dev-python/protobuf-python. For the version in the Gentoo tree there is a patch for Python3.7 already.

But there are more occurrences of PyUnicode_AsUTF8AndSize.

I had to give patching but I attach my patches so far.
I hope this helps somebody who tries to patch tensorflow for Python3.7
Comment 1 Helmut Jarausch 2018-08-30 15:20:45 UTC
Created attachment 545512 [details]
patch part 2
Comment 2 Helmut Jarausch 2018-08-30 15:21:02 UTC
Created attachment 545514 [details]
patch part 3
Comment 3 Jason Zaman gentoo-dev 2018-09-17 11:03:30 UTC
tensorflow-1.11.0_rc0 is in the tree. can you try that one?
I unbundled protobuf in that version if you enable the system-libs useflag (on by default) so the protobuf patches wont be necessary.

The tf patches look like they are already fixed or there has been a lot of code churn so I cant quite find the place. Can you test and if it still fails send new patches then I'll get them committed upstream too?
Comment 4 Helmut Jarausch 2018-09-17 12:29:21 UTC
(In reply to Jason Zaman from comment #3)
> tensorflow-1.11.0_rc0 is in the tree. can you try that one?
> I unbundled protobuf in that version if you enable the system-libs useflag
> (on by default) so the protobuf patches wont be necessary.
> 
> The tf patches look like they are already fixed or there has been a lot of
> code churn so I cant quite find the place. Can you test and if it still
> fails send new patches then I'll get them committed upstream too?

Many thanks, I could successfully build sci-libs/tensorflow-1.11.0_rc0 and
sci-visualization/tensorboard-1.10.0 with Python3.7.

Helmut
Comment 5 Jason Zaman gentoo-dev 2018-09-20 13:30:07 UTC
(In reply to Helmut Jarausch from comment #4)
> Many thanks, I could successfully build sci-libs/tensorflow-1.11.0_rc0 and
> sci-visualization/tensorboard-1.10.0 with Python3.7.

excellent, closing! :)