pub fn feature_rules(&self, config: &Config) -> Vec<String> {
        let mut features = vec![];
        match self {
            Package::EspBacktrace => features.push("defmt".to_owned()),
            Package::EspConfig => features.push("build".to_owned()),
            Package::EspHal => {
                features.push("unstable".to_owned());
                if config.contains("psram") {
                    // TODO this doesn't test octal psram (since `ESP_HAL_CONFIG_PSRAM_MODE`
                    // defaults to `quad`) as it would require a separate build
                    features.push("psram".to_owned())
                }
                if config.contains("usb0") {
                    features.push("__usb_otg".to_owned());
                }
                if config.contains("bt") {
                    features.push("__bluetooth".to_owned());
                }
            }
            Package::EspWifi => {
                features.push("esp-hal/unstable".to_owned());
                features.push("defmt".to_owned());
                if config.contains("wifi") {
                    features.push("wifi".to_owned());
                    features.push("esp-now".to_owned());
                    features.push("sniffer".to_owned());
                    features.push("smoltcp/proto-ipv4".to_owned());
                    features.push("smoltcp/proto-ipv6".to_owned());
                }
                if config.contains("bt") {
                    features.push("ble".to_owned());
                }
                if config.contains("wifi") && config.contains("bt") {
                    features.push("coex".to_owned());
                }
            }
            Package::EspHalProcmacros => {
                features.push("embassy".to_owned());
            }
            Package::EspHalEmbassy => {
                features.push("esp-hal/unstable".to_owned());
                features.push("defmt".to_owned());
                features.push("executors".to_owned());
            }
            Package::EspIeee802154 => {
                features.push("defmt".to_owned());
                features.push("esp-hal/unstable".to_owned());
            }
            Package::EspLpHal => {
                if config.contains("lp_core") {
                    features.push("embedded-io".to_owned());
                }
                features.push("embedded-hal".to_owned());
            }
            Package::EspPrintln => {
                features.push("auto".to_owned());
                features.push("defmt-espflash".to_owned());
            }
            Package::EspStorage => {}
            Package::EspBootloaderEspIdf => {
                features.push("defmt".to_owned());
                features.push("validation".to_owned());
            }
            Package::EspAlloc => {
                features.push("defmt".to_owned());
            }
            _ => {}
        }

        features
    }
Given a device config, return the features which should be enabled for
this package.
xtask/src/lib.rs