On Fri 2019-11-08 14:04:25 +0100, Patrick Brunschwig wrote:
> My aim is to require a subset of the tools required by Mozilla to build
> Thunderbird - the python scripts in Enigmail were all copied from the
> Mozilla build toolchain, and I never modified any of them. If the
> Mozilla build tools are migrated to python3, then I'll be happy to copy
> them over to Enigmail.

The Mozilla build tools are migrated to python3:

    https://bugzilla.mozilla.org/show_bug.cgi?id=1388447

But they have grown and changed quite a bit since you copied them into
enigmail, it looks like.

    
https://sources.debian.org/src/thunderbird/1:68.2.1-1/python/mozbuild/mozbuild/

JarMaker.py is now jar.py, etc.

copying all of that over to enigmail's source tree seems problematic at
best -- there's no clear maintenance plan, and it's a ton of code.

It looks like there are three specific commands during the build that
invoke any of the python code:

           Makefile:  util/checkFiles.py
      lang/Makefile:  $(PYTHON) ../util/JarMaker.py -j $(DIST) -t . -f flat 
$(BUILD)/lang/jar.mn
ui/content/Makefile:  $(PYTHON) $(DEPTH)/util/Preprocessor.py -I $(INCLUDE) -o 
$@ $<

checkFiles.py and Preprocessor.py appear to be relatively
straightforward to port, just using /usr/bin/2to3-2.7 and doing
straightforward manual cleanup.

But JarMaker.py has a handful of weird things that weren't very
py3-friendly:

 - use of cmp() (see 
https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons)
 
 - TypeError: '>' not supported between instances of 'time.struct_time'
  and 'int'  when doing:

       if (m.group('optOverwrite')
          or (getModTime(realsrc) >
              outHelper.getDestModTime(m.group('output')))):

anyway, i think i've fixed them on my py3 branch on gitlab:

    https://gitlab.com/dkg/enigmail/commits/py3

enigmail now builds ok for me on a dedicated machine, but it is a little
bit strange -- the updated util/Preprocessor.py sometimes leaves a
zero-byte file, rather than a preprocessed file.  I can't figure out
what's causing that, though i note that it is more likely if no
__pycache__ directory is present.

If i work around that by rebuilding when i observe that the output is
the empty file, then the built package ends up looking identical to the
package i built with python2.

I am afraid i don't understand util/Preprocessor.py well, and it appears
to only be used directly to strip out some UI for postbox in a single
file (ui/content/enigmailMessengerOverlay.xul), which doesn't seem like
a great tradeoff to me -- i'd rather have a sleeker and more robust
build system if possible.

Anyway, feel free to take a look at my py3 branch, and adopt/merge what
you like.

I've uploaded something close to it to debian/experimental, so we can
see how that turns out.

      --dkg

Attachment: signature.asc
Description: PGP signature

_______________________________________________
enigmail-users mailing list
[email protected]
To unsubscribe or make changes to your subscription click here:
https://admin.hostpoint.ch/mailman/listinfo/enigmail-users_enigmail.net

Reply via email to