Skip to content

Relocate binaries only when RELENV_BUILDENV is set.#274

Merged
dwoz merged 1 commit intosaltstack:mainfrom
dwoz:issue/273
Feb 4, 2026
Merged

Relocate binaries only when RELENV_BUILDENV is set.#274
dwoz merged 1 commit intosaltstack:mainfrom
dwoz:issue/273

Conversation

@dwoz
Copy link
Contributor

@dwoz dwoz commented Feb 4, 2026

Fixes: #273

This change ensures that binary relocation (using readelf/patchelf or otool/install_name_tool) is only attempted during pip installs when the RELENV_BUILDENV environment variable is set, preventing unnecessary processing for standard installs.

It also introduces logic to prefer the relenv toolchain's readelf and patchelf binaries on Linux when available, ensuring compatibility with the specific glibc version of the environment.

Tests were added to verify:

  • Relocation logic is skipped when RELENV_BUILDENV is missing.
  • Relocation logic runs when RELENV_BUILDENV is set.
  • Toolchain binaries are correctly selected over system defaults on Linux.

This change ensures that binary relocation (using readelf/patchelf or otool/install_name_tool) is only attempted during pip installs when the RELENV_BUILDENV environment variable is set, preventing unnecessary processing for standard installs.

It also introduces logic to prefer the relenv toolchain's `readelf` and `patchelf` binaries on Linux when available, ensuring compatibility with the specific glibc version of the environment.

Tests were added to verify:
- Relocation logic is skipped when RELENV_BUILDENV is missing.
- Relocation logic runs when RELENV_BUILDENV is set.
- Toolchain binaries are correctly selected over system defaults on Linux.
@dwoz dwoz merged commit c9f9349 into saltstack:main Feb 4, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relenv requires readelf when not using RELENV_BUILDENV environment variable

2 participants