pub fn validate_package_chip(&self, chip: &Chip) -> Result<()> {
        let device = Config::for_chip(chip);

        let check = match self {
            Package::EspIeee802154 => device.contains("ieee802154"),
            Package::EspLpHal => chip.has_lp_core(),
            Package::XtensaLx | Package::XtensaLxRt | Package::XtensaLxRtProcMacros => {
                chip.is_xtensa()
            }
            Package::EspRiscvRt => chip.is_riscv(),
            _ => true,
        };

        if check {
            Ok(())
        } else {
            Err(anyhow!(
                "Invalid chip provided for package '{}': '{}'",
                self,
                chip
            ))
        }
    }
Validate that the specified chip is valid for the specified package.
xtask/src/lib.rs