Move more Core functions to ProbeCore#700
Conversation
|
I had to do a bit of extra wrangling to get the probeless build working; it now skips subcommands which are probe-only, both in the |
| .iter() | ||
| .find(|p| metadata[p].name == "humility-bin") | ||
| .map(|p| metadata[p].clone()) | ||
| .unwrap() |
There was a problem hiding this comment.
turbo-nit: should this maybe be an expect so that, if the build fails, we get an error message that actually tells us what happened?
| ( | ||
| // These are everything that can potentially pull in libusb | ||
| ["probe-rs", "humility-probes-core", "rusb"] | ||
| .into_iter() | ||
| .collect(), | ||
| // We also look at which commands are enabled by the `probes` | ||
| // feature on the `humility-bin` crate, then remove them. | ||
| metadata | ||
| .workspace_members | ||
| .iter() | ||
| .find(|p| metadata[p].name == "humility-bin") | ||
| .map(|p| metadata[p].clone()) | ||
| .unwrap() | ||
| .features["probes"] | ||
| .iter() | ||
| .flat_map(|p| { | ||
| p.strip_prefix("cmd-") | ||
| .map(|p| format!("humility-cmd-{p}")) | ||
| }) | ||
| .collect::<BTreeSet<_>>(), | ||
| ) |
There was a problem hiding this comment.
style nit, take it or leave it: i find throwing all of this in one giant tuple a little hard to follow; what do you think about doing something more like this:
| ( | |
| // These are everything that can potentially pull in libusb | |
| ["probe-rs", "humility-probes-core", "rusb"] | |
| .into_iter() | |
| .collect(), | |
| // We also look at which commands are enabled by the `probes` | |
| // feature on the `humility-bin` crate, then remove them. | |
| metadata | |
| .workspace_members | |
| .iter() | |
| .find(|p| metadata[p].name == "humility-bin") | |
| .map(|p| metadata[p].clone()) | |
| .unwrap() | |
| .features["probes"] | |
| .iter() | |
| .flat_map(|p| { | |
| p.strip_prefix("cmd-") | |
| .map(|p| format!("humility-cmd-{p}")) | |
| }) | |
| .collect::<BTreeSet<_>>(), | |
| ) | |
| // These are everything that can potentially pull in libusb | |
| let banned_deps = ["probe-rs", "humility-probes-core", "rusb"] | |
| .into_iter() | |
| .collect(); | |
| // We also look at which commands are enabled by the `probes` | |
| // feature on the `humility-bin` crate, then remove them. | |
| let disabled_cmds = metadata | |
| .workspace_members | |
| .iter() | |
| .find(|p| metadata[p].name == "humility-bin") | |
| .map(|p| metadata[p].clone()) | |
| .unwrap() | |
| .features["probes"] | |
| .iter() | |
| .flat_map(|p| { | |
| p.strip_prefix("cmd-") | |
| .map(|p| format!("humility-cmd-{p}")) | |
| }) | |
| .collect::<BTreeSet<_>>(); | |
| (banned_deps, disabled_cmds) |
this is a little more repetitive but i feel like it makes it slightly more obvious which expression corresponds to which variable?
I had hoped to be able to drop this after the probe-rs update but so long as we need to keep CMSIS DAP v1 around we will still need these hacks :( |
vid_pid,step, andwrite_regare only available onProbeCore. This PR removes them from theCoretrait, adjusting signatures where necessary to force the concrete type.