|
Boost : |
Subject: [boost] Interlibrary version cchecking
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-05-12 01:56:40
Turns out that the idea of a single boost library deployment has come up a
couple of times here at BoostCon 2010. While preparing my presentation I
considered the problem of what would happen if one installed one library
which depended on an newer version of a different library than the user
already had installed. I actually woke up in the middle of the night
imagining someone would ask about that during my talk. I puzzled about it
for some time and the day before I found a way to address it - in my own
mind at least. It also seems that it turns out that there are tools that
can also manage this.
It's not that I don't trust tools but I wear a belt AND suspenders. So I
would like a method which guarentees that when I build one library, I don't
accidently include code from a prerequisite library which is a version so
old that things won't work. I would also like to know that I'm not
accidently running with a DLL built with an old version.
Basically each library includes a file "manifest.hpp". This get's included
when any header get's includes (once at most due to include guards). This
includes a static assert that checks that the prequiste libraries are of
sufficiently recent version that a dependent library (or user application)
requires. There is also a manifest.cpp file included in the library which
checks any prequiste DLLS. This would be an exheedingly small overhead to
avoid what could be an incredibly large headache.
I just verified that the code compiles so at this point it's only an idea.
But it seems that some kind of check like this is un-avoidable of one want's
to deploy libraries as needed rather than as a monolithic distribution.
FYI - no one asked me about this problem at my presentation. Add one more
confirmation of Murphy's law.
Robert Ramey
begin 666 manifest.hpp
M(VEF;F1E9B!"3T]35%]315))04Q)6D%424].7TU!3DE&15-47TA04 T*(V1E
M9FEN92!"3T]35%]315))04Q)6D%424].7TU!3DE&15-47TA04 T*#0HO+R!-
M4R!C;VUP871I8FQE(&-O;7!I;&5R<R!S=7!P;W)T("-P<F%G;6$@;VYC90T*
M(VEF(&1E9FEN960H7TU30U]615(I("8F("A?35-#7U9%4B ^/2 Q,#(P*0T*
M(R!P<F%G;6$@;VYC90T*(V5N9&EF#0H-"B\O+R\O+R\O+S$O+R\O+R\O+R\R
M+R\O+R\O+R\O,R\O+R\O+R\O+S0O+R\O+R\O+R\U+R\O+R\O+R\O-B\O+R\O
M+R\O+S<O+R\O+R\O+R\X#0HO+R!M86YI9F5S="YH<' Z(%9E<FEF>2!T:&%T
M(&%L;"!D97!E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Z
M=F%L=64[#0I]#0II;G0-"FUA;FEF97-T.CIG971?:6UP;&5M96YT871I;VY?
M=F5R<VEO;B_at_I>PT*"7)E='5R;B!I;7!L96UE;F%T:6]N7W9E<G-I;VXZ.G9A
K;'5E.PT*?0T*#0I]("\O('-E<FEA;&EZ871I;VX-"GT@+R\@8F]O<W0-"@``
`
end
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk