Leave circular dependency hell (adopt source/header model)
This is to address https://github.com/commaai/panda/issues/2171
Unfortunately, for this to work in the end, I think we need to do the same to opendbc, since that library being header-only breaks our build.
For local testing, I patched opendbc, and it was a fairly small patch.
@robbederks I think for this work, we will need source-and-header-ify https://github.com/commaai/opendbc/tree/master/opendbc/safety, since we would need to #include those headers here.
I got build working locally by patching safety.h & co.
I'm also happy to try to break this work up in to several smaller PRs, tho that may take some time because it's difficult to break out individual headers without generating conflicts at the linking stage.
Thanks. For now, the bounty is locked to #2172, if that attempt stalls it'll be unlocked again.
Aw crud my bad. I started working on this before it was locked–didn't realize what was going on 😞 .
@aubsw the bounty is unlocked if you want to continue!
I'm in!
I will draft a more detailed plan for breaking the change into smaller PRs today.
I did the hard part already which is getting the code to compile. Now just need to make the diff a bit more digestible + supporting PR in the opendbc repo.
@robbederks I'm prototyping my merge plan and am a bit behind. I will follow-up on the merge plan with a clear head tomorrow morning.