Comments (2)
应该跟https://github.com/Tencent/yadcc/blob/master/yadcc/daemon/cloud/remote_task/cxx_compilation_task.cc#L46 有关,为了降低客户机负载,对这些宏的检查挪到了编译机。如果代码中出现了这些宏的话就会不缓存。
YADCC_WARN_ON_NONCACHEABLE检测不到这个case,后续我会更新一下文档(其实最好是从编译机回传相关信息,后续有时间再看看)。另外有个regression是YADCC_IGNORE_TIMESTAMP_MACROS失效了,回头得改下协议。
如果宏出现在头文件,建议避免,因为这是个正确性问题,所以各类编译缓存对这些宏都会比较保守。如果出现在.cc,其他文件应该还是可以缓存的。
为了确认这一问题,可以加编译参数-E并观察输出是不是有类似的宏的使用。
另外,有一个特殊处理,就是如果编译参数有-D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted"
,会特判这个case允许缓存,可以加在编译参数试一下。
这个我印象里其实是个UB,但是bazel默认会有这个参数,为了强制代码不要依赖这些宏(印象里好像是为了reproducible build)。腾讯广告内部的blade配置也加了类似的参数。你也可以看看你的环境里需不需要采用这种方式。
注:只要代码中实际没出现这些宏,这个参数加与不加不会有区别。这个更多的是一种用于确保编码规范的措施。
from yadcc.
谢谢,从业务代码中,我看到包含__DATE__、TIMESTAMP、TIME__这类的宏定义在头文件中,因此缓存没有生效,麻烦后续修改一下YADCC_IGNORE_TIMESTAMP_MACROS就可以了,经过测试,增加编译参数:-D__DATE="redacted" -D__TIMESTAMP_="redacted" -D__TIME__="redacted",是可以正常缓存的。
from yadcc.
Related Issues (20)
- 请问yadcc 是否支持c++ modules HOT 1
- 文件预处理是由客户端自己完成吗 HOT 9
- 技术原理请教 HOT 2
- Cannot contact delegate daemon. Daemon died? HOT 9
- 能否给daemon加个功能,当scheduler重启后自动重链 HOT 2
- 关于调度机制的问题 HOT 1
- yadcc编译时,提示ld链接无法找到pthread、m、c、dl等动态库 HOT 2
- [2023-01-29 20:02:30.532771] [INFO ] [yadcc/client/cxx/yadcc-cxx.cc:207] Failed on the cloud with [-126]. Failing back to local machine. HOT 2
- 安装失败 HOT 2
- can not support CROSS_COMPILE HOT 8
- yadcc v1.x 版本编译报错 HOT 1
- failling back to local machine 126 HOT 3
- yadcc能不能用于安卓系统AOSP构建加速 HOT 3
- 经常编译报错. Child process exited unexpectedly with status HOT 1
- 当我运行./yadcc-daemon时,报Check failed: parts.size() >= 3 (2 vs. 3) Unexpected cgroup setting错误 HOT 2
- build latest llvm failed HOT 1
- 运行daemon错误 HOT 1
- --with-nghttp2 was specified but could not find libnghttp2 pkg-config file.
- 这个是否支持clang? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yadcc.