Migrate TensorFlow for --incompatible_skip_genfiles_symlink

Since Bazel 0.25, both bazel-genfiles and bazel-bin point to the same location.
In Bazel 1.0, bazel-genfiles symlink won't be generated anymore, everything was there are
now merged into bazel-bin folder.

Related: https://github.com/bazelbuild/bazel/issues/8651
PiperOrigin-RevId: 278815738
Change-Id: I0982662ad511e4fae1562a5cdd9c6543d7366480
This commit is contained in:
A. Unique TensorFlower 2019-11-06 02:20:14 -08:00 committed by TensorFlower Gardener
parent f3c0673ad7
commit 6e22de47ad
7 changed files with 14 additions and 14 deletions

View File

@ -137,11 +137,11 @@ For details on the underlying `tfcompile` tool, see
This step uses the header file (`test_graph_tfmatmul.h`) generated by the This step uses the header file (`test_graph_tfmatmul.h`) generated by the
`tf_library` build macro in the previous step to invoke the generated code. The `tf_library` build macro in the previous step to invoke the generated code. The
header file is located in the `bazel-genfiles` directory corresponding to the header file is located in the `bazel-bin` directory corresponding to the
build package, and is named based on the name attribute set on the `tf_library` build package, and is named based on the name attribute set on the `tf_library`
build macro. For example, the header generated for `test_graph_tfmatmul` would build macro. For example, the header generated for `test_graph_tfmatmul` would
be `test_graph_tfmatmul.h`. Below is an abbreviated version of what is be `test_graph_tfmatmul.h`. Below is an abbreviated version of what is
generated. The generated file, in `bazel-genfiles`, contains additional useful generated. The generated file, in `bazel-bin`, contains additional useful
comments. comments.
```c++ ```c++

View File

@ -135,7 +135,7 @@ bazel build --cxxopt='-std=c++11' -c opt \
//tensorflow/lite/java:tensorflow-lite //tensorflow/lite/java:tensorflow-lite
``` ```
This will generate an AAR file in `bazel-genfiles/tensorflow/lite/java/`. Note This will generate an AAR file in `bazel-bin/tensorflow/lite/java/`. Note
that this builds a "fat" AAR with several different architectures; if you don't that this builds a "fat" AAR with several different architectures; if you don't
need all of them, use the subset appropriate for your deployment environment. need all of them, use the subset appropriate for your deployment environment.
From there, there are several approaches you can take to use the .aar in your From there, there are several approaches you can take to use the .aar in your
@ -169,7 +169,7 @@ Execute the following command from your root checkout directory:
```sh ```sh
mvn install:install-file \ mvn install:install-file \
-Dfile=bazel-genfiles/tensorflow/lite/java/tensorflow-lite.aar \ -Dfile=bazel-bin/tensorflow/lite/java/tensorflow-lite.aar \
-DgroupId=org.tensorflow \ -DgroupId=org.tensorflow \
-DartifactId=tensorflow-lite -Dversion=0.1.100 -Dpackaging=aar -DartifactId=tensorflow-lite -Dversion=0.1.100 -Dpackaging=aar
``` ```

View File

@ -109,13 +109,13 @@ bazel build --cxxopt='--std=c++11' -c opt \
//tensorflow/lite/java:tensorflow-lite-with-select-tf-ops //tensorflow/lite/java:tensorflow-lite-with-select-tf-ops
``` ```
This will generate an AAR file in `bazel-genfiles/tensorflow/lite/java/`. From This will generate an AAR file in `bazel-bin/tensorflow/lite/java/`. From
there, you can either import the AAR directly into your project, or publish the there, you can either import the AAR directly into your project, or publish the
custom AAR to your local Maven repository: custom AAR to your local Maven repository:
```sh ```sh
mvn install:install-file \ mvn install:install-file \
-Dfile=bazel-genfiles/tensorflow/lite/java/tensorflow-lite-with-select-tf-ops.aar \ -Dfile=bazel-bin/tensorflow/lite/java/tensorflow-lite-with-select-tf-ops.aar \
-DgroupId=org.tensorflow \ -DgroupId=org.tensorflow \
-DartifactId=tensorflow-lite-with-select-tf-ops -Dversion=0.1.100 -Dpackaging=aar -DartifactId=tensorflow-lite-with-select-tf-ops -Dversion=0.1.100 -Dpackaging=aar
``` ```

View File

@ -86,7 +86,7 @@ cd $TFLITE_DIR/../..
echo "Generate LICENSE files and copy to target" echo "Generate LICENSE files and copy to target"
bazel build //tensorflow/tools/lib_package:clicenses_generate bazel build //tensorflow/tools/lib_package:clicenses_generate
cp $TFLITE_DIR/../../LICENSE $FW_DIR_TFLITE cp $TFLITE_DIR/../../LICENSE $FW_DIR_TFLITE
cp $TFLITE_DIR/../../bazel-genfiles/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES \ cp $TFLITE_DIR/../../bazel-bin/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES \
$FW_DIR_TFLITE $FW_DIR_TFLITE
echo "Copying static libraries" echo "Copying static libraries"

View File

@ -84,7 +84,7 @@ function build_libtensorflow_tarball() {
cp bazel-bin/tensorflow/tools/lib_package/libtensorflow_jni.tar.gz ${DIR}/libtensorflow_jni${TARBALL_SUFFIX}.tar.gz cp bazel-bin/tensorflow/tools/lib_package/libtensorflow_jni.tar.gz ${DIR}/libtensorflow_jni${TARBALL_SUFFIX}.tar.gz
cp bazel-bin/tensorflow/java/libtensorflow.jar ${DIR} cp bazel-bin/tensorflow/java/libtensorflow.jar ${DIR}
cp_normalized_srcjar bazel-bin/tensorflow/java/libtensorflow-src.jar ${DIR}/libtensorflow-src.jar cp_normalized_srcjar bazel-bin/tensorflow/java/libtensorflow-src.jar ${DIR}/libtensorflow-src.jar
cp bazel-genfiles/tensorflow/tools/lib_package/libtensorflow_proto.zip ${DIR} cp bazel-bin/tensorflow/tools/lib_package/libtensorflow_proto.zip ${DIR}
chmod -x ${DIR}/* chmod -x ${DIR}/*
} }

View File

@ -52,7 +52,7 @@ mkdir -p ${DIR}
cp bazel-bin/tensorflow/java/tensorflow_jni.dll ${DIR}/tensorflow_jni.dll cp bazel-bin/tensorflow/java/tensorflow_jni.dll ${DIR}/tensorflow_jni.dll
zip -j ${DIR}/libtensorflow_jni-cpu-windows-$(uname -m).zip \ zip -j ${DIR}/libtensorflow_jni-cpu-windows-$(uname -m).zip \
${DIR}/tensorflow_jni.dll \ ${DIR}/tensorflow_jni.dll \
bazel-genfiles/tensorflow/tools/lib_package/include/tensorflow/THIRD_PARTY_TF_JNI_LICENSES \ bazel-bin/tensorflow/tools/lib_package/include/tensorflow/THIRD_PARTY_TF_JNI_LICENSES \
LICENSE LICENSE
rm -f ${DIR}/tensorflow_jni.dll rm -f ${DIR}/tensorflow_jni.dll
@ -61,7 +61,7 @@ mkdir -p ${DIR}/include/tensorflow/c
mkdir -p ${DIR}/include/tensorflow/c/eager mkdir -p ${DIR}/include/tensorflow/c/eager
mkdir -p ${DIR}/lib mkdir -p ${DIR}/lib
cp bazel-bin/tensorflow/tensorflow.dll ${DIR}/lib/tensorflow.dll cp bazel-bin/tensorflow/tensorflow.dll ${DIR}/lib/tensorflow.dll
cp bazel-genfiles/tensorflow/tensorflow.lib ${DIR}/lib/tensorflow.lib cp bazel-bin/tensorflow/tensorflow.lib ${DIR}/lib/tensorflow.lib
cp tensorflow/c/c_api.h \ cp tensorflow/c/c_api.h \
tensorflow/c/tf_attrtype.h \ tensorflow/c/tf_attrtype.h \
tensorflow/c/tf_datatype.h \ tensorflow/c/tf_datatype.h \
@ -70,7 +70,7 @@ cp tensorflow/c/c_api.h \
${DIR}/include/tensorflow/c ${DIR}/include/tensorflow/c
cp tensorflow/c/eager/c_api.h ${DIR}/include/tensorflow/c/eager cp tensorflow/c/eager/c_api.h ${DIR}/include/tensorflow/c/eager
cp LICENSE ${DIR}/LICENSE cp LICENSE ${DIR}/LICENSE
cp bazel-genfiles/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES ${DIR}/ cp bazel-bin/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES ${DIR}/
cd ${DIR} cd ${DIR}
zip libtensorflow-cpu-windows-$(uname -m).zip \ zip libtensorflow-cpu-windows-$(uname -m).zip \
lib/tensorflow.dll \ lib/tensorflow.dll \

View File

@ -52,7 +52,7 @@ mkdir -p ${DIR}
cp bazel-bin/tensorflow/java/tensorflow_jni.dll ${DIR}/tensorflow_jni.dll cp bazel-bin/tensorflow/java/tensorflow_jni.dll ${DIR}/tensorflow_jni.dll
zip -j ${DIR}/libtensorflow_jni-gpu-windows-$(uname -m).zip \ zip -j ${DIR}/libtensorflow_jni-gpu-windows-$(uname -m).zip \
${DIR}/tensorflow_jni.dll \ ${DIR}/tensorflow_jni.dll \
bazel-genfiles/tensorflow/tools/lib_package/include/tensorflow/THIRD_PARTY_TF_JNI_LICENSES \ bazel-bin/tensorflow/tools/lib_package/include/tensorflow/THIRD_PARTY_TF_JNI_LICENSES \
LICENSE LICENSE
rm -f ${DIR}/tensorflow_jni.dll rm -f ${DIR}/tensorflow_jni.dll
@ -61,7 +61,7 @@ mkdir -p ${DIR}/include/tensorflow/c
mkdir -p ${DIR}/include/tensorflow/c/eager mkdir -p ${DIR}/include/tensorflow/c/eager
mkdir -p ${DIR}/lib mkdir -p ${DIR}/lib
cp bazel-bin/tensorflow/tensorflow.dll ${DIR}/lib/tensorflow.dll cp bazel-bin/tensorflow/tensorflow.dll ${DIR}/lib/tensorflow.dll
cp bazel-genfiles/tensorflow/tensorflow.lib ${DIR}/lib/tensorflow.lib cp bazel-bin/tensorflow/tensorflow.lib ${DIR}/lib/tensorflow.lib
cp tensorflow/c/c_api.h \ cp tensorflow/c/c_api.h \
tensorflow/c/tf_attrtype.h \ tensorflow/c/tf_attrtype.h \
tensorflow/c/tf_datatype.h \ tensorflow/c/tf_datatype.h \
@ -70,7 +70,7 @@ cp tensorflow/c/c_api.h \
${DIR}/include/tensorflow/c ${DIR}/include/tensorflow/c
cp tensorflow/c/eager/c_api.h ${DIR}/include/tensorflow/c/eager cp tensorflow/c/eager/c_api.h ${DIR}/include/tensorflow/c/eager
cp LICENSE ${DIR}/LICENSE cp LICENSE ${DIR}/LICENSE
cp bazel-genfiles/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES ${DIR}/ cp bazel-bin/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES ${DIR}/
cd ${DIR} cd ${DIR}
zip libtensorflow-gpu-windows-$(uname -m).zip \ zip libtensorflow-gpu-windows-$(uname -m).zip \
lib/tensorflow.dll \ lib/tensorflow.dll \