Bug 242842 - security/suricata: Fails to build (5.0.0 PV=2) with Python 3.x
Summary: security/suricata: Fails to build (5.0.0 PV=2) with Python 3.x
Status: Closed Unable to Reproduce
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kubilay Kocak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-23 21:14 UTC by AS
Modified: 2020-02-17 08:36 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description AS 2019-12-23 21:14:59 UTC
Fails to compile, contents of the sphinx-err file below.  This is compiling on a fresh 12.1-RELEASE system (no python related particulars in /etc/make.conf).

# Sphinx version: 1.6.5
# Python version: 3.7.5 (CPython)
# Docutils version: 0.15.2 release
# Jinja2 version: 2.10.1
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/sphinx/cmdline.py", line 305, in main
    opts.warningiserror, opts.tags, opts.verbosity, opts.jobs)
  File "/usr/local/lib/python3.7/site-packages/sphinx/application.py", line 192, in __init__
    self.setup_extension(extension)
  File "/usr/local/lib/python3.7/site-packages/sphinx/application.py", line 456, in setup_extension
    self.registry.load_extension(self, extname)
  File "/usr/local/lib/python3.7/site-packages/sphinx/registry.py", line 196, in load_extension
    mod = __import__(extname, None, None, ['setup'])
  File "/usr/local/lib/python3.7/site-packages/sphinx/builders/latex.py", line 36, in <module>
    from sphinx.writers.latex import LaTeXWriter, LaTeXTranslator
  File "/usr/local/lib/python3.7/site-packages/sphinx/writers/latex.py", line 22, in <module>
    from docutils.writers.latex2e import Babel
  File "/usr/local/lib/python3.7/site-packages/docutils/writers/latex2e/__init__.py", line 704
    ord('\\'): ur'\textbackslash{}',
                                  ^
SyntaxError: invalid syntax
Comment 1 Franco Fichtner 2019-12-23 21:18:50 UTC
Please attach a full build log and make sure this is not a side effect of the Python 3.6 -> 3.7 defaults change and an unclean ports tree.
Comment 2 AS 2019-12-24 03:11:26 UTC
Spun up a VM with 12.1-RELEASE and *only* compiled Suricata (via ports, with dependencies).  Installed just fine.  One thing notably different is that on the VM, there's are no /^py36-/ modules installed.  On the device where the error occurred - there is a good sized list of /^py36-/ modules installed.

The primary items needed on this device:
- Apache24
- Squid
- Samba (required by Squid for Auth)
- Suricata
- Snort

Is there a way to determine which/what port(s) are fixating on Python 3.6?  Recall that something required llvm80, which required python36 - however, cannot recall what started the requirement for all the py36 modules.  Doing a "make all-depends-list" for Suricata revealed that it wanted python v2.7 and v3.7 (seems odd, no?)  I'd need to go back and try each of the installed ports to try to figure out what/why the py36 modules were injected?
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2019-12-25 02:48:51 UTC
https://sourceforge.net/p/docutils/mailman/docutils-develop/thread/qk0aso$748n$1@blaine.gmane.org/

In particular, bits marked "py3: Replace 'ur' prefix":

https://sourceforge.net/p/docutils/mailman/message/36748204/

Committed upstream as part of the larger py3 patchset in:

https://sourceforge.net/p/docutils/code/8366/

I've run docutil' test suite against all Python 3 versions (3.5-3.8) and
they fail with many Python 3 errors (including for 'ur' prefixes)

A possibly naive/premature resolution to this be to *correctly* declare the Python versions textproc/docutils supports (limiting it to Python 2.7, as is its current version support), which should have been the case in the first place, *but* this may have implications for ports that don't otherwise use/import/invoke sphinx at runtime, and don't particularly care what version of Python sphinx was built with.

In the above sense, this is similar to bug 237795

@Reporter, could you attach a bull log of the suricata failure please. It would be interesting to see where/how/when sphinx is being invoked and in what exact form
Comment 4 Franco Fichtner 2020-02-17 08:17:38 UTC
I would assume this can be closed: no other reports, can't reproduce.


Thanks,
Franco