Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 25.1.x back into main #5631

Merged
merged 4 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@
alternate_emails:
- [email protected]
- name: Ken Odegard
num_commits: 232
num_commits: 231
email: [email protected]
first_commit: 2020-09-08 19:53:41
github: kenodegard
Expand Down Expand Up @@ -1281,7 +1281,7 @@
- name: Travis Hathaway
email: [email protected]
github: travishathaway
num_commits: 7
num_commits: 8
first_commit: 2022-05-12 05:53:02
- name: Kyle Leaders
email: [email protected]
Expand Down Expand Up @@ -1479,7 +1479,7 @@
- name: Tony Kelman
email: [email protected]
github: tkelman
num_commits: 1
num_commits: 2
first_commit: 2025-01-08 09:50:24
- name: Yoann Cédric Pradat
email: [email protected]
Expand All @@ -1489,7 +1489,7 @@
- name: Mahe Iram Khan
email: [email protected]
github: ForgottenProgramme
num_commits: 1
num_commits: 2
first_commit: 2025-01-13 18:15:05
alternate_emails:
- [email protected]
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
[//]: # (current developments)

## 25.1.2 (2025-02-05)

### Enhancements

* Fix LIEF>=0.15 compatibility. (#5594 via #5595)

### Contributors

* @tkelman



## 25.1.1 (2025-01-14)

### Deprecations
Expand Down
29 changes: 17 additions & 12 deletions conda_build/os_utils/liefldd.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
except AttributeError:
# Fallback for lief<0.15.
ELF_DYNAMIC_TAGS = lief.ELF.DYNAMIC_TAGS
try:
LOAD_COMMAND_TYPES = lief.MachO.LoadCommand.TYPE
except AttributeError:
# Fallback for lief<0.15.
LOAD_COMMAND_TYPES = lief.MachO.LOAD_COMMAND_TYPES
try:
ELF_CLASS = lief.ELF.Header.CLASS
except AttributeError:
# Fallback for lief<0.15.
ELF_CLASS = lief.ELF.ELF_CLASS
except ImportError:
have_lief = False

Expand Down Expand Up @@ -134,7 +144,7 @@ def get_libraries(file):
binary_name = [
command.name
for command in binary.commands
if command.command == lief.MachO.LOAD_COMMAND_TYPES.ID_DYLIB
if command.command == LOAD_COMMAND_TYPES.ID_DYLIB
]
binary_name = binary_name[0] if len(binary_name) else None
result = [
Expand Down Expand Up @@ -193,10 +203,7 @@ def get_rpathy_thing_raw_partial(file, elf_attribute, elf_dyn_tag):
binary_format = binary.format
if binary_format == EXE_FORMATS.ELF:
binary_type = binary.type
if (
binary_type == lief.ELF.ELF_CLASS.CLASS32
or binary_type == lief.ELF.ELF_CLASS.CLASS64
):
if binary_type == ELF_CLASS.CLASS32 or binary_type == ELF_CLASS.CLASS64:
rpaths = _get_elf_rpathy_thing(binary, elf_attribute, elf_dyn_tag)
elif (
binary_format == EXE_FORMATS.MACHO
Expand All @@ -207,7 +214,7 @@ def get_rpathy_thing_raw_partial(file, elf_attribute, elf_dyn_tag):
[
command.path
for command in binary.commands
if command.command == lief.MachO.LOAD_COMMAND_TYPES.RPATH
if command.command == LOAD_COMMAND_TYPES.RPATH
]
)
return rpaths, binary_format, binary_type
Expand Down Expand Up @@ -250,8 +257,7 @@ def set_rpath(old_matching, new_rpath, file):
if not binary:
return
if binary.format == EXE_FORMATS.ELF and (
binary.type == lief.ELF.ELF_CLASS.CLASS32
or binary.type == lief.ELF.ELF_CLASS.CLASS64
binary.type == ELF_CLASS.CLASS32 or binary.type == ELF_CLASS.CLASS64
):
if _set_elf_rpathy_thing(
binary, old_matching, new_rpath, set_rpath=True, set_runpath=False
Expand Down Expand Up @@ -339,7 +345,7 @@ def from_os_varnames(binary_format, binary_type, input_):
.replace("@rpath", "$RPATH")
)
elif binary_format == EXE_FORMATS.ELF:
if binary_type == lief.ELF.ELF_CLASS.CLASS64:
if binary_type == ELF_CLASS.CLASS64:
libdir = "/lib64"
else:
libdir = "/lib"
Expand All @@ -365,8 +371,7 @@ def get_uniqueness_key(filename, file):
elif binary.format == EXE_FORMATS.MACHO:
return filename
elif binary.format == EXE_FORMATS.ELF and ( # noqa
binary.type == lief.ELF.ELF_CLASS.CLASS32
or binary.type == lief.ELF.ELF_CLASS.CLASS64
binary.type == ELF_CLASS.CLASS32 or binary.type == ELF_CLASS.CLASS64
):
dynamic_entries = binary.dynamic_entries
result = [e.name for e in dynamic_entries if e.tag == ELF_DYNAMIC_TAGS.SONAME]
Expand Down Expand Up @@ -483,7 +488,7 @@ def inspect_linkages_lief(
if not binary:
default_paths = []
elif binary.format == EXE_FORMATS.ELF:
if binary.type == lief.ELF.ELF_CLASS.CLASS64:
if binary.type == ELF_CLASS.CLASS64:
default_paths = [
"$SYSROOT/lib64",
"$SYSROOT/usr/lib64",
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pillow==10.0.1
PyYAML==6.0.1
Sphinx==8.1.3
conda-sphinx-theme==0.2.2
conda-sphinx-theme==0.2.3
linkify-it-py==2.0.2
myst-parser==4.0.0
pylint==2.17.5
Expand Down
2 changes: 1 addition & 1 deletion tests/test-recipes/metadata/_rpath/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ test:
commands:
- python -c "import lief; binary = lief.parse(\"${PREFIX}/bin/rpath\"); print([e.rpath for e in binary.dynamic_entries if e.tag == getattr(lief.ELF, 'DYNAMIC_TAGS', getattr(lief.ELF.DynamicEntry, 'TAG', None)).RPATH])" # [linux]
- python -c "import lief; binary = lief.parse(\"${PREFIX}/bin/rpath\"); print([e.rpath for e in binary.dynamic_entries if e.tag == getattr(lief.ELF, 'DYNAMIC_TAGS', getattr(lief.ELF.DynamicEntry, 'TAG', None)).RPATH])" | grep \$ORIGIN/../previous:\$ORIGIN/../lib:\$ORIGIN/../plugins:\$ORIGIN/../successive # [linux]
- python -c "import lief; binary = lief.parse(\"${PREFIX}/bin/rpath\"); print(':'.join([command.path.rstrip('/') for command in binary.commands if command.command == lief.MachO.LOAD_COMMAND_TYPES.RPATH]))" | grep ${PREFIX}/../previous:${PREFIX}/../lib:${PREFIX}/plugins:${PREFIX}/../successive # [osx]
- python -c "import lief; binary = lief.parse(\"${PREFIX}/bin/rpath\"); print(':'.join([command.path.rstrip('/') for command in binary.commands if command.command == getattr(lief.MachO, 'LOAD_COMMAND_TYPES', getattr(lief.MachO.LoadCommand, 'TYPE', None)).RPATH]))" | grep ${PREFIX}/../previous:${PREFIX}/../lib:${PREFIX}/plugins:${PREFIX}/../successive # [osx]
2 changes: 1 addition & 1 deletion tests/test-recipes/metadata/_rpath_symlink/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ test:
import os, lief
lib = lief.parse(os.environ["PREFIX"] + "/lib/{{ lib_file }}")
assert {"$ORIGIN/."} == {e.rpath for e in lib.dynamic_entries if e.tag == getattr(lief.ELF, "DYNAMIC_TAGS", getattr(lief.ELF.DynamicEntry, "TAG", None)).RPATH} # [linux]
assert {"@loader_path/"} == {command.path for command in lib.commands if command.command == lief.MachO.LOAD_COMMAND_TYPES.RPATH} # [osx]
assert {"@loader_path/"} == {command.path for command in lib.commands if command.command == getattr(lief.MachO, "LOAD_COMMAND_TYPES", getattr(lief.MachO.LoadCommand, "TYPE", None)).RPATH} # [osx]
'
2 changes: 1 addition & 1 deletion tests/test_api_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@ def test_recursion_layers(testing_config):
reason="spaces break openssl prefix replacement on *nix",
)
@pytest.mark.skipif(
datetime.now() < datetime(2025, 1, 31),
datetime.now() < datetime(2025, 3, 31),
reason="Unblock CI while https://github.com/mamba-org/mamba/issues/3730 gets a fix",
)
def test_croot_with_spaces(testing_metadata, testing_workdir):
Expand Down
Loading