neiam
/gitgud
Git Gud
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
1
Log in to mark this repository.
dependency-update: move a locked build dependency a fix needs
4ad7ecf · Gabriel Morell · 2026-10-23 04:15
Message
{commit_body(@commit)}
Files changed
modified
scripts/dependency-update
+10
−5
@@ -189,11 +189,16 @@ def bump(ecosystem, lockfile, entries):
| 189 | 189 | return [], left + [dict(e, reason=f"mix deps.update failed: {out.stderr.strip()[-200:]}") for e in fixable], [] |
| 190 | 190 | else: |
| 191 | 191 | for e in fixable: |
| 192 | − out = run( | |
| 193 | − ["cargo", "update", "-p", f"{e['name']}@{e['current']}", "--precise", e["target"]], | |
| 194 | − cwd=root, | |
| 195 | − check=False, | |
| 196 | − ) | |
| 192 | + precise = ["cargo", "update", "-p", f"{e['name']}@{e['current']}", "--precise", e["target"]] | |
| 193 | + out = run(precise, cwd=root, check=False) | |
| 194 | + # --precise moves nothing else, so a fix that needs a newer | |
| 195 | + # build dependency than the lockfile holds ("previously | |
| 196 | + # selected package `autocfg v1.5.0`") fails. Move that one | |
| 197 | + # within its own requirements, and try once more. | |
| 198 | + held = re.search(r"previously selected package `(\S+) v", out.stderr) if out.returncode else None | |
| 199 | + if held: | |
| 200 | + run(["cargo", "update", "-p", held.group(1)], cwd=root, check=False) | |
| 201 | + out = run(precise, cwd=root, check=False) | |
| 197 | 202 | if out.returncode != 0: |
| 198 | 203 | e["failed"] = cargo_reason(out.stderr) |
| 199 | 204 |
Parents: 841d377