This is inflexible and hard to maintain in ways that are actively causing us trouble. Case in point: in #1806 we accidentally removed "gimlet-f" from the match (when resolving a merge conflict with the change that added it) and neither Aaron nor I noticed, because honestly how would you. In #1885 we're restoring it.
While I was getting #1774 in over the course of about five months, I had repeated merge conflicts on this specific code, and spent more time than I'd like staring at it to make sure I didn't resolve them wrong.
Fortunately, in #1774 I also introduced the boards/ directory containing TOML board definitions. These files are currently empty. We should move the information being derived by these horrible match statements into the TOML files.
Currently in
build/xtask/src/flash.rs
we have giantmatch
statements that derive properties of boards based on hardcoded names. They look like this:This is inflexible and hard to maintain in ways that are actively causing us trouble. Case in point: in #1806 we accidentally removed
"gimlet-f"
from the match (when resolving a merge conflict with the change that added it) and neither Aaron nor I noticed, because honestly how would you. In #1885 we're restoring it.While I was getting #1774 in over the course of about five months, I had repeated merge conflicts on this specific code, and spent more time than I'd like staring at it to make sure I didn't resolve them wrong.
Fortunately, in #1774 I also introduced the
boards/
directory containing TOML board definitions. These files are currently empty. We should move the information being derived by these horriblematch
statements into the TOML files.