User: Password:
|
|
Subscribe / Log in / New account

The case for the /usr merge

The case for the /usr merge

Posted Jan 27, 2012 12:01 UTC (Fri) by kju (guest, #61936)
In reply to: The case for the /usr merge by Cyberax
Parent article: The case for the /usr merge

And because you need it, everyone else should have binaries which have unnecessary depends and therefore use up more resources? It would make more sense to have a wpasupplicant-full package or something which includes all the bells and whistle and a more stripped down version for the majority of us.


(Log in to post comments)

The case for the /usr merge

Posted Jan 27, 2012 12:45 UTC (Fri) by RobSeace (subscriber, #4435) [Link]

Or, why couldn't it just dlopen() rarely needed libs like this on the fly, if and only if it actually needs them at the time? Then, it wouldn't be linked against them and actually require them to run at all...

The case for the /usr merge

Posted Jan 27, 2012 14:20 UTC (Fri) by mpr22 (subscriber, #60784) [Link]

The sanity or otherwise of that approach is so wildly variable that it can only be evaluated on a case-by-case basis. dlopen() adds a significant comprehensibility overhead compared to just invoking the library's API directly, and may well preclude sane-and-convenient use of the normal programming model for the library in question.

(The latter effect becomes particularly severe when you're writing a C++ program using C++ libraries, of course.)

The case for the /usr merge

Posted Jan 27, 2012 14:51 UTC (Fri) by RobSeace (subscriber, #4435) [Link]

True enough... But, if it's just some obscure rarely used feature, I'd think it makes sense anyway... Even if you don't want to indirect all API calls through dlsym() and such, what you could do is separate out all the code that interacts with that library into a sort of plug-in library of its own, needing just one simple call into that lib from the main app to do everything... The separate lib can still directly call all functions from the system library with no confusing indirection, and even be linked against it if you want... (Or, the main app can just dlopen(RTLD_GLOBAL) it prior to dlopen()'ing this separate lib...)

The case for the /usr merge

Posted Jan 27, 2012 16:45 UTC (Fri) by dashesy (guest, #74652) [Link]

While the whole plugin approach is nice, it is not worth it just to save a few bytes. It might even produce bigger binaries, and the additional complexity will bring more errors.

The case for the /usr merge

Posted Jan 27, 2012 17:00 UTC (Fri) by RobSeace (subscriber, #4435) [Link]

I didn't think the idea was to reduce app size, but rather to reduce dependencies required for rarely-used features... So that one could choose NOT to install the plugin and its required system library, and still be able to use all the more common features of the app, and merely lose the ability to use the obscure feature...

Just run gentoo :-) n/t

Posted Jan 28, 2012 12:22 UTC (Sat) by Wol (guest, #4433) [Link]

Cheers,
Wol

The case for the /usr merge

Posted Jan 29, 2012 21:55 UTC (Sun) by elanthis (guest, #6227) [Link]

This is in part because the library wasn't designed for this use case in the first place.*

However, why should the library be directly dlopen'd? Why not put a plugin architecture into wpa_supplicant itself, with the plugin linking against the library normally, and with only a very narrow and plugin-friendly interface being shared across that dlopen boundary? This even makes it trivial to have the package manager intelligently support the package dependencies by putting the plugin in its own package; users who need the feature install the plugin and get all dependencies pulled in, and users who don't will not need those. There's then a case to be made that the network configuration tools in Anaconda and the desktop tools need to be made aware of feature package dependencies to pull these things in automatically, but that's a polish thing (not FOSS's strength, but not out of the realm of possibility by any stretch).

[*] There's an argument to be made -- especially in the FOSS world where the source is available and modifiable by anyone and everyone -- that libraries should offer the kinds of interfaces their clients prefer, rather than client applications making "not our fault" claims when library interfaces don't allow features users want (like moving dependencies from compile-time to run-time).

The case for the /usr merge

Posted Jan 30, 2012 2:30 UTC (Mon) by HelloWorld (guest, #56129) [Link]

The question is, why bother? It works just fine now and nobody outside the embedded world cares about the few dozen kB of "bloat" libpcsclite induces. On embedded systems, a custom-compiled version can be used. Any amount of time spent on stuff like this would a useless waste of developer resources.

The case for the /usr merge

Posted Jan 27, 2012 14:30 UTC (Fri) by foom (subscriber, #14868) [Link]

I'd bet that nobody has actually ever noticed the extra resources it uses, other than the very scarce "resource" of the extra lines in the ldd output.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds