scons:源目录未复制到构建目录中
我的构建过程的一部分是创建输入目录的 tar 文件,位于 src/bundle/bundle
。在 src/bundle/SConscript 中:
Import('*')
bundleDir = Dir("bundle")
jsontar = Command("bundle.tar", bundleDir,
"/home/dbender/bin/mkvgconf $SOURCE $TARGET")
在我的 SConstruct 中:
SConscript(Split('src/bundle/SConscript'),
exports='bin_env lib_env', build_dir='tmp/bundle')
尝试构建时:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/home/dbender/bin/mkvgconf tmp/bundle/bundle tmp/bundle/bundle.tar
Input directory tmp/bundle/bundle not found!
scons: *** [tmp/bundle/bundle.tar] Error 1
scons: building terminated because of errors.
显然 scons 没有将 src/bundle/bundle 复制到 tmp/bundle/bundle,但我很困惑为什么。
脚注: 对 mkvgconf 使用绝对路径名是不好的做法,但在我解决这个问题之前只是中间做法。
Part of my build process is to create a tar file of an input directory, located at src/bundle/bundle
. In src/bundle/SConscript:
Import('*')
bundleDir = Dir("bundle")
jsontar = Command("bundle.tar", bundleDir,
"/home/dbender/bin/mkvgconf $SOURCE $TARGET")
in my SConstruct:
SConscript(Split('src/bundle/SConscript'),
exports='bin_env lib_env', build_dir='tmp/bundle')
When attempting to build:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/home/dbender/bin/mkvgconf tmp/bundle/bundle tmp/bundle/bundle.tar
Input directory tmp/bundle/bundle not found!
scons: *** [tmp/bundle/bundle.tar] Error 1
scons: building terminated because of errors.
Clearly scons is not copying the src/bundle/bundle to tmp/bundle/bundle, but I am stumped as to why.
Footnotes:
Using absolute pathname for mkvgconf is bad practice but just intermediate until I have this problem solved.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SCons 不知道您输入的内容
src/bundle/bundle
- 只有程序mkvgconf
知道它对该目录的作用。一种解决方案是在 SConscript 中添加显式依赖项:
这也意味着当您更新包目录的内容时,mkvgconf 脚本将重新运行。
附言。您可能需要将
build_dir
参数名称更改为variant_dir
,因为在最近的 SCons 版本中,前者已被弃用,取而代之的是后者。SCons doesn't know anything about the contents of your input
src/bundle/bundle
- only the programmkvgconf
knows what it does with that directory.One solution is to add an explicit dependency in the SConscript:
That also means that when you update the contents of the bundle directory, the mkvgconf script will be rerun.
PS. you might want to change the
build_dir
argument name tovariant_dir
, as the former is deprecated in favor of the latter in recent SCons releases.