tensorflow/decision-forests

incorrect regex causes injection of tensorflow during build to fail

mowoe opened this issue · 0 comments

mowoe commented

In test_bazel.sh#L61, a regular expression is used to parse the raw html of a github commit page in order to retrieve the long commit hash from a short one.

While trying to build, my tensorflow version is at tensorflow/tensorflow@0db597d0.
This commits long hash is 0db597d0d758aba578783b5bf46c889700a45085.
However, the regex produces 0db597d0d758aba578783b5bf46c889700a45, which is four chars short (the regex limits it at 29 chars, which is incorrect):

$ curl -SsL https://github.com/tensorflow/tensorflow/commit/0db597d0 2>/dev/null |  grep -o -m 1 '0db597d0\([0-9]\|[a-f]\)\{29\}'

0db597d0d758aba578783b5bf46c889700a45

This causes the injection of tensorflow to fail during build:

$ bazel --bazelrc=tensorflow_bazelrc build //tensorflow_decision_forests/component/...:all //tensorflow_decision_forests/contrib/...:all //tensorflow_decision_forests/keras //tensorflow_decision_forests/keras:grpc_worker_main --config=linux --action_env TF_HEADER_DIR=/usr/local/lib/python3.10/site-packages/tensorflow/include --action_env TF_SHARED_LIBRARY_DIR=/usr/local/lib/python3.10/site-packages/tensorflow --action_env TF_SHARED_LIBRARY_NAME=libtensorflow_framework.so.2

...
ERROR: An error occurred during the fetch of repository 'org_tensorflow':
   Traceback (most recent call last):
	File "/root/.cache/bazel/_bazel_root/8b529a028cc7ed10f109d406a8d13d99/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
		download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /root/.cache/bazel/_bazel_root/8b529a028cc7ed10f109d406a8d13d99/external/org_tensorflow/temp13364651896073939090/0db597d0d758aba578783b5bf46c889700a45.zip to /root/.cache/bazel/_bazel_root/8b529a028cc7ed10f109d406a8d13d99/external/org_tensorflow/temp13364651896073939090: Prefix "tensorflow-0db597d0d758aba578783b5bf46c889700a45" was given, but not found in the archive. Here are possible prefixes for this archive: "tensorflow-0db597d0d758aba578783b5bf46c889700a45085".
ERROR: /decision-forests/WORKSPACE:12:13: fetching http_archive rule //external:org_tensorflow: Traceback (most recent call last):
	File "/root/.cache/bazel/_bazel_root/8b529a028cc7ed10f109d406a8d13d99/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
		download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /root/.cache/bazel/_bazel_root/8b529a028cc7ed10f109d406a8d13d99/external/org_tensorflow/temp13364651896073939090/0db597d0d758aba578783b5bf46c889700a45.zip to /root/.cache/bazel/_bazel_root/8b529a028cc7ed10f109d406a8d13d99/external/org_tensorflow/temp13364651896073939090: Prefix "tensorflow-0db597d0d758aba578783b5bf46c889700a45" was given, but not found in the archive. Here are possible prefixes for this archive: "tensorflow-0db597d0d758aba578783b5bf46c889700a45085".
ERROR: Error computing the main repository mapping: no such package '@org_tensorflow//tensorflow': java.io.IOException: Error extracting /root/.cache/bazel/_bazel_root/8b529a028cc7ed10f109d406a8d13d99/external/org_tensorflow/temp13364651896073939090/0db597d0d758aba578783b5bf46c889700a45.zip to /root/.cache/bazel/_bazel_root/8b529a028cc7ed10f109d406a8d13d99/external/org_tensorflow/temp13364651896073939090: Prefix "tensorflow-0db597d0d758aba578783b5bf46c889700a45" was given, but not found in the archive. Here are possible prefixes for this archive: "tensorflow-0db597d0d758aba578783b5bf46c889700a45085".