aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Gehweiler <44170764+jgehw@users.noreply.github.com>2021-06-01 20:49:53 +0200
committerGitHub <noreply@github.com>2021-06-01 11:49:53 -0700
commit56ca13c9722e3fd418a9b8f96300c0c2a9e678dd (patch)
tree97cd9b31fd858a81be112d445ba7014a925c7186
parent482149c68bd657ff38b2290daa976335b944927d (diff)
downloadvcpkg-56ca13c9722e3fd418a9b8f96300c0c2a9e678dd.tar.gz
vcpkg-56ca13c9722e3fd418a9b8f96300c0c2a9e678dd.zip
[tensorflow-common] check for invalid username (#18111)
* Revert "incorporate changes from microsoft:master" * Revert "Revert "incorporate changes from microsoft:master"" * added check for spaces in username (unsupported by bazel) * apply a work-around with custom build root instead of terminating build when username contains spaces * x-add-version * Add check for spaces in vcpkg path. Keep non-Windows build output in vcpkg subfolders because it easily sums up to 100GB. So users have only one place to cleanup. * vcpkg x-add-version * fix typo * re-run x-add-version Co-authored-by: jgehw <Joachim_Gehweiler@McAfee.com>
-rw-r--r--ports/tensorflow-common/tensorflow-common.cmake23
-rw-r--r--ports/tensorflow-common/vcpkg.json2
-rw-r--r--versions/baseline.json2
-rw-r--r--versions/t-/tensorflow-common.json5
4 files changed, 23 insertions, 9 deletions
diff --git a/ports/tensorflow-common/tensorflow-common.cmake b/ports/tensorflow-common/tensorflow-common.cmake
index 4746fcda4..90cba9197 100644
--- a/ports/tensorflow-common/tensorflow-common.cmake
+++ b/ports/tensorflow-common/tensorflow-common.cmake
@@ -18,7 +18,17 @@ vcpkg_find_acquire_program(GIT)
get_filename_component(GIT_DIR "${GIT}" DIRECTORY)
vcpkg_add_to_path(PREPEND ${GIT_DIR})
+string(FIND "${CURRENT_BUILDTREES_DIR}" " " POS)
+if(NOT POS EQUAL -1)
+ message(FATAL_ERROR "Your vcpkg path contains spaces. This is not supported by the bazel build tool. Aborting.")
+endif()
+
if(CMAKE_HOST_WIN32)
+ string(FIND "$ENV{USERNAME}" " " POS)
+ if(NOT POS EQUAL -1)
+ message(WARNING "Your Windows username '$ENV{USERNAME}' contains spaces. Applying work-around to bazel. Be warned of possible further issues.")
+ endif()
+
vcpkg_acquire_msys(MSYS_ROOT PACKAGES bash unzip patch diffutils libintl gzip coreutils mingw-w64-x86_64-python-numpy)
vcpkg_add_to_path(${MSYS_ROOT}/usr/bin)
vcpkg_add_to_path(${MSYS_ROOT}/mingw64/bin)
@@ -44,9 +54,6 @@ set(ENV{PYTHON_LIB_PATH} "${PYTHON_LIB_PATH}")
# check if numpy can be loaded
vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import numpy" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy-${TARGET_TRIPLET})
-# tensorflow has long file names, which will not work on windows
-set(ENV{TEST_TMPDIR} "${CURRENT_BUILDTREES_DIR}/.bzl")
-
set(ENV{USE_DEFAULT_PYTHON_LIB_PATH} 1)
set(ENV{TF_NEED_KAFKA} 0)
set(ENV{TF_NEED_OPENCL_SYCL} 0)
@@ -219,14 +226,15 @@ foreach(BUILD_TYPE dbg rel)
list(JOIN COPTS " " COPTS)
list(JOIN CXXOPTS " " CXXOPTS)
list(JOIN LINKOPTS " " LINKOPTS)
+ # use --output_user_root to work-around too-long-path-names issue and username-with-spaces issue
vcpkg_execute_build_process(
- COMMAND ${BASH} --noprofile --norc -c "'${BAZEL}' build --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path='${PYTHON3}' --define=no_tensorflow_py_deps=true ///tensorflow:${BAZEL_LIB_NAME} ///tensorflow:install_headers"
+ COMMAND ${BASH} --noprofile --norc -c "'${BAZEL}' --output_user_root='${CURRENT_BUILDTREES_DIR}/.bzl' build --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path='${PYTHON3}' --define=no_tensorflow_py_deps=true ///tensorflow:${BAZEL_LIB_NAME} ///tensorflow:install_headers"
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}
LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE}
)
else()
vcpkg_execute_build_process(
- COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} ${COPTS} ${CXXOPTS} ${LINKOPTS} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers
+ COMMAND ${BAZEL} --output_user_root=${CURRENT_BUILDTREES_DIR}/.bzl build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} ${COPTS} ${CXXOPTS} ${LINKOPTS} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}
LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE}
)
@@ -243,14 +251,15 @@ foreach(BUILD_TYPE dbg rel)
list(JOIN COPTS " " COPTS)
list(JOIN CXXOPTS " " CXXOPTS)
list(JOIN LINKOPTS " " LINKOPTS)
+ # use --output_user_root to work-around too-long-path-names issue and username-with-spaces issue
vcpkg_execute_build_process(
- COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path='${PYTHON3}' --define=no_tensorflow_py_deps=true ///tensorflow:${BAZEL_LIB_NAME} ///tensorflow:install_headers"
+ COMMAND ${BASH} --noprofile --norc -c "${BAZEL} --output_user_root='${CURRENT_BUILDTREES_DIR}/.bzl' build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path='${PYTHON3}' --define=no_tensorflow_py_deps=true ///tensorflow:${BAZEL_LIB_NAME} ///tensorflow:install_headers"
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}
LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE}
)
else()
vcpkg_execute_build_process(
- COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers
+ COMMAND ${BAZEL} --output_user_root=${CURRENT_BUILDTREES_DIR}/.bzl build -s --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}
LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE}
)
diff --git a/ports/tensorflow-common/vcpkg.json b/ports/tensorflow-common/vcpkg.json
index 447d665b5..35d2fdb26 100644
--- a/ports/tensorflow-common/vcpkg.json
+++ b/ports/tensorflow-common/vcpkg.json
@@ -1,7 +1,7 @@
{
"name": "tensorflow-common",
"version-semver": "2.4.1",
- "port-version": 1,
+ "port-version": 2,
"description": "This meta package holds common files for the C [tensorflow] and the C++ [tensorflow-cc] API version of TensorFlow but is not installable on its own.",
"homepage": "https://github.com/tensorflow/tensorflow"
}
diff --git a/versions/baseline.json b/versions/baseline.json
index 0611e4e8d..841a0fa5f 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -6082,7 +6082,7 @@
},
"tensorflow-common": {
"baseline": "2.4.1",
- "port-version": 1
+ "port-version": 2
},
"tensorpipe": {
"baseline": "2021-04-26",
diff --git a/versions/t-/tensorflow-common.json b/versions/t-/tensorflow-common.json
index fc8ec6df0..3ac6d830e 100644
--- a/versions/t-/tensorflow-common.json
+++ b/versions/t-/tensorflow-common.json
@@ -1,6 +1,11 @@
{
"versions": [
{
+ "git-tree": "84ba326c66ab77faaf3e59d8eb3f04ffa155a4bb",
+ "version-semver": "2.4.1",
+ "port-version": 2
+ },
+ {
"git-tree": "c2a11af14488e643cf0a07f676d08319a0f70f08",
"version-semver": "2.4.1",
"port-version": 1