From 5945950b251ebf5c58b0ff36663a1c1d67e4e3c5 Mon Sep 17 00:00:00 2001 From: jgehw <44170764+jgehw@users.noreply.github.com> Date: Fri, 7 Aug 2020 21:08:51 +0200 Subject: [PATCH] [tensorflow-cc] fix build issues on Windows (#12546) * fix build issues occurring from default bazel config being used because customized bazel config is stored in wrong directory * [tensorflow-cc] Update CONTROL and ci.baseline.txt * fix also applies to windows static build * Revert "fix also applies to windows static build" * leave variables unset in order to let bazel auto-detect them the same way it auto-detects include path avoiding mismatches between toolset and include files versions * bazel VC auto-detect doesn't work (it ends up in a dev command prompt and tries to parse it), so fix the issue of inconsistency of toolset versions between auto-detection in vcpkg and bazel by letting vcpkg determine everything including toolset version * see if updating really outdated bazel fixes finding correct VC tools on Azure DevOps * setting x64-windows CI to fail again It doesn't work if more than one VC toolkit is installed. Likely a bug in bazel. bazel is currently v3.4.1, however tensorflow v1.14 requires really outdated bazel v0.25. Going to upgrade tensorflow to v2.3 and then using up-to-date bazel, but will do this in a separate pull request, as it requires more work. * revert bazel upgrade as tensorflow v1.14 requires outdated bazel 0.25 Co-authored-by: Gehweiler Co-authored-by: wangli28 --- ports/tensorflow-cc/CONTROL | 3 ++- ports/tensorflow-cc/portfile.cmake | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index a9830adb24..6fa024164b 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,5 +1,6 @@ Source: tensorflow-cc -Version: 1.14-3 +Version: 1.14 +Port-Version: 4 Description: Library for computation using data flow graphs for scalable machine learning Build-Depends: c-ares Supports: !x86 diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 8d2c187b05..fdd95307c4 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -47,6 +47,7 @@ if(CMAKE_HOST_WIN32) set(ENV{BAZEL_VS} $ENV{VSInstallDir}) set(ENV{BAZEL_VC} $ENV{VCInstallDir}) + set(ENV{BAZEL_VC_FULL_VERSION} $ENV{VCToolsVersion}) endif() # tensorflow has long file names, which will not work on windows @@ -79,7 +80,7 @@ set(ENV{TF_CONFIGURE_IOS} 0) message(STATUS "Configuring TensorFlow") vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py + COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py --workspace "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME config-${TARGET_TRIPLET}-rel )