Merge pull request #4262 from davidzchen/pip-package
Exclude external/local_config_cuda from being built into the PIP package
This commit is contained in:
commit
2a6d7511f1
@ -17,6 +17,14 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
function cp_external() {
|
||||||
|
local src_dir=$1
|
||||||
|
local dest_dir=$2
|
||||||
|
for f in `find "$src_dir" -maxdepth 1 -mindepth 1 ! -name '*local_config_cuda*'`; do
|
||||||
|
cp -R "$f" "$dest_dir"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
if [ $# -lt 1 ] ; then
|
if [ $# -lt 1 ] ; then
|
||||||
echo "No destination dir provided"
|
echo "No destination dir provided"
|
||||||
@ -36,15 +44,23 @@ function main() {
|
|||||||
if [ ! -d bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow ]; then
|
if [ ! -d bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow ]; then
|
||||||
# Really old (0.2.1-) runfiles, without workspace name.
|
# Really old (0.2.1-) runfiles, without workspace name.
|
||||||
cp -R \
|
cp -R \
|
||||||
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/{tensorflow,external} \
|
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/tensorflow \
|
||||||
"${TMPDIR}"
|
"${TMPDIR}"
|
||||||
|
mkdir "${TMPDIR}/external"
|
||||||
|
cp_external \
|
||||||
|
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/external \
|
||||||
|
"${TMPDIR}/external"
|
||||||
RUNFILES=bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles
|
RUNFILES=bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles
|
||||||
else
|
else
|
||||||
if [ -d bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external ]; then
|
if [ -d bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external ]; then
|
||||||
# Old-style runfiles structure (--legacy_external_runfiles).
|
# Old-style runfiles structure (--legacy_external_runfiles).
|
||||||
cp -R \
|
cp -R \
|
||||||
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/{tensorflow,external} \
|
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/tensorflow \
|
||||||
"${TMPDIR}"
|
"${TMPDIR}"
|
||||||
|
mkdir "${TMPDIR}/external"
|
||||||
|
cp_external \
|
||||||
|
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external \
|
||||||
|
"${TMPDIR}/external"
|
||||||
else
|
else
|
||||||
# New-style runfiles structure (--nolegacy_external_runfiles).
|
# New-style runfiles structure (--nolegacy_external_runfiles).
|
||||||
cp -R \
|
cp -R \
|
||||||
@ -52,7 +68,7 @@ function main() {
|
|||||||
"${TMPDIR}"
|
"${TMPDIR}"
|
||||||
mkdir "${TMPDIR}/external"
|
mkdir "${TMPDIR}/external"
|
||||||
# Note: this makes an extra copy of org_tensorflow.
|
# Note: this makes an extra copy of org_tensorflow.
|
||||||
cp -R \
|
cp_external \
|
||||||
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles \
|
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles \
|
||||||
"${TMPDIR}/external"
|
"${TMPDIR}/external"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user