我要定义一个规则来解压缩给定的 zip 文件。但是,例如,我不知道 zip 的内容,因此我无法outs在 genrule 中指定。这似乎是一个常见问题,谷歌搜索让我找到了遇到类似情况的人,但我还没有看到如何解决这个问题的具体例子。
我想要这样的东西:
genrule(
name="unzip",
src="file.zip",
outs=glob(["**"]), # except you're not allowed to use glob here
cmd = "unzip $(location file)",
)
Run Code Online (Sandbox Code Playgroud) bazel ×1