diff --git a/changelog/69907.fixed.md b/changelog/69907.fixed.md new file mode 100644 index 000000000000..36df6f8c2dea --- /dev/null +++ b/changelog/69907.fixed.md @@ -0,0 +1,5 @@ +Include PyYAML manylinux wheel in Linux onedir builds so ``yaml.CSafeLoader`` +(and the libyaml-backed emitter) are available. Previously the ``--no-binary=:all:`` +pip invocation forced a PyYAML source build under the relenv toolchain, which +lacks libyaml headers; PyYAML silently fell back to the pure-Python parser, +significantly slowing config, pillar, and state parsing on large deployments. diff --git a/tools/pkg/build.py b/tools/pkg/build.py index 99f0eed070fa..4ed5ef7ba41d 100644 --- a/tools/pkg/build.py +++ b/tools/pkg/build.py @@ -629,8 +629,16 @@ def onedir_dependencies( env["RELENV_BUILDENV"] = "1" python_bin = env_scripts_dir / "python3" install_args.append("--no-binary=:all:") + # PyYAML's source build silently falls back to the pure-Python parser + # when libyaml headers are absent, and the relenv toolchain does not + # ship libyaml. That produces an onedir where yaml.CSafeLoader is + # missing, which makes salt fall back to the pure-Python SafeLoader + # and can slow config/pillar/state parsing by an order of magnitude + # on large deployments. The upstream PyYAML manylinux2014 wheel + # bundles libyaml (MIT-licensed) and is compatible with the relenv + # target platform, so allow it through --no-binary=:all: here. install_args.append( - "--only-binary=maturin,apache-libcloud,pymssql,cassandra-driver,hatchling,cmake,ninja,protobuf" + "--only-binary=maturin,apache-libcloud,pymssql,cassandra-driver,hatchling,cmake,ninja,protobuf,pyyaml" ) # CMake 4.x removed support for cmake_minimum_required(VERSION < 3.5). # pyzmq's bundled libzmq still declares an older floor; set the policy