Commit dbe3d0bb authored by David Fifield's avatar David Fifield
Browse files

Reset mtimes on .py files before py2exe.

.pyc files contain the mtime of the .py file used to produce them. I
couldn't find a way to prevent py2exe from byte-compiling .pyc files.

http://benno.id.au/blog/2013/01/15/python-determinism
parent d0a0e020
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -136,6 +136,9 @@ script: |
  LD_PRELOAD= $INSTPYTHON setup.py install --single-version-externally-managed --record /dev/null
  cd ..
  #
  # py2exe byte-compiles to .pyc files, which embed the mtime of the parent .py file.
  find $INSTDIR/python -type f | xargs touch --date="$REFERENCE_DATETIME"
  #
  cd obfsproxy
  find -type f | xargs touch --date="$REFERENCE_DATETIME"
  LD_PRELOAD= $INSTPYTHON setup_py2exe.py py2exe
@@ -158,6 +161,8 @@ script: |
  LD_PRELOAD= $INSTPYTHON setup.py install --single-version-externally-managed --record /dev/null
  cd ..
  #
  find $INSTDIR/python -type f | xargs touch --date="$REFERENCE_DATETIME"
  #
  cd flashproxy
  find -type f | xargs touch --date="$REFERENCE_DATETIME"
  make dist-exe DISTNAME=flashproxy-client PYTHON="LD_PRELOAD= $INSTPYTHON"