panda icon indicating copy to clipboard operation
panda copied to clipboard

Leave circular dependency hell (adopt source/header model)

Open aubsw opened this issue 9 months ago • 6 comments

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.

aubsw avatar Mar 18 '25 20:03 aubsw

@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.

aubsw avatar Mar 18 '25 20:03 aubsw

Thanks. For now, the bounty is locked to #2172, if that attempt stalls it'll be unlocked again.

robbederks avatar Mar 19 '25 09:03 robbederks

Aw crud my bad. I started working on this before it was locked–didn't realize what was going on 😞 .

aubsw avatar Mar 19 '25 13:03 aubsw

@aubsw the bounty is unlocked if you want to continue!

robbederks avatar Apr 02 '25 08:04 robbederks

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.

aubsw avatar Apr 02 '25 14:04 aubsw

@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.

aubsw avatar Apr 02 '25 21:04 aubsw