Skip to content

[Bug]: Upgrade across 3006.15 (0r 3007.7) generates spurious ppbt toolchain #68781

@cjriches

Description

@cjriches

What happened?

The RPM specfile runs compileall in %post to byte-compile Python modules under /opt/saltstack/salt/lib. This worked fine until commit 48c7d58 (Bump relenv version to 0.20.0).

In relenv >=0.20.0, the interpreter bootstrap actively imports ppbt and extracts toolchains if available, rather than just checking if they're already there. This should not have been a problem, as commit 4bd2832 (Remove ppbt after building the salt onedir) removed ppbt from the final package so it never gets installed at runtime.

However, the subtleties of RPM scriptlet ordering cause issues on upgrade. The %post scriptlet executes after the new version has been installed, but before the stale files of the old version have been removed. This means that ppbt is still present when the compileall runs, so the bootstrap hooks extract the ppbt toolchain into /root/.local/relenv.

This is usually harmless, but silently eats about 215 MiB of disk space, which can be anywhere from mildly annoying to severely damaging depending on how tight the root filesystem is. In our case, it broke other functionality as there was no longer enough free space on the filesystem.

Since both 48c7d58 and 4bd2832 went into 3006.15, any in-place upgrade of salt that crosses this version will generate this spurious toolchain. Similar applies to the 3007.7 release.

I have patches for this, will post a PR shortly.

Type of salt install

Official rpm

Major version

3006.x, 3007.x

What supported OS are you seeing the problem on? Can select multiple. (If bug appears on an unsupported OS, please open a GitHub Discussion instead)

rhel-8, rockylinux-8

salt --versions-report output

This doesn't feel super relevant as it's an upgrade bug across multiple versions,
but for completeness here's some output:

Salt Version:
          Salt: 3006.17
 
Python Version:
        Python: 3.10.19 (main, Oct 30 2025, 04:53:28) [GCC 11.2.0]
 
Dependency Versions:
          cffi: 2.0.0
      cherrypy: 18.10.0
  cryptography: 42.0.5
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.6
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 24.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.19.1
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.21.2
         smmap: Not Installed
       timelib: 0.3.0
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: ahv 10.0.1.7
        locale: utf-8
       machine: x86_64
       release: 6.1.92-10.0.1.7s1c1r5.el8.x86_64
        system: Linux
       version: Nutanix AHV 10.0.1.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbroken, incorrect, or confusing behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions