【问题标题】:How stop SCons build if any SConscript is missing?如果缺少任何 SConscript,如何停止 SCons 构建?
【发布时间】:2018-12-21 04:54:35
【问题描述】:

即使在构建期间缺少某些 SConscript 文件,SCons 也会继续构建。例如,我有这样的源结构:

├── a
│   └── test1.c
├── b
│   ├── SConscript
│   └── test2.c
└── SConstruct

在 SConstruct 中,我正在调用两个 SConscript 文件,其中一个 SConscript 缺失。

SConscript('a/SConscript')

SConscript('b/SConscript')

运行“scons”命令时收到警告消息。

scons: Reading SConscript files ...

scons: warning: Ignoring missing SConscript 'a/SConscript'
File "/home/srbd/workspace/programming/scons_demo/SConstruct", line 1, in <module>
scons: done reading SConscript files.
scons: Building targets ...
gcc -o b/test2.o -c b/test2.c
gcc -o b/test2 b/test2.o
scons: done building targets.

但它显示整体 scons 构建已成功完成。

在我的真实系统中,我有很多源文件夹/文件,其中一些 SConscript 在构建时可能不存在。当整体构建显示成功时,仅通过警告消息很难注意到那些丢失的文件。

我在 scons 参数中搜索过,但没有找到有用的参数。

如果缺少 SConscript 之一并将构建显示为失败,我是否可以停止构建?

【问题讨论】:

    标签: python scons


    【解决方案1】:

    在 SCons 的开发版本中对此进行了修复,应该在下一个版本 3.0.2 中。

    希望 3.0.2 能在年底前发布。

    【讨论】:

    • 能否提供与发布日期 3.0.2 相关的任何链接?
    • 没有固定的发布时间表。我们正在尝试处理几个出色的拉取请求。但希望在今年年底之前。
    • 不,现在不紧急。我们现在已经制作了一个包装函数来处理这个问题。感谢您的回复。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-03
    • 2020-05-21
    • 2020-09-03
    • 2015-01-08
    • 1970-01-01
    相关资源
    最近更新 更多