pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Copying source code from libnbcompat vs. depending on it



Hello, All!

Why does net/tnftp (and any other package like it) include its own
copy of standard functions (e.g. vasprintf) instead of using the ones
provided by pkgtools/libnbcompat (i.e. libnbcompat.a)?

I'm not saying the package could be better, rather I'm wishing to
understanding why its approach is presumably the better way.

One advantage I see for linking against the nbcompat library is
not duplicating code.  For example, if net/tnftp includes a copy
of vasprintf from libnbcompat and there's a fix for vasprintf in
libnbcompat, it can be fixed in one place (i.e. libnbcompat) instead of
two.  On the other hand, since nbcompat is not a shared library, tnftp
still needs to be recompiled.  But at least the source code is not
duplicated.

A disadvantage I see for linking against the nbcompat library is that it
adds a dependency.  It could be reasoned that the vasprintf code being
added is unlikely to change and unlikely to contain a bug.  Therefore,
it's not a big deal to have duplicate code, and the maintainer accepts
the possible maintenance cost for that while getting the benefit of an
application with no or minimal dependencies.  If I understand correctly,
I think Alistair Crooks suggested this as his feeling in [1] where he
said the following:

  "I do not want to have to distribute libnbcompat with any code I
  write.  I also find requiring it to be present, just to compile stuff
  that I write, to be too onerous."

Thank you!

Lewis

P.S. I previously asked basically the same thing in [2], but I addressed
Joerg specifically, so perhaps others didn't think my email was
addressed to everyone, or perhaps it got missed because I kind of
hijacked the thread.

[1] https://mail-index.netbsd.org/tech-userlevel/2015/11/02/msg009417.html
[2] http://mail-index.netbsd.org/pkgsrc-users/2016/01/12/msg022814.html


Home | Main Index | Thread Index | Old Index