gregor icon indicating copy to clipboard operation
gregor copied to clipboard

gregor-lib transitive dependency pulls in racket-doc, racket-index

Open winny- opened this issue 3 years ago • 4 comments

toml-racket is looking to consume this library. Weirdly, it seems to pull in racket-doc and/or racket-index. This bloats out a minimal racket install significantly. It also impacts the size of deploys.

winny- avatar Dec 03 '22 06:12 winny-

How I'm testing:

  1. Open a shell in a fresh alpine docker image: docker run -ti --rm alpine
  2. apk add racket
  3. raco pkg install --auto gregor-lib

Step 3 takes about 14 minutes on this laptop.

winny- avatar Dec 03 '22 07:12 winny-

I'm not sure how to respond to this. Are you suggesting that this is a bug in gregor? What, exactly, do you think I can do about this?

97jaz avatar Dec 03 '22 07:12 97jaz

Thankfully no bug in gregor-lib itself. I think I (we?) could track down which transitive dependencies are pulling in racket-doc/racket-index, then work with the developers to address the dependency bloat issue in their packages. Alternatively, one can always vendor code. (I woludn't recommend vendoring code because the maintenance burden can be unsustainable.)

I'm interested in researching this further. I opened this issue to open a dialogue in case there's need for collaboration or reducing duplicate work.

winny- avatar Dec 03 '22 09:12 winny-

Hey, I did some further research. Using racket -l- pkg-dep-draw gregor-lib I spotted the root cause. The following packages pull in racket-doc as a build dependency:

  • cldr-bcp47
  • cldr-dates-modern
  • cldr-localnames-modern
  • cldr-numbers-modern
  • tzinfo
  • cldr-core

If i read the author information correctly, I think these are yours, so I figure we can discuss if and how to address this here.

https://countvajhula.com/2022/02/22/how-to-organize-your-racket-library/ this blog post discusses some possible ways to reduce build dependencies - such as splitting out the implementation into a -lib package. I'm not sure if that's the easiest way to achieve the end goal. Perhaps a simpler way could be to make a cldr-doc that encompasses all (most?) of the above package' documentation and thereby the racket-doc dependency.

image

As a caveat, I should point out there is raco pkg install's --binary and --binary-lib to avoid build deps. This isn't quite sufficient because the pre-built catalogue is available for the latest stable racket release only, and only for the most common deployment targets.

winny- avatar Dec 04 '22 00:12 winny-