[Mono-devel-list] Re: Potential GAC implementation ideas.

Michal Moskal malekith at pld-linux.org
Fri Oct 24 07:39:59 EDT 2003


On Thu, Oct 23, 2003 at 08:22:12PM -0400, Jonathan Pryor wrote:
> The key features of shared assemblies are twofold: (1) they're versioned
> (like Unix shared libraries), so you can have multiple different
> versions installed; and (2) they have a public key token, so that if two
> developers, by chance, create a public assembly with the same name, they
> can both be installed without clobbering each other.  This, plus
> security assurances (you know if the code has been tampered with), is
> why there's a public key token.
> 
> This is also why Michal's suggestion to place all assemblies in the GAC
> is horribly broken -- the *only* assemblies that can go in the GAC are
> assemblies *designed* to go in the GAC.  This implies that they'll
> follow reasonable versioning policies, have a public/private key for
> code signing, etc.  Private assemblies lack these assurances, and thus
> are prohibited from being placed in the GAC.

Assume I'm application developer. I have an assembly that is quite private
for me, i.e. I see no particular reason anybody else would use it. So I
place it in /usr/share/apps/foobar/mydll.dll, or something like this. How
do I tell where this DLL resides to the runtime? My app wouldn't reside
in /usr/share/apps/foobar/foobar.exe, since in UNIX world it should
go to /usr/bin/foobar.exe. Shall I compile the /usr/share/apps/foobar
into foobar.exe binary using some -rpath like mechanism? This seems
broken (what if user doesn't like /usr/share/apps, what if she wants
/usr/local/share/apps etc). It's far easier for me to have reasonable
versioning and private key, and use GAC.

Now, if mono doesn't require assembly to have version and public key
token, then assemblies that don't have it, cannot go into GAC. But the
standard way of dealing with installation (recommended to the developers)
should be GAC IMHO. Because it's simple, unified and fast.

What remains to be discussed is if GAC should store files, or maybe just
references (symlinks or some database) to files. Personally I don't
care. Storing files, in a fixed way, would simplify packaging a bit,
since you don't need to choose unique location yourself. And I see no
reason why should /gac/<version>_<publictoken>/foo.dll be changed, as it
seems simple and effective.

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv
: When in doubt, use brute force. -- Ken Thompson : {E-,w}-- {b++,e}>+++ h



More information about the Mono-devel-list mailing list