···6969707071717272- ${lib.optionalString (lib.length crateBin > 0) (lib.concatMapStringsSep "\n" (bin: ''
7272+ ${lib.optionalString (lib.length crateBin > 0) (lib.concatMapStringsSep "\n" (bin:
7373+ let
7474+ haveRequiredFeature = if bin ? requiredFeatures then
7575+ # Check that all element in requiredFeatures are also present in crateFeatures
7676+ lib.intersectLists bin.requiredFeatures crateFeatures == bin.requiredFeatures
7777+ else
7878+ true;
7979+ in
8080+ if haveRequiredFeature then ''
7381 mkdir -p target/bin
7482 BIN_NAME='${bin.name or crateName}'
7583 ${if !bin ? path then ''
···7987 BIN_PATH='${bin.path}'
8088 ''}
8189 ${build_bin} "$BIN_NAME" "$BIN_PATH"
9090+ '' else ''
9191+ echo Binary ${bin.name or crateName} not compiled due to not having all of the required features -- ${lib.escapeShellArg (builtins.toJSON bin.requiredFeatures)} -- enabled.
8292 '') crateBin)}
83938494 ${lib.optionalString buildTests ''