【发布时间】:2019-05-25 19:08:11
【问题描述】:
我想将包含在我的构建src 中的文件数量限制为少数几个。
不允许将文件列表直接传递给src 或srcs,因为需要存档或目录。
我找不到执行此操作的函数,builtins.filterSource 似乎对我不起作用(不知道为什么——包含过滤文件的中间派生最终为空):
files = [
./Cargo.toml
./Cargo.lock
./cpu.rs
];
src = builtins.filterSource (p: t: builtins.elem p files) ./.;
注意:我正在使用 rustPlatform 构建器,但我认为这并不重要。
【问题讨论】: