I've noticed that when the same .py file is compiled to a .pyc file by 
two builds, you don't get the same .pyc file. And since .pyc files are 
shipped in SUNWipkg, this means we get more in updates than is really 
necessary and the repository grows more than necessary.  For example, 
take a file like Uuid25.py that hasn't changed for quite a while:

 From [email protected],5.11-0.101:20081119T223449Z

file d2209cb1c675b96b938d146bccd423054df00192 
chash=a436a17bd7086ba90929b07e206456cad8e57375 group=bin mode=0444 owner=root 
path=usr/lib/python2.4/vendor-packages/pkg/Uuid25.py pkg.csize=6054 
pkg.size=20165 timestamp=20081119T211429Z
file cae4b68eaf35cd9fb789030ebe2861c74f6153a5 
chash=f3cc0a1ce131a90964f553d3f657c05cf65cf0f3 group=bin mode=0444 owner=root 
path=usr/lib/python2.4/vendor-packages/pkg/Uuid25.pyc pkg.csize=8130 
pkg.size=20289

But from the previous version: [email protected],5.11-0.101:20081113T181530Z

file d2209cb1c675b96b938d146bccd423054df00192 
chash=a436a17bd7086ba90929b07e206456cad8e57375 group=bin mode=0444 owner=root 
path=usr/lib/python2.4/vendor-packages/pkg/Uuid25.py pkg.csize=6054 
pkg.size=20165 timestamp=20081113T171315Z
file a70829935541532ae9df9923e7d206493cc7cbff 
chash=34ca22900504b8cc89c060de49b87c26c1a50cc4 group=bin mode=0444 owner=root 
path=usr/lib/python2.4/vendor-packages/pkg/Uuid25.pyc pkg.csize=8129 
pkg.size=20289

Note that the hash values for the Uuid25.py file are the same.
But the hash values for the Uuid25.pyc file are different, and the size 
of the compressed file is 1 byte different.

This difference would seem to be due to the modification time of the .py 
file being stored within the .pyc file. [1]

Does anyone have thoughts about what to recommend to Python projects 
regarding this problem? 

Should the .pyc files not be shipped in packages, thereby letting them 
be generated on the target the first time the program is run?

Is there any plan within pkg(5) to treat .pyc files specially (like ELF 
files are today)? Could the build be modified to set the modification 
time for the source files based on when they were actually modified in 
mercurial?

Regards,
Tom

[1] http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html




_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to