!24 升级bazel到5.3.0

From: @wisespreading 
Reviewed-by: @wx_4dd73e36e4, @zhunaipan 
Signed-off-by: @wx_4dd73e36e4, @zhunaipan
This commit is contained in:
openeuler-ci-bot 2023-09-08 14:29:17 +00:00 committed by Gitee
commit 5f9ea9b2c9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 29 additions and 34 deletions

View File

@ -1,8 +1,8 @@
%define _disable_source_fetch 0
Name: bazel
Version: 5.1.1
Release: 1
Version: 5.3.0
Release: 0
Summary: Correct, reproducible, and fast builds for everyone.
License: Apache License 2.0
URL: http://bazel.io/
@ -96,6 +96,9 @@ env ./scripts/generate_bash_completion.sh --bazel=output/bazel --output=output/b
%attr(0755,root,root) %{bashcompdir}/bazel
%changelog
* Fri Sep 08 2023 Jincheng Miao <jincheng.miao@intel.com> - 5.3.0-0
- upgrade bazel to 5.3.0 for building TF-2.12.1
* Fri Jun 09 2023 Jingwiw <wangjingwei@iscas.ac.cn> - 5.1.1-1
- fix riscv64 build error and add qemu user support

View File

@ -62,45 +62,37 @@ index c2e8e1f..33d1a96 100755
char pathbuf[PROC_PIDPATHINFO_MAXSIZE] = {};
int len = proc_pidpath(getpid(), pathbuf, sizeof(pathbuf));
if (len == 0) {
diff --git a/src/main/cpp/blaze_util_linux.cc b/src/main/cpp/blaze_util_linux.cc
diff --git a/src/main/cpp/get_self_path_linux.cc b/src/main/cpp/get_self_path_linux.cc
index 2183d43..3e75ef0 100755
--- a/src/main/cpp/blaze_util_linux.cc
+++ b/src/main/cpp/blaze_util_linux.cc
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h> // strerror
+#include <sys/auxv.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/statfs.h>
@@ -29,6 +30,7 @@
#include "src/main/cpp/blaze_util.h"
--- a/src/main/cpp/get_self_path_linux.cc 2023-09-07 09:45:41.310000000 +0000
+++ b/src/main/cpp/get_self_path_linux.cc 2023-09-07 09:47:28.512000000 +0000
@@ -14,8 +14,10 @@
#include <unistd.h>
#include <limits.h>
+#include <sys/auxv.h>
#include "src/main/cpp/blaze_util_platform.h"
+#include "src/main/cpp/startup_options.h"
#include "src/main/cpp/util/errors.h"
#include "src/main/cpp/util/exit_code.h"
#include "src/main/cpp/util/file.h"
@@ -82,11 +84,13 @@ void WarnFilesystemType(const blaze_util::Path &output_base) {
}
}
#include "src/main/cpp/util/logging.h"
@@ -25,7 +27,14 @@ namespace blaze {
using blaze_util::GetLastErrorString;
using std::string;
-string GetSelfPath(const char* argv0) {
- // The file to which this symlink points could change contents or go missing
- // concurrent with execution of the Bazel client, so we don't eagerly resolve
- // it.
- return "/proc/self/exe";
+string GetSelfPath(const char* argv0, const StartupOptions &options) {
+ // Sometimes /proc/self/exec isn't valid (binfmt_misc + qemu)
+ // so we provide an alternate API. e.g. Linux aarch64 running
+ // bazel-x86_64-linux
+ if (options.linux_bazel_path_from_getauxval) {
+ return reinterpret_cast<const char *>(getauxval(AT_EXECFN));
+ }
}
uint64_t GetMillisecondsMonotonic() {
+ // Sometimes /proc/self/exec isn't valid (binfmt_misc + qemu)
+ // so we provide an alternate API. e.g. Linux aarch64 running
+ // bazel-x86_64-linux
+ if (options.linux_bazel_path_from_getauxval) {
+ return reinterpret_cast<const char *>(getauxval(AT_EXECFN));
+ }
+
char buffer[PATH_MAX] = {};
ssize_t bytes = readlink("/proc/self/exe", buffer, sizeof(buffer));
if (bytes == sizeof(buffer)) {
diff --git a/src/main/cpp/blaze_util_platform.h b/src/main/cpp/blaze_util_platform.h
index 42075f1..54afa8e 100755
--- a/src/main/cpp/blaze_util_platform.h