···69707172+ ${lib.optionalString (lib.length crateBin > 0) (lib.concatMapStringsSep "\n" (bin:
73+ let
74+ haveRequiredFeature = if bin ? requiredFeatures then
75+ # Check that all element in requiredFeatures are also present in crateFeatures
76+ lib.intersectLists bin.requiredFeatures crateFeatures == bin.requiredFeatures
77+ else
78+ true;
79+ in
80+ if haveRequiredFeature then ''
81 mkdir -p target/bin
82 BIN_NAME='${bin.name or crateName}'
83 ${if !bin ? path then ''
···87 BIN_PATH='${bin.path}'
88 ''}
89 ${build_bin} "$BIN_NAME" "$BIN_PATH"
90+ '' else ''
91+ echo Binary ${bin.name or crateName} not compiled due to not having all of the required features -- ${lib.escapeShellArg (builtins.toJSON bin.requiredFeatures)} -- enabled.
92 '') crateBin)}
9394 ${lib.optionalString buildTests ''