bazel 使用 gtest/gmock 报错 Constraints from @bazel_tools//platforms have been removed
问题描述
运行 bazel test 命令,遇到错误:“Constraints from @bazel_tools//platforms have been removed. Please use constraints from @platforms repository embedded in Bazel, or preferably declare dependency on https://github.com/bazelbuild/platforms. See https://github.com/bazelbuild/bazel/issues/8622 for details”
ERROR: /.../bazel_tools/platforms/BUILD:89:6: in alias rule @bazel_tools//platforms:windows: Constraints from @bazel_tools//platforms have been removed. Please use constraints from @platforms repository embedded in Bazel, or preferably declare dependency on https://github.com/bazelbuild/platforms. See https://github.com/bazelbuild/bazel/issues/8622 for details.
ERROR: /.../bazel_tools/platforms/BUILD:89:6: Analysis of target '@bazel_tools//platforms:windows' failed
ERROR: /.../google/BUILD.bazel:113:11: errors encountered resolving select() keys for @google//:gtest_main
问题分析
该错误是项目使用的 gtest 版本太老,里面用了 @bazel_tools//platforms 这种限制形式,而这一用法在新版的 bazel 中已经废弃,改为内置的 @platforms。
解决方案
解决办法是更新 gtest 的版本。不同项目可能会有差异,无法直接照搬,这里给出的示例仅供参考。修改 WORKSPACE 文件中引入 gtest 的地方,把 url 换成一个新版 gtest 的地址,同时修改 strip_prefix 字段:
http_archive(
name = "google",
strip_prefix = "googletest-5ab508a01f9eb089207ee87fd547d290da39d015",
url = "https://github.com/google/googletest/archive/5ab508a01f9eb089207ee87fd547d290da39d015.zip",
)
bazel 使用 gtest/gmock 报错 Constraints from @bazel_tools//platforms have been removed的更多相关文章
- pandas 使用panel 报错 Panel is deprecated and will be removed in a future version.
Panel is deprecated and will be removed in a future version.The recommended way to represent these t ...
- PHP传引用报错(5.4版本)
php5.3系列版本以及以前版本,传引用没有什么问题,升级到php5.4以后,传引用的地方,全报错 Fatal error: Call-time pass-by-reference has been ...
- Unity打Android包报错总结 长期更新
报错1 Failed to compile resources with the following parameters: -bootclasspath "E:\software\And ...
- 自动布局报错(两条连线冲突):Unable to simultaneously satisfy constraints
这个报错有些长: Unable to simultaneously satisfy constraints. Probably at least one of the constraints i ...
- 【maven 报错】maven项目update之后报错One or more constraints have not been satisfied.
在右键项目Update Project之后报错:One or more constraints have not been satisfied.Spring 4.1 requires Java 1.6 ...
- eclipse报错 : One or more constraints have not been satisfied.
当eclipse进行报错时,但是不影响运行时,这种错误一般是编译时的问题 进行修改3个地方,即可完成 一 : 进行修改这三个地方的配置文件,都改成你统一的jdk版本,和你用的Dynamic Web ...
- Eclipse 创建maven项目 报错 one or more constraints have not been satisfied
首先 在 pom.xml > plugins 中添加 <plugin> <groupId>org.apache.maven.plugins</groupId> ...
- spring3 jsp页面使用<form:form modelAttribute="xxxx" action="xxxx">报错,附连接数据库的spring MVC annotation 案例
在写一个使用spring3 的form标签的例子时,一直报错,错误信息为:java.lang.IllegalStateException: Neither BindingResult nor plai ...
- ORA-01157报错"cannot identify/lock data file"解决
sqlplus以管理员方式接入数据库,启动时出现报错,如下: > sqlplus "/as sysdba" SQL> startup ...... ORA-01157: ...
- Android Studio报错view is not constrained
在活动上面创建了两个按钮,在Design上看上去是两个按钮分开的,run一下,按钮就重合在一起了,而且一直报错,这个时候再去看一下Design,两个按钮重在一块,只显示一个按钮.如下图: button ...
随机推荐
- 再谈http请求调用(Post与Get),项目研发的核心一环
支持.Net Core(2.0及以上)与.Net Framework(4.0及以上) [目录] 前言 Post请求 Get请求 与其它工具的比较 1[前言] http请求调用是开发中经常会用到的功能. ...
- 使用 Alacritty 替代 Gnome-Terminal 解决 Ubuntu 中终端的行间距问题
我之前发了一篇随笔新版 Ubuntu 中 gnome-terminal 可恶的行间距问题逼我退回了 Ubuntu 20.04,描述了新版 Ubuntu 中终端的行间距问题.评论中给出了一个解决办法,那 ...
- 【京东开源项目】微前端框架MicroApp 1.0正式发布
介绍 MicroApp是由京东前端团队推出的一款微前端框架,它从组件化的思维,基于类WebComponent进行微前端的渲染,旨在降低上手难度.提升工作效率.MicroApp无关技术栈,也不和业务绑定 ...
- C#计数排序算法
前言 计数排序是一种非比较性的排序算法,适用于排序一定范围内的整数.它的基本思想是通过统计每个元素的出现次数,然后根据元素的大小依次输出排序结果. 实现原理 首先找出待排序数组中的最大值max和最小值 ...
- mysqli操作
1.使用mysqli_connect()函数,语法如下: mysqli 对象名=mysqli_connect(数据库服务名,用户名,密码,数据库名) 例:$conn=mysqli_connect('l ...
- mysql之简单的多表查询
最简单的多表查询需要用到连操作符(join) 1.笛卡儿积 形式为table1 join table2.如: select e.fname,e.lname,d.name from employee e ...
- 21.2 Python 使用Scapy实现端口探测
Scapy 是一款使用纯Python编写的跨平台网络数据包操控工具,它能够处理和嗅探各种网络数据包.能够很容易的创建,发送,捕获,分析和操作网络数据包,包括TCP,UDP,ICMP等协议,此外它还提供 ...
- 产品代码都给你看了,可别再说不会DDD(九):领域事件
这是一个讲解DDD落地的文章系列,作者是<实现领域驱动设计>的译者滕云.本文章系列以一个真实的并已成功上线的软件项目--码如云(https://www.mryqr.com)为例,系统性地讲 ...
- P9073 [WC/CTS2023] 楼梯 题解
题目链接 简要题意 有一块楼梯,这里指的楼梯是倒着的,正过来看上一层宽度一定小于等于这一层宽度,并且由格子组成,你需要对其进行增删和恢复某一历史版本的操作,并回答这块楼梯是否有固定格数的子楼梯. 题目 ...
- 高精度减法(C语言实现)
高精度减法(C语言实现) 介绍 众所周知,整数在C和C++中以int ,long,long long三种不同大小的数据存储,数据大小最大可达2^64,但是在实际使用中,我们仍不可避免的会遇到爆long ...