realh / roxterm

A highly configurable terminal emulator
GNU General Public License v2.0
102 stars 12 forks source link

regular expression compilation warnings on startup #201

Open zenogantner opened 5 years ago

zenogantner commented 5 years ago

I get plenty of warnings like the following on startup

** (roxterm:7735): WARNING **: 14:32:41.756: Failed to compile regex '(?<APOS_START>(?<='))?(?(DEFINE)(?<S4>(?x: (?: [0-9] | [1-9][0-9] | 1[0-9]{2} | 2[0-4][0-9] | 25[0-5] ) (?! [0-9] ) )))(?(DEFINE)(?<IPV4>(?x: (?: (?&S4) \. ){3} (?&S4) )))(?(DEFINE)(?<S6>[[:xdigit:]]{1,4})(?<CS6>:(?&S6))(?<S6C>(?&S6):))(?(DEFINE)(?<IPV6>(?x: (?: (?x: :: ) | (?x: : (?&CS6){1,7} ) | (?x: (?! (?: [[:xdigit:]]*: ){8} ) (?&S6C){1,6} (?&CS6){1,6} ) | (?x: (?&S6C){1,7} : ) | (?x: (?&S6C){7} (?&S6) ) | (?: (?x: (?&S6C){6} ) | (?x: :: (?&S6C){0,5} ) | (?x: (?! (?: [[:xdigit:]]*: ){7} ) (?&S6C){1,4} (?&CS6){1,4} ) : | (?x: (?&S6C){1,5} : ) ) (?&IPV4) ) (?! [.:[:xdigit:]] ) )))(?(DEFINE)(?<PATH_INNER>(?x: (?: [-[:alnum:]\Q_$.+!*,:;@&=?/~#|%'\E]* (?: \( (?&PATH_INNER) \) | \[ (?&PATH_INNER) \] ) )* [-[:alnum:]\Q_$.+!*,:;@&=?/~#|%'\E]* )))(?(DEFINE)(?<PATH>(?x: (?: [-[:alnum:]\Q_$.+!*,:;@&=?/~#|%'\E]* (?: \( (?&PATH_INNER) \) | \[ (?&PATH_INNER) \] ) )* (?: [-[:alnum:]\Q_$.+!*,:;@&=?/~#|%'\E]* (?(<APOS_START>)[-[:alnum:]\Q_$+*:@&=/~#|%\E]|[-[:alnum:]\Q_$+*:@&=/~#|%'\E]) )? )))(?ix: news | telnet | nntp | https? | ftps? | sftp | webcal )://(?:[-+.[:alnum:]]+(?x: :[-[:alnum:]\Q,?;.:/!%$^*&~"#'\E]* )?@)?(?x: (?x: (?: (?x: [-[:alnum:]] | (?! [[:ascii:]] ) [[:graph:]] )+ \. )* (?x: [-[:alnum:]] | (?! [[:ascii:]] ) [[:graph:]] )* (?! [0-9] ) (?x: [-[:alnum:]] | (?! [[:ascii:]] ) [[:graph:]] )+ ) | (?&IPV4) | \[ (?&IPV6) \] )(?x: \:(?x: (?: [1-9][0-9]{0,3} | [1-5][0-9]{4} | 6[0-4][0-9]{3} | 65[0-4][0-9]{2} | 655[0-2][0-9] | 6553[0-5] ) (?! [0-9] ) ) )?(?x: /(?&PATH) )?': PCRE2 not supported
realh commented 5 years ago

I guess this is on Ubuntu? For rather obscure reasons they've chosen not to accept a pcre2 package and disabled it in other packages including vte. So the find feature won't work currently.

zenogantner commented 5 years ago

Exactly, this is on Ubuntu 18.04.

There is a libpcre2-dev package but I guess you access the functionality via vte, according your description.

So there is nothing we can do right now?

realh commented 5 years ago

Yes, the functionality is provided by vte and Ubuntu's version has that feature disabled. I don't know why they would have provided a dev package without the corresponding runtime/binary.

I think vte still has the old regex functions (based on libpcre3, which is older than libpcre2, the 3 came from Debian and isn't official apparently) but they're deprecated. Ubuntu's gnome-terminal etc have probably been patched to revert to using those. Roxterm used to have its own set of regexes, but when I updated it for the pcre2 API I scrapped them and more-or-less copied more sophisticated ones from gnome-terminal, and I don't know how easy it would be to convert those back to pcre3 or whether whatever g-t used before pcre2 are good replacements.

Another possibility would be to add pcre2 from Debian and a rebuilt vte to my PPA, but that might cause some hassle with dependencies, so I think reverting to pcre3 would be preferable.

egmontkob commented 5 years ago

FYI

Ubuntu has finally dropped their pcre revert nightmare. For dingo onwards they'll go with pcre2.

http://changelogs.ubuntu.com/changelogs/pool/main/v/vte2.91/vte2.91_0.54.2-2ubuntu2/changelog https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1666264 https://bugs.launchpad.net/ubuntu/+source/pcre3/+bug/1792544

nalt commented 4 years ago

Where does this regex come from? Is there a way to disable this warning by configuration?

realh commented 4 years ago

You can silence these warnings by not reporting them in roxterm_match_add(), but the search functions still won't work. I don't really want to have to work around an old Ubuntu problem in roxterm.

The best solution would be to backport pcre2 and a version of vte recompiled with it enabled.

nalt commented 4 years ago

This happens on 18.04, which is going to stick around for a while. Nothing that can be done at runtime? We use your PPA, I really want to avoid to compile my own roxterm.