odoo icon indicating copy to clipboard operation
odoo copied to clipboard

[MERGE] [FIX] various: adapt 14.0 to work with ubuntu jammy (22.04)

Open d-fence opened this issue 3 years ago • 1 comments

Ubuntu Jammy brings some breaking changes for odoo 14.0. This PR aims to ensure compatibility if deployed on ubuntu Jammy. This PR is mainly a backport of #88803

Main changes

  • support for python 3.10
  • werkzeug 2.0+, including vendoring werkzeug's user agent parser in odoo/tools/_vendor/useragents.py (= the one from version 0.16) as it is discontinued after v2.1
  • currentThread is now deprecated (use current_thread instead)
  • default requirement version (based on deb package version)
  • new opcode in python 3.10
  • distutils.version.LooseVersion is deprecated

wkhtmltopdf

wkhtmltopdf version packaged with ubuntu jammy doesn't have patched qt but will work without headers and footers. Suggested wkhtmltopdf version 0.12.5 doesn't have a build working with jammy yet because of incompatible libssl dependencies. A working version can be found on nightly server.

As usual, all changes are made with the spirit to keep compatibility with previous version (Focal)

enterprise PR: odoo/enterprise#30412

d-fence avatar Aug 12 '22 12:08 d-fence

@robodoo override=ci/security

Mostly getattr on the current thread for testing, but also a few import changes due to werkzeug.utils.unescape going away.

xmo-odoo avatar Aug 16 '22 05:08 xmo-odoo

@fw-bot ignore

d-fence avatar Aug 17 '22 06:08 d-fence

Forward-port disabled.

fw-bot avatar Aug 17 '22 06:08 fw-bot

Some of those changes are actually unnecessary for compatibility. Everything that has to do with newer DeprecationWarnings can be safely handled with an extra filterwarnings().

It's kind of the point: we know about those deprecations, and we deal with them in master. If the code still works, changing it in stable versions to avoid a mere warning is not a good trade-off.

Commit-wise:

  1. _vendor: fix compatibility with werkzeug 2.0+ ok

  2. core: ignore invalid escape sequence in 3.10 ok, it's already a warnings filter

  3. report: replace deprecated LooseVersion method not needed, still works fine -> filter the DeprecationWarnings instead

  4. various: replace deprecated currentThread method not needed, still works fine -> filter the DeprecationWarnings instead

  5. server: replace deprecated daemon getter/setter not needed, still works fine -> filter the DeprecationWarnings instead

  6. tools, qweb: vendoring werkzeug escape ok

  7. safe_eval: add new py 3.10 GEN_START opcode ok

  8. requirements: adapt for ubuntu ok

  9. link_tracker, pos_mercury: use unescape from html ok

  10. http: use vendored user agent parser ok

  11. http, web: use Response instead of BaseResponse ok

  12. http_routing: properly handle httprequest.path ok, but not sure how safe the patch is

  13. bus: deprecated threading attribute (and then some) I think the only needed part is the import gevent.event fix.

  14. base: filter out reportlab deprecation warning ok, already a filterwarnings

  15. website: return string for login redirect ok

odony avatar Aug 25 '22 17:08 odony

FYI there is a special build on the enterprise trigger with 3 sub-builds:

  • Ubuntu 22 with requirements installed at build time
  • Ubuntu 22 without requirements
  • Normal build (Focal)

d-fence avatar Aug 26 '22 12:08 d-fence

@fw-bot ignore Ping @odony I think it's good now.

d-fence avatar Sep 09 '22 09:09 d-fence

Forward-port disabled.

fw-bot avatar Sep 09 '22 09:09 fw-bot

jamy

xmo-odoo avatar Nov 08 '22 09:11 xmo-odoo

robodoo r+

d-fence avatar Nov 08 '22 15:11 d-fence

@d-fence you may want to rebuild or fix this PR as it has failed CI.

robodoo avatar Nov 08 '22 15:11 robodoo

robodoo rebase-merge

d-fence avatar Nov 08 '22 15:11 d-fence

Merge method set to rebase and merge, using the PR as merge commit message.

robodoo avatar Nov 08 '22 15:11 robodoo

didn't see the red ci/style immediately ...

d-fence avatar Nov 08 '22 16:11 d-fence

robodoo r+

d-fence avatar Nov 09 '22 07:11 d-fence