Discussion:
[xplc-general] lack of linker
Pierre Phaneuf
2004-01-30 16:21:25 UTC
Permalink
Avery Pennarun wrote:

Moving this to xplc-general...
XPLC is going to have the same problem...
http://www.joelonsoftware.com/articles/PleaseLinker.html
But it's only 18 *kilobytes*. ;-)
I don't understand... how can you have the same problem?
Your module loader will know exactly which dlls provide which UUIDs
(or monikers), and you could write a little script to grab just
those, throw them in a zip file, and ta da! Instant linker.
Yeah, but it won't know what a program or a module needs (there's no
direct equivalent to "nm -u" or "ldd"). So you don't know what to grab.

This is a pretty difficult problem, which I am just ignoring at the
moment, hoping that nobody will really notice. :-)

For example, imagine that programs and modules could somehow specify
what they want. We'd have to separate what they positively need (and
can't run at all without) and what they can use optionally. With
categories, you might want to specify that you need at least component
of a category (it doesn't matter which component exactly). With
monikers, you might want to have at least some specific monikers, or
some monikers of a kind at least or something (monikers are especially
loosely bound, which is their coolest feature, but is most annoying in
this attempt to find some static information).

To top this off, a module advertising a UUID is not garanteed to provide
it. It might decide that you are missing some other stuff (for example,
a component to support MNG files (which are a superset of PNG files)
could need a component providing support for PNG files), so just looking
at a module and seeing a given UUID doesn't mean that you're good.

One thing that could be feasible would be a program that has a special
tracing module loader and loads a module that you give as a parameter,
and would then be able to report the UUIDs that the module attempted to
load (real easy) and in which modules it found these UUIDs (not as
easy). That wouldn't be perfect, but could be helpful.
--
Pierre Phaneuf
Mad Scientist, NITI R&D
Avery Pennarun
2004-01-31 16:10:03 UTC
Permalink
Post by Pierre Phaneuf
One thing that could be feasible would be a program that has a special
tracing module loader and loads a module that you give as a parameter,
and would then be able to report the UUIDs that the module attempted to
load (real easy) and in which modules it found these UUIDs (not as
easy). That wouldn't be perfect, but could be helpful.
Or you could auto-install a debian package that "Provides:" a particular
XPLC interface. Mind you, Debian would find you quite unpopular if you
started naming packages like
xplc-4e6d624a-b7a3-47ad-ad8b-cc7fb06ec5d8_1.0-4_i386.deb. :)

(Monikers would work, though.)

Have fun,

Avery
Pierre Phaneuf
2004-01-31 17:03:32 UTC
Permalink
Post by Avery Pennarun
Post by Pierre Phaneuf
One thing that could be feasible would be a program that has a
special tracing module loader and loads a module that you give as a
parameter, and would then be able to report the UUIDs that the
module attempted to load (real easy) and in which modules it found
these UUIDs (not as easy). That wouldn't be perfect, but could be
helpful.
Or you could auto-install a debian package that "Provides:" a
particular XPLC interface. Mind you, Debian would find you quite
unpopular if you started naming packages like
xplc-4e6d624a-b7a3-47ad-ad8b-cc7fb06ec5d8_1.0-4_i386.deb. :)
Finding out what a module provides is not so difficult (look at the
ModuleInfo array, for a start), the question is how to figure out the
"Requires:". The Debian packager uses "ldd", which wouldn't be so useful
with XPLC modules.

In RPMs, the "Provides:" don't go in the name, so you could have a
libpng-xplc-1.2-3.i386.rpm that has a "Provides:
xplc-4e6d624a-b7a3-47ad-ad8b-cc7fb06ec5d8" and no one would ever know
(apart from the fact that it would make it work!). Isn't that also
possible with Debian packages?

With RPMs, you can choose whether to conflict or not with such virtual
packages, so using this feature for categories would be pretty easy
(members of a category "Provides:" it, those needing it "Requires:" it,
and it doesn't matter how many or which one you have, as long as you
have at least one).
--
Pierre Phaneuf
http://advogato.org/person/pphaneuf/
"I am denial, guilt and fear -- and I control you"
Stephane Lajoie
2004-01-31 18:13:24 UTC
Permalink
Post by Pierre Phaneuf
Post by Avery Pennarun
Or you could auto-install a debian package that "Provides:" a
particular XPLC interface. Mind you, Debian would find you quite
unpopular if you started naming packages like
xplc-4e6d624a-b7a3-47ad-ad8b-cc7fb06ec5d8_1.0-4_i386.deb. :)
Finding out what a module provides is not so difficult (look at the
ModuleInfo array, for a start), the question is how to figure out the
"Requires:". The Debian packager uses "ldd", which wouldn't be so useful
with XPLC modules.
I think Avery meant for the module loader to auto-install a package at
runtime when it can't fulfill a requirement otherwise. I suspect he's
not serious though, as that would require an external suid program
that any user could run :).

That leads directly to ideas about code signing and stuff like that
but I can hear Pierre already: "keep those silly ActiveX horrors out
of my XPLC!". So I'll shut up now :).
--
Stéphane Lajoie
***@cam.org
Avery Pennarun
2004-01-31 19:29:00 UTC
Permalink
Post by Stephane Lajoie
Post by Pierre Phaneuf
Post by Avery Pennarun
Or you could auto-install a debian package that "Provides:" a
particular XPLC interface. Mind you, Debian would find you quite
unpopular if you started naming packages like
xplc-4e6d624a-b7a3-47ad-ad8b-cc7fb06ec5d8_1.0-4_i386.deb. :)
Finding out what a module provides is not so difficult (look at the
ModuleInfo array, for a start), the question is how to figure out the
"Requires:". The Debian packager uses "ldd", which wouldn't be so useful
with XPLC modules.
I think Avery meant for the module loader to auto-install a package at
runtime when it can't fulfill a requirement otherwise. I suspect he's
not serious though, as that would require an external suid program
that any user could run :).
That leads directly to ideas about code signing and stuff like that
but I can hear Pierre already: "keep those silly ActiveX horrors out
of my XPLC!". So I'll shut up now :).
I'll avoid clearing up any rumours about whether I was serious, but yes,
Debian's Provides: can work without your package being named specially
(that's what it's for, in fact). And all Debian packages are already
digitally signed and approved by Debian...

There's also the possibility of using a distributed filesystem for finding
and using the modules you want without actually "installing" stuff - if it
has the right UUID, then you know it's supposed to work. Then you
*definitely* have to care about signing packages, though (or running them
inside a secure virtual system, which is probably much worse).

Have fun,

Avery

Loading...