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

RFC: usb-modeswitch 1.2.0 release embedding jimtcl

Hi all,

while upgrading the usb-modeswitch package to 1.2.0 [0] (currently in "beta"), 
I noticed that it is now embedding the "jimtcl" interpreter [1]: at build-
time, the usb-modeswitch "dispatcher" (currently written in Tcl), can now be 
embedded in a binary that contains: a tailored jimtcl interpreter, the 
dispatcher's tcl code and wrapping bits. The resulting binary is self-
contained and functionally equivalent to interpreting the tcl usb-modeswitch-

Let's also note as context that the goal of this trick (AFAIUI) is to avoid 
having a tcl interpreter pulled up to first CDs; as usb-modeswitch is part of 
the standard desktop installs (trough dependencies/recommendations), this 
imposes the presence of tcl on the first Ubuntu CD [2]. Additionally, this 
means that upstream can continue hacking in tcl instead of migrating to a 
compiled language.

[0] http://www.draisberghof.de/usb_modeswitch/usb-modeswitch-1.2.0beta.tar.bz2
[1] http://jim.berlios.de/
[2] https://bugs.launchpad.net/ubuntu/+source/usb-modeswitch/+bug/679256

== Issues ==

Now I see at least those issues with the proposed approach: 

* code duplication: the shipped jimtcl is 0.71, where upstream released 0.72 
already. jimtcl 0.71 is also already shipped as part of the openocd [3] 
package. So shipping one more copy of it in usb-modeswitch's source doesn't 

* binary-embedding: as it's proposed, the jimtcl code gets compiled as part of 
the usb-modeswitch-dispatcher binary. This essentially means that for any 
jimtcl update (be it as embedded code or as separate binary), a binNMU of usb-
modeswitch is required.

[3] http://packages.qa.debian.org/openocd

== Propositions ==

So in order to solve this smartly, I think there are basically 5 

1) "Forget about jimtcl, rely on existing tcl interpreters"

    This is mostly "repacking to avoid the embedded jimtcl copy", "no
    packaging of it, go on as is done currently; by relying on existing tcl
    Pros: easy, straightforward,avoids the binary embedding of jimtcl.
    Cons: does not solve the "desktop install needs tcl interpreter".

2) "Allow interpretation using separate jimtcl"

    This means packaging jimtcl and allow usb-modeswitch to depend on it
    (That, plus "repacking to avoid the embedded jimtcl copy")
    Pros: relatively easy, avoids the binary embedding of jimtcl.
    Cons: replaces the need of the desktop install on a "tcl interpreter" to
          "jimtcl". Although it's probably smaller.

3) "Embed jimtcl using the internal copy"

    This means taking the upstream tarball as is.
    Pros: small standalone -dispatcher binary.
    Cons: code duplication, potential security issues with out-of-date jimtcl
          versions, …

4) "Embed jimtcl using a standalone package"

    This means packaging jimtcl and do some build-time trickery to include the
    jimtcl static library (if possible, only the needed parts) into usb-
    Pros: small standalone -dispatcher binary, no code duplication.
    Cons: binNMU needed at each jimtcl upgrade, static linkeage.

5) "Rewrite the usb-modeswitch-dispatcher in C"

    This work has already been done by Mathieu Trudel-Lapierre for the
    Ubuntu ackage.
    For now, the upstream developer hasn't included this rewrite into the 
    upstream package (for his own set of reasons). My current strategy is to
    avoid as much as possible to diverge from upstream, hence why it's not in
    Debian's usb-modeswitch for now.
    Pros: No tcl interpreter needed.
    Cons: as it's not an upstream effort, it can become out-of-sync in terms
          of functionality and bugfixes (and indeed currently is as of

For now and before the enlightenments of d-devel, I think that I would order 
the solutions as following:

	2 1 4 5 3

What's your opinion ?

Thanks in advance, and cheers,


Attachment: signature.asc
Description: This is a digitally signed message part.

Reply to: