[OmniOS-discuss] pkg verify failing on pyc files

Peter Tribble peter.tribble at gmail.com
Thu Oct 8 20:31:07 UTC 2015


On Thu, Oct 8, 2015 at 8:37 PM, Lauri Tirkkonen <lotheac at iki.fi> wrote:

> On Thu, Oct 08 2015 18:56:51 +0100, Peter Tribble wrote:
> > That's all correct. The packages appear to have been published using
> > pkgsend -T so
> > that the timestamps on the .py files are preserved, and they match the
> > timestamps
> > encoded into the packaged .pyc files..
> >
> > Which makes me wonder even more why it's found it necessary to recompile
> > the files, it's not the normal python version or source timestamp
> mismatch.
>
> I think I found a clue for this. I checked an old box I've upgraded
> through multiple releases


That seems to be the key point. I'm seeing it on upgraded boxes.
Just checked a fresh install, that's clean.

Going back, in earlier omnios releases the .py files didn't have fixed
timestamps.
Some of them (pybonjour.py for example) should be dated 2008. As a result,
the
older releases pretty much always rebuilt the pyc files.

The upgrade process correctly sets the timestamp on the .py files. That bit
appears
to work. Presumably, it also should put the correct .pyc file from the
repo, but that
doesn't seem to work correctly. I suspect some sort of race between python
explicitly writing the .pyc file from the repo and python recompiling the
.pyc file
because the one it had becomes invalid as soon as the timestamp on the .py
file gets updated.

In any event, I suspect that if you run pkg fix after the upgrade, then
because
everything now matches up, it'll be good in the future. At least, I've done
that
on one system and it hasn't deviated since.


> and sure enough, .pyc files had been
> regenerated after install for, among other things, the simplejson-26
> package. I checked the timestamps for one such .py/.pyc pair:
>
>     -rw-r--r--   1 root     bin         1036 Jul 22  2014
> /usr/lib/python2.6/vendor-packages/simplejson/compat.py
>     -rw-r--r--   1 root     root        2040 Apr  3  2015
> /usr/lib/python2.6/vendor-packages/simplejson/compat.pyc
>
> But this is strange - surely the package is newer than July 2014 on this
> 151014 box?
>
>     % pkg list -Hv simplejson-26
>     pkg://omnios/library/python-2/simplejson-26@3.6.5-0.151014:20150402T184431Z
> i--
>
> Yes, yes it is, and it *was* built using pkgsend -T '*.py'. However,
> the commit in omnios-build introducing that was authored on Mar 25 2015
> (8cc8f3ef45d9c7d8ccdfda608d00599cd3890597). My theory is that if the
> file content does not change, even if pkgsend -T is used to preserve the
> timestamps, the file is not touched on update; would that help explain
> what you're seeing?
>
> --
> Lauri Tirkkonen | lotheac @ IRCnet
> _______________________________________________
> OmniOS-discuss mailing list
> OmniOS-discuss at lists.omniti.com
> http://lists.omniti.com/mailman/listinfo/omnios-discuss
>



-- 
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://omniosce.org/ml-archive/attachments/20151008/f9b985fe/attachment.html>


More information about the OmniOS-discuss mailing list