Skip to content

Commit

Permalink
fix: pin back lief again (#964)
Browse files Browse the repository at this point in the history
* fix: pin back lief again

* fix: pin back lief here for one time to ensure build runs

* fix: try lief 0.15.x

* fix: pin stricter does not work without a0 ending

* fix: allow more syntax for tighten depends
  • Loading branch information
beckermr authored Feb 23, 2025
1 parent a452c26 commit 85d71c6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions recipe/patch_yaml/conda-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,13 @@ then:
- tighten_depends:
name: py-lief
upper_bound: "0.15"
---
# https://github.com/conda/conda-build/issues/5626
if:
name: conda-build
version_le: 25.1.2
timestamp_le: 1740306410000 # 2025-02-23
then:
- tighten_depends:
name: py-lief
upper_bound: "0.16"
27 changes: 27 additions & 0 deletions recipe/patch_yaml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,33 @@ def _pin_stricter(fn, record, fix_dep, max_pin, upper_bound=None):

continue

if (
len(dep_parts) == 2
and dep_parts[1].startswith("<")
and upper_bound is not None
):
upper_bound = upper_bound.split(".")
if str(upper_bound[-1]) != "0":
upper_bound += ["0"]
upper_bound = ".".join(upper_bound)

old_upper = dep_parts[1].split("<")[1]
if old_upper.startswith("="):
# if the old pin is <=, we need to remove the =
# and we allow changes of eg <=15 to <15.0a0
# hence the condition includes >=
old_upper = old_upper[1:]
cond = parse_version(old_upper) >= parse_version(upper_bound)
else:
cond = parse_version(old_upper) > parse_version(upper_bound)
if cond:
depends[dep_idx] = "{} <{}a0".format(
dep_parts[0],
upper_bound,
)
record["depends"] = depends
continue


def _pin_looser(fn, record, fix_dep, max_pin=None, upper_bound=None):
depends = record.get("depends", ())
Expand Down

0 comments on commit 85d71c6

Please sign in to comment.