aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-framework/tensorflow/tensorboard/0001-customize-for-Yocto.patch
blob: 07d82579fae25c00c815c698a29aa46d3c515224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
From 03b1ddf5058485ce1c94e6a8dc0762ad3430b6a2 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Thu, 25 Apr 2019 21:13:32 +0800
Subject: [PATCH] customize for Yocto

- Remove virtualenv/pip/bdist_wheel calling which Yocto does not support

- Add Yocto toolchain to support cross compiling

Upstream-Status: Inappropriate [oe specific]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 WORKSPACE                                    |  6 ++++++
 tensorboard/pip_package/build_pip_package.sh | 31 +++-------------------------
 third_party/workspace.bzl                    |  8 +++++++
 3 files changed, 17 insertions(+), 28 deletions(-)

diff --git a/WORKSPACE b/WORKSPACE
index 8ab70cc..0c18f6f 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -1,5 +1,11 @@
 workspace(name = "org_tensorflow_tensorboard")
 
+new_local_repository(
+    name = "yocto_compiler",
+    path = "%%WORKDIR%%",
+    build_file = "BUILD.yocto_compiler",
+)
+
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
 
 # Needed as a transitive dependency of rules_webtesting below.
diff --git a/tensorboard/pip_package/build_pip_package.sh b/tensorboard/pip_package/build_pip_package.sh
index 754fa83..969709d 100755
--- a/tensorboard/pip_package/build_pip_package.sh
+++ b/tensorboard/pip_package/build_pip_package.sh
@@ -23,7 +23,7 @@ else
   sedi="sed -i"
 fi
 
-run_smoke_test=1
+run_smoke_test=0
 while [ "$#" -gt 0 ]; do
   case "$1" in
     "--no-smoke")
@@ -71,31 +71,20 @@ from tensorboard.plugins.beholder import Beholder, BeholderHook
 }
 
 set -x
-command -v curl >/dev/null
-command -v perl >/dev/null
-command -v python2 >/dev/null
-command -v python3 >/dev/null
-command -v virtualenv >/dev/null
 [ -d "${RUNFILES}" ]
 
-dest=/tmp/tensorboard
+dest=${DESTDIR}
 if [ ! -e $dest ]; then
-  mkdir $dest
+  mkdir -p $dest
 else
   dest="$(mktemp -d -p /tmp -t tensorboard-pip.XXXXXXXXXX)"
 fi
 cd "${dest}"
 
 cp -LR "${RUNFILES}/org_tensorflow_tensorboard/tensorboard" .
-mv -f "tensorboard/pip_package/LICENSE" .
-mv -f "tensorboard/pip_package/MANIFEST.in" .
-mv -f "tensorboard/pip_package/README.rst" .
-mv -f "tensorboard/pip_package/setup.cfg" .
-mv -f "tensorboard/pip_package/setup.py" .
 rm -rf tensorboard/pip_package
 
 rm -f tensorboard/tensorboard              # bazel py_binary sh wrapper
-chmod -x LICENSE                           # bazel symlinks confuse cp
 find . -name __init__.py | xargs chmod -x  # which goes for all genfiles
 
 mkdir -p tensorboard/_vendor
@@ -117,21 +106,7 @@ find tensorboard -name \*.py |
     s/from tensorflow_serving/from tensorboard._vendor.tensorflow_serving/
   '
 
-virtualenv venv
-export VIRTUAL_ENV=venv
-export PATH="$PWD/venv/bin:${PATH}"
-unset PYTHON_HOME
-
-# Require wheel for bdist_wheel command, and setuptools 36.2.0+ so that
-# env markers are handled (https://github.com/pypa/setuptools/pull/1081)
-pip install -qU wheel 'setuptools>=36.2.0'
-
-python setup.py bdist_wheel --python-tag py2 >/dev/null
-python setup.py bdist_wheel --python-tag py3 >/dev/null
-
 if [ "$run_smoke_test" = 1 ]; then
   smoke 2
   smoke 3
 fi
-
-ls -hal "$PWD/dist"
diff --git a/third_party/workspace.bzl b/third_party/workspace.bzl
index 083c441..24786f8 100644
--- a/third_party/workspace.bzl
+++ b/third_party/workspace.bzl
@@ -24,6 +24,7 @@ load("//third_party:polymer.bzl", "tensorboard_polymer_workspace")
 load("//third_party:python.bzl", "tensorboard_python_workspace")
 load("//third_party:js.bzl", "tensorboard_js_workspace")
 load("//third_party:typings.bzl", "tensorboard_typings_workspace")
+load("//third_party/toolchains/yocto:yocto_compiler_configure.bzl", "yocto_compiler_configure")
 
 def tensorboard_workspace():
   tensorboard_fonts_workspace()
@@ -32,6 +33,13 @@ def tensorboard_workspace():
   tensorboard_typings_workspace()
   tensorboard_js_workspace()
 
+  # Point //external/local_config_yocto_compiler to //external/yocto_compiler
+  yocto_compiler_configure(
+      name = "local_config_yocto_compiler",
+      build_file = str(Label("//third_party/toolchains/yocto:BUILD")),
+      remote_config_repo = "../yocto_compiler",
+  )
+
   http_archive(
       name = "com_google_protobuf_js",
       strip_prefix = "protobuf-3.6.0/js",
-- 
2.7.4