调试 SCons
我编写了一组相当复杂的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我已经解决了问题。原因似乎是目录滑入了目标列表,并且目录创建了自己的一组隐式依赖项。至少我是这么认为的,因为删除目录后脚本将按预期工作。谁能澄清我的假设是否正确?
我仍然不知道如何调试 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.