libchdr icon indicating copy to clipboard operation
libchdr copied to clipboard

Libretro-common resync - some things we need

Open inactive123 opened this issue 5 years ago • 7 comments

Hi there,

following earlier conversations with @alucryd , I'm fine with resyncing libchdr so that libretro-common, RetroArch and upstream libchdr are all on the same page again.

However, if we may humbly make some tiny requests, there are a couple of things still preventing us from not having to make a single edit to the sources. If these could be addressed then we could get rid of our own fork -

  1. Uniquely namespace all source file names. These files get statically linked with libretro cores. There are compilers/toolchains where having two source files with the exact same name creates a problem where only one will be linked. You can see here how we basically renamed all files for libchdr and prefixed 'libchdr_' to it.

https://github.com/libretro/RetroArch/tree/master/libretro-common/formats/libchdr

  1. Header includes. On our shallow fork you see that we try pulling from the system directory first -

https://github.com/libretro/RetroArch/blob/master/libretro-common/formats/libchdr/libchdr_bitstream.c#L12

For various libretro cores and for RetroArch itself, we set several include dirs for header files. Again, this is a small thing, but the way it is right now in upstream can pose problems on certain compilers/toolchains we care about.

So far, these are the only two things I can think of. They should be relatively small requests hopefully.

If any additions have been made to libchdr in any of the libretro cores that have not been upstreamed yet, hopefully @alucryd can help us out in that endeavor to make sure that all these missing parts are submitted to you as PRs so that we can finally have one central libchdr version with all the features and we no longer have to make these forks.

Thanks for reading.

inactive123 avatar Jun 05 '20 15:06 inactive123

@twinaphex I'm fine with the changes themselves you request. Out of topic, have you thought about using git submodules for libretro-common and possibly bundling libretro-common as a submodule of various libretro cores ?

rtissera avatar Jun 05 '20 23:06 rtissera

Nah we want to avoid that at all costs. Libretro cores should only bake in the files from libretro common that they need.

Also not a fan of submodules for it or subtrees, we want building to be kept easy and the entire point is that a dev only uses the few parts they actually need, it should not be like some big kitchensink API/SDK like SDL.

inactive123 avatar Jun 06 '20 02:06 inactive123

how about using git-subrepo?

sample from lightrec: https://github.com/libretro/pcsx_rearmed/blob/ea17432f22e441c9bf6f1c60f58a8cc6faaebbb1/deps/lightrec/.gitrepo

negativeExponent avatar Jun 08 '20 01:06 negativeExponent

@twinaphex requesting changes have been applied in latest master of @rtissera libchdr repo. Let me know how to move on.

rtissera avatar Oct 23 '20 08:10 rtissera

@twinaphex @negativeExponent can we close this as well ?

rtissera avatar Nov 04 '21 01:11 rtissera

@inactive123 @negativeExponent @LibretroAdmin sorry for the ping again, can we close this issue now ?

rtissera avatar Aug 30 '22 20:08 rtissera