Author: Ashok P. Nadkarni <[email protected]>
State: Draft
Type: Project
Tcl-Version: 9.1
Tcl-Branch: tip-702
Abstract
This TIP proposes to always statically link the registry and dde extensions on Windows.
Rationale
Historically, the registry
and dde
packages (only available on Windows)
have been shipped as separate shared libraries when Tcl is dynamically linked.
In the 9.0 default build configuration, the DLL's are stored in the ZipFS
archive and then written out to disk before loading. This has the following
drawbacks:
The file system is cluttered with temporary files that are not cleaned up - Ticket.
Some real-time AV scanners flag programs that write DLL's to disk and load them immediately as malware.
There is some performance cost associated with the mechanism, though perhaps immaterial in the grand scheme of things.
The above ticket has a proposal to use CRC's to identify the file and prevent file clutter. The exact scheme has not been detailed but any such has the potential to create race conditions. More important, it does not help with the AV flagging.
It is also the case that there is no obvious benefit to keeping the extensions as separate DLL's.
This TIP therefore proposes to always build registry
and dde
as static packages.
Specification
The nmake
and autoconf
build systems will be changed to
compile and statically link the registry and dde packages as part
of the main Tcl library (either shared or static).
The tclreg*.{lib,dll}
and tcldde*.{dll,lib}
DLL and
static libraries will no longer be built.
Applications will still be required to
package require registry
package require dde
to use the package commands. But see Discussion below.
The registry
and dde
packages will no longer be versioned
separately and will instead use the Tcl version. This is primarily
because they are always shipped as part of the Tcl core library and
a separate version adds unnecessary work to update in at least six
different locations.
The Tcl 8.7 compatible DLL's will not be built. Since Tcl 9 will no longer build the DLL's, it serves little purpose to build the ones for Tcl 8.7. Keeping both implementations in the same code base adds unnecessary complexity that will likely never be used.
Discussion
Issue: is the package require really necessary?
My preference is for the registry
and dde
commands to be
always available without the need for a package require
. It
reduces (albeit marginally) the start up overhead of registering
static libraries. However, a small incompatibility would be introduced
as applications that never use the registry
and dde
packages
may have their own registry
and dde
global commands (or from other packages)
that would now be in conflict. Personally, I feel the chances of
this are low and would prefer the commands always be available.
Opinions sought.
Implementation
See the tip-702 branch.
Copyright
This document has been placed in the public domain.