At this moment the port doesn't even build due to strange compiler/linker bug. The Diff is created to make it easier to reproduce that bug.
I'll proceed shaping the port after it is fixed.
Details
- Reviewers
0mp - Group Reviewers
Contributor Reviewers (ports)
Diff Detail
- Lint
No Lint Coverage - Unit
No Test Coverage - Build Status
Buildable 24033 Build 22918: arc lint + arc unit
Event Timeline
science/tensorflow-core/Makefile | ||
---|---|---|
12 | Missing LICENSE_FILE=${WRKSRC}/LICENSE. |
science/tensorflow-core/Makefile | ||
---|---|---|
15 | What should be done then? There is no USES=python:fetch. |
science/tensorflow-core/Makefile | ||
---|---|---|
49–52 |
I'm doomed, then? For build systems like Bazel or Haskell Stack it is extremely difficult to prepare all required distfiles, because they tend to download them themselves. I can try going hardcore way by examining what and where to gets downloaded and then make up distinfo from that, but maybe there is another way? I was suspecting I can't access network after fetch, but I'm really surprised that I can't touch WRKDIR during fetch. Why is that? |
science/tensorflow-core/Makefile | ||
---|---|---|
49–52 | Because it is created during the extract phase. I think the correct way to go is to create a USES=bazel that works the same way as USES=cargo, in two steps, one for the maintainer to generate a list of stuff to download, and add to the Makefile, and then for the build system to use that to download stuff. |
science/tensorflow-core/Makefile | ||
---|---|---|
49–52 | Unlike Cargo, Bazel fetches distfiles from various sources (like, https://github.com/grpc/grpc/archive/v1.13.0.tar.gz and https://curl.haxx.se/download/curl-7.60.0.tar.gz). We'll end up with huge MASTER_SITES list and huge distinfo. Should we really follow this path? If we can't unpack to WRKDIR, maybe some other temporary dir will do? DISTDIR even? |
science/tensorflow-core/Makefile | ||
---|---|---|
49–52 | I'm not sure having a huge MASTER_SITES is a problem, as it would be automatically generated. |
science/tensorflow-core/Makefile | ||
---|---|---|
49–52 | As I said, automatic generation isn't easily implemetable for Bazel's BUILD files. For instance, TensorFlow has clauses like tf_http_archive( name = "grpc", sha256 = "50db9cf2221354485eb7c3bd55a4c27190caef7048a2a1a15fbe60a498f98b44", strip_prefix = "grpc-1.13.0", system_build_file = clean_dep("//third_party/systemlibs:grpc.BUILD"), urls = [ "https://mirror.bazel.build/github.com/grpc/grpc/archive/v1.13.0.tar.gz", "https://github.com/grpc/grpc/archive/v1.13.0.tar.gz", ], ) scattered,possibly, over several .bzl files. We can parse it out, of course, but this would be TensorFlow-specific anyways. And since it is me who will be doing all the heavy-lifting, I'd like to hear if extracting into some temporary dir during fetch step is an absolute "no-no", before going this gross (in my opinion) way. |
Take repackaging route, like wine-i386.
I was able to produce libtensorflow.so and this port installs repackaged binary. This approach is also working for Python bindings, but this are currently failing due to external deps.
science/tensorflow-core/Makefile | ||
---|---|---|
30 | The 3.6 here should probably not be hardcoded. | |
46–47 | This can be done in one step: git clone -b v${DISTVERSION} https://github.com/tensorflow/tensorflow tensorflow-${DISTVERSION} Also, if you don't care about the history, you could add a --depth 1 to speed up the download (goes from 350MB down to 45MB). |
The current port doesn't provide libtensorflow.so, which is required for Haskell bindings, but it's better to build upon that, rather that this solution, which requires repackaging.