Skip to content

[3006.x] Bump cryptography, pyopenssl, msgpack, requests, setuptools; add attrs/charset-normalizer floors - #70130

Merged
dwoz merged 4 commits into
saltstack:3006.xfrom
dwoz:dwoz/srp-lts-bumps-3006.x
Aug 26, 2026
Merged

dwoz merged 4 commits into
saltstack:3006.xfrom
dwoz:dwoz/srp-lts-bumps-3006.x

Conversation

@dwoz

@dwoz dwoz commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Advance the salt-onedir Python stack on 3006.x to current LTS floors on Python 3.10+. Python 3.9 pins retained (cryptography 48+ drops 3.9.0/3.9.1; msgpack 1.2.1 drops 3.9).

  • cryptography: >=48.0.1 on py>=3.10 (46.x cap retained on py3.9). Onedir build compiles from source under --no-binary=:all: with OPENSSL_DIR set to relenv's openssl (tools/pkg/build.py), so the relenv linkage is preserved.
  • pyopenssl: drop the <26.2.0 cap. salt/modules/tls.py::__virtual__ now detects removed OpenSSL.crypto.X509Extension symbol and sets X509_EXT_ENABLED=False with a log.debug message, mirroring the existing Version("0.14") fallback. Callers needing cert extensions should use salt.modules.x509.
  • msgpack: lower bound >=1.2.0 on py>=3.10.
  • requests: lower bound >=2.34.2 on py>=3.10.
  • setuptools: constraints floor >=82.0.1 (+1 patch over already-resolved 82.0.0).
  • attrs / charset-normalizer: explicit floors added to base.txt on py>=3.10 (previously resolved below CVE-patched line via aiohttp/requests transitive).

Lock files regenerated via pre-commit pip-compile hooks.

Test plan

  • CI (test:full label applied).
  • salt.modules.tls import-smokes clean.
  • pre-commit clean on salt/modules/tls.py + new changelog entry.

@dwoz
dwoz requested a review from a team as a code owner August 25, 2026 05:01
@dwoz dwoz added the test:full Run the full test suite label Aug 25, 2026
@dwoz dwoz added this to the Sulphur v3006.28 milestone Aug 25, 2026
twangboy
twangboy previously approved these changes Aug 25, 2026
…s/charset-normalizer floors

Advance the salt-onedir Python stack to current LTS floors on
Python 3.10+. Python 3.9 retains its existing pins because
cryptography 48+ drops 3.9.0/3.9.1 which the lockfile compiler
targets, and msgpack 1.2.1 drops 3.9 entirely.

* cryptography: >=48.0.1 on py>=3.10 (46.x cap kept on py3.9).
  Salt's onedir build sets OPENSSL_DIR to relenv's openssl and
  compiles cryptography from source under --no-binary=:all:
  (tools/pkg/build.py), so linking against relenv's openssl is
  preserved.
* pyopenssl: drop the <26.2.0 cap; salt/modules/tls.py now
  detects the removed OpenSSL.crypto.X509Extension symbol in
  __virtual__ and sets X509_EXT_ENABLED=False, degrading the
  extension-authoring feature the same way the existing
  Version("0.14") branch already does. Callers that need cert
  extensions should use salt.modules.x509.
* msgpack: raise lower bound to 1.2.0 on py>=3.10.
* requests: raise lower bound to 2.34.2 on py>=3.10.
* setuptools: raise the floor in constraints.txt to 82.0.1
  (already resolved to 82.0.0 across pkg lockfiles, so a
  +1 patch bump).
* attrs / charset-normalizer: pulled in transitively by
  aiohttp / requests but resolved below the current CVE-patched
  line. Explicit floors added to base.txt on py>=3.10.

Lock files regenerated via pre-commit pip-compile hooks.
zc.lockfile==4.0's pyproject.toml [build-system].requires hardcodes
setuptools==78.1.1 (from the zopefoundation/meta template shared
across many Zope Foundation packages). That collides with this PR's
setuptools>=82.0.1 --build-constraint under pip's PEP 517 build
isolation:

  ERROR: Cannot install setuptools==78.1.1 because these package
  versions have conflicting dependencies.
    The user requested setuptools==78.1.1
    The user requested (constraint) setuptools>=82.0.1

zc.lockfile is pure-Python and ships a universal wheel on PyPI, so
letting the wheel through --only-binary bypasses the source-build
step and its build-system requirements entirely.

There is no newer zc.lockfile release; main still carries the same
pin, so upgrading is not an option.
cryptography 49+ dropped Windows x86 (cp3X-abi3-win32) wheels;
48.0.1 is the last release that ships them. 3006.x still builds
a Windows x86 onedir and the Windows salt-onedir install path
does not pass --no-binary (only Linux/macOS do), so pip falls
through to the sdist for cryptography and the Rust openssl-sys
build fails for i686-pc-windows-msvc with:

  Could not find directory of OpenSSL installation, and this
  `-sys` crate cannot proceed without this knowledge.
  $TARGET = i686-pc-windows-msvc

Cap Windows at cryptography>=48.0.1,<49.0.0; leave non-Windows
(Linux/macOS/FreeBSD) at >=48.0.1 so they keep floating to 50.x.
Same pattern as the existing pymssql win32 pin. Regenerates
Windows and FreeBSD locks; Linux and macOS locks unchanged.
pyOpenSSL 26.0 removed X509Extension, X509Req, PKCS12, CRL, and
load_crl in favor of the ``cryptography`` package. salt.modules.tls is
built on those APIs and cannot function without them; every one of
create_ca / create_csr / create_ca_signed_cert / create_pkcs12 raises
AttributeError before doing any real work.

Detect the missing APIs at import time (not just inside __virtual__)
so the module is safe to import directly from unit tests without
tripping the removed attributes. When any of them is gone,
__virtual__ returns False with a pointer to salt.modules.x509, which
is backed by cryptography and provides the equivalent functionality.

Mark the unit and integration tests that exercise the removed code
paths with a skipif that keys off the same HAS_LEGACY_PYOPENSSL flag.
Tests that only need load_certificate / X509 / PKey (e.g.
test_get_expiration_date, test_cert_info, test_create_self_signed_cert)
still run under pyOpenSSL 26 since those APIs are unaffected.
@dwoz
dwoz merged commit 20f5bd8 into saltstack:3006.x Aug 26, 2026
851 of 853 checks passed
dwoz added a commit to dwoz/salt that referenced this pull request Aug 27, 2026
The 3006.x SRP PR saltstack#70130 raised setuptools to >=82.0.1 in
constraints.txt; our merge inherited only the 3007.x >=78.1.1
floor and pip-compile resolved to setuptools==82.0.0 across
every pkg lock (regression from 3007.x's own 84.0.0 baseline).

Bump the constraint to 82.0.1 to match the SRP intent. Locks
now resolve to setuptools==84.0.0 (>= 3007.x) across every
py x platform.

This branch was previously deployed

1 inactive deployment
ci — e0a7a826 Deployed Aug 26, 2026 by dwoz via Build Onedir Packages / macOS (arm64) #26723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants