调试 SCons

发布于 2024-10-20 01:54:37 字数 391 浏览 10 评论 0原文

我编写了一组相当复杂的 SCons 脚本,并且有一些找不到的错误,例如中间文件被删除或报告了循环依赖项,我想知道原因。不幸的是,我没有看到任何方法来获得 SCons 正在做什么以及在哪里进行的详细调试输出。例如,选项 --taskmastertrace=FILE 没有解释为什么我的中间文件被删除。 (编辑:当然,我可以使用Precious保护它们,但是另一个目标需要这些文件并且构建失败 - 我只是不明白为什么它们被删除我当前的解决方案涉及 Precious,但这并不是问题的真正解决方案)。

我想跟踪正在发生的一切,包括依赖项更改、文件创建和删除以及其他操作。有什么办法可以启用这种详细的日志记录吗?我目前的项目有点困难。

干杯, H.

I've written a rather complicated set of SCons scripts, and I have some errors I cannot find, for example intermediate files are removed or there are cyclic dependencies reported, and I want to know the reason. Unfortunately, I don't see any means to get good verbose debugging output of what SCons is doing and where. For example, the option --taskmastertrace=FILE does not explain why my intermediate files were deleted. (EDIT: of course I can protect them using Precious, but those files are needed for another target and the build fails -- I just don't see why they are deleted. My current solution involves Precious, but it's not a real fix for the issue).

I'd like to get a trace of everything going on, including dependency changes, file creations and deletions, and other operations. Is there any way to enable such verbose logging? I'm a little stuck with my project currently.

Cheers,
H.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤城病女 2024-10-27 01:54:37

好的,我已经解决了问题。原因似乎是目录滑入了目标列表,并且目录创建了自己的一组隐式依赖项。至少我是这么认为的,因为删除目录后脚本将按预期工作。谁能澄清我的假设是否正确?

我仍然不知道如何调试 SCons 更多细节,我的解决方案是向转储函数调用的 /usr/lib/scons/SCons/Node/FS.py 添加函数装饰器 +参数和返回值。

Ok, I've solved the problem. It seems the reason was that a directory slipped into the list of targets, and directories create their own set of implicit dependencies. At least that's what I think, because after removing the directory the scripts work as expected. Can anyone clarify if my assumption is correct?

I still don't know exactly as to how debug SCons with more details, my solution was to add function decorators to /usr/lib/scons/SCons/Node/FS.py that dump function calls + arguments and return values.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文