jbqueru, (edited )
@jbqueru@fosstodon.org avatar

Poll: I'm going to be writing equivalent code for a variety of targets (essentially porting code to a bunch of targets). How should I organize my code in git?

jbqueru,
@jbqueru@fosstodon.org avatar

Signs point toward monorepo. I'm familiar and comfortable with the tradeoffs.

mariani1,

@jbqueru Different targets as in x86, x64, ARM, etc, or as in 6502 Apple ][, 6502 C64, etc? If the former, I’d say different directories in a single branch so they’re easy to cross-reference. Branching the latter case might make sense if you foresee merging some changes across platforms.

Wouldn’t you want a top-level Makefile that could build all targets though?

jbqueru,
@jbqueru@fosstodon.org avatar

@mariani1 as a start, 6502 for Atari 2600, 5200, 7800 plus NES, Z80 for Sega Master System, 68000 for Atari ST. There could be more CPUs in the future and more machines around each CPU.

mariani1,

@jbqueru I guess it depends on how many of the future commits could be trivially merged across the targets, versus just copy-pasting.

My gut feel would be single branch with directories for each target, plus maybe a directory for each CPU for shared code. Especially considering the root Makefile to build/test all targets.

jbqueru,
@jbqueru@fosstodon.org avatar

@mariani1 I think that's the key. Either code will trivially be shared between targets that use the same CPU, or code will be very hardware-specific and won't share at all. Cases will be rare of code that is different but mergeable. Single flat repo should work better.

deivudesu,
@deivudesu@mastodon.social avatar

@jbqueru One branch per target is definitely chaotic evil.
Monorepo vs multi-repo is a debate as old as times. Personally think it's best informed by 1. what dev tools/IDE you use (some are better than others at dealing with monorepos) 2. how much common data/config/etc you might have 3. how your deployment/build toolchain works (and whether it'll suffer from either solution).

jbqueru,
@jbqueru@fosstodon.org avatar

@deivudesu Thanks, this helps a lot. You're helping me by asking the right questions.

troed,
@troed@ioc.exchange avatar

@jbqueru Personally that would depend on the code. Is it the same language across targets?

jbqueru,
@jbqueru@fosstodon.org avatar

@troed Only somewhat. It's all assembly, there are some clusters around different CPUs. There will probably be shared assets.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • tacticalgear
  • JUstTest
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • modclub
  • megavids
  • lostlight
  • All magazines