97jaz / gregor

Date and time library for Racket
45 stars 10 forks source link

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

Open winny- opened 1 year ago

winny- commented 1 year ago

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- commented 1 year ago

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.

97jaz commented 1 year ago

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?

winny- commented 1 year ago

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- commented 1 year ago

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:

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.