fix(autopatch): Updated the find and replace strings in the rustc_target_cpus replace action to match the new upstream S390X CPU c #1

Merged
eabdullin merged 1 commit from agent-fix/a10s-20260915-042622 into a10s 2026-09-15 09:45:27 +00:00
Owner

Automated fix by autopatch agent.

Summary: Updated the find and replace strings in the rustc_target_cpus replace action to match the new upstream S390X CPU condition that adds z15 support for RHEL 11+/Fedora 45+.

Root cause

The upstream rust.spec extended the RUSTC_TARGET_CPU_S390X logic inside the %global rustc_target_cpus Lua block:

  • Old (2-line condition): ((rhel >= 9) and "z14" or (rhel == 8 or fedora >= 38) and "z13" or ...)
  • New (3-line condition): ((rhel >= 11 or fedora >= 45) and "z15" or (rhel >= 9) and "z14" or (rhel == 8 or fedora >= 38) and "z13" or ...)

This added z15 as the highest-tier S390X micro-architecture target for RHEL 11+ and Fedora 45+. The ReplaceAction's find string no longer matched because it contained the old 2-line S390X condition.

Fix applied:

  1. Updated the find string to include the new 3-line S390X condition with the z15 clause.
  2. Updated the first block in the replace string to likewise include the new z15 clause, so the original content is faithfully reproduced before the %ifarch x86_64_v2 override block is appended.
  3. The %ifarch x86_64_v2 override block's S390X condition was left unchanged — it overrides RUSTC_TARGET_CPU_X86_64 only; S390X is not built on x86_64_v2, so no change is needed there.

Original error

Type: ActionNotAppliedError

Traceback (most recent call last):
  File "/root/autopatch-tool/src/webserv.py", line 95, in debrand_packages
    result = apply_modifications(
  File "/root/autopatch-tool/src/debranding.py", line 138, in apply_modifications
    config.apply_actions(rpms_working_dir + f"/{package}")
  File "/root/autopatch-tool/src/actions_handler.py", line 938, in apply_actions
    action.execute(Path(package_path))
  File "/root/autopatch-tool/src/actions_handler.py", line 475, in execute
    process_lines(
  File "/root/autopatch-tool/src/actions_handler.py", line 236, in process_lines
    raise ActionNotAppliedError(
actions_handler.ActionNotAppliedError: Action 'ReplaceAction' was not applied successfully: No changes made for '['%global rustc_target_cpus %{lua: do', '  local fedora = tonumber(rpm.expand("0%{?fedora}"))', '  local rhel = tonumber(rpm.expand("0%{?rhel}"))', '  local env =', '    " RUSTC_TARGET_CPU_X86_64=x86-64" .. ((rhel >= 10) and "-v3" or (rhel == 9) and "-v2" or "")', '    .. " RUSTC_TARGET_CPU_PPC64LE=" .. ((rhel >= 9) and "pwr9" or "pwr8")', '    .. " RUSTC_TARGET_CPU_S390X=" ..', '        ((rhel >= 9) and "z14" or (rhel == 8 or fedora >= 38) and "z13" or', '         (fedora >= 26) and "zEC12" or (rhel == 7) and "z196" or "z10")', '  print(env)', 'end}']' in /root/autopatch-tool/src/autopatch-rust-y_yu4rnt/rpms-namespace/rust/rust.spec

Package: rust | Webhook branch: c10s

Automated fix by autopatch agent. **Summary:** Updated the `find` and `replace` strings in the `rustc_target_cpus` replace action to match the new upstream S390X CPU condition that adds z15 support for RHEL 11+/Fedora 45+. ### Root cause The upstream `rust.spec` extended the `RUSTC_TARGET_CPU_S390X` logic inside the `%global rustc_target_cpus` Lua block: - **Old** (2-line condition): `((rhel >= 9) and "z14" or (rhel == 8 or fedora >= 38) and "z13" or ...)` - **New** (3-line condition): `((rhel >= 11 or fedora >= 45) and "z15" or (rhel >= 9) and "z14" or (rhel == 8 or fedora >= 38) and "z13" or ...)` This added `z15` as the highest-tier S390X micro-architecture target for RHEL 11+ and Fedora 45+. The `ReplaceAction`'s `find` string no longer matched because it contained the old 2-line S390X condition. Fix applied: 1. Updated the `find` string to include the new 3-line S390X condition with the `z15` clause. 2. Updated the first block in the `replace` string to likewise include the new `z15` clause, so the original content is faithfully reproduced before the `%ifarch x86_64_v2` override block is appended. 3. The `%ifarch x86_64_v2` override block's S390X condition was left unchanged — it overrides `RUSTC_TARGET_CPU_X86_64` only; S390X is not built on x86_64_v2, so no change is needed there. ### Original error **Type:** `ActionNotAppliedError` ``` Traceback (most recent call last): File "/root/autopatch-tool/src/webserv.py", line 95, in debrand_packages result = apply_modifications( File "/root/autopatch-tool/src/debranding.py", line 138, in apply_modifications config.apply_actions(rpms_working_dir + f"/{package}") File "/root/autopatch-tool/src/actions_handler.py", line 938, in apply_actions action.execute(Path(package_path)) File "/root/autopatch-tool/src/actions_handler.py", line 475, in execute process_lines( File "/root/autopatch-tool/src/actions_handler.py", line 236, in process_lines raise ActionNotAppliedError( actions_handler.ActionNotAppliedError: Action 'ReplaceAction' was not applied successfully: No changes made for '['%global rustc_target_cpus %{lua: do', ' local fedora = tonumber(rpm.expand("0%{?fedora}"))', ' local rhel = tonumber(rpm.expand("0%{?rhel}"))', ' local env =', ' " RUSTC_TARGET_CPU_X86_64=x86-64" .. ((rhel >= 10) and "-v3" or (rhel == 9) and "-v2" or "")', ' .. " RUSTC_TARGET_CPU_PPC64LE=" .. ((rhel >= 9) and "pwr9" or "pwr8")', ' .. " RUSTC_TARGET_CPU_S390X=" ..', ' ((rhel >= 9) and "z14" or (rhel == 8 or fedora >= 38) and "z13" or', ' (fedora >= 26) and "zEC12" or (rhel == 7) and "z196" or "z10")', ' print(env)', 'end}']' in /root/autopatch-tool/src/autopatch-rust-y_yu4rnt/rpms-namespace/rust/rust.spec ``` --- Package: `rust` | Webhook branch: `c10s`
Updated the `find` and `replace` strings in the `rustc_target_cpus` replace action to match the new upstream S390X CPU condition that adds z15 support for RHEL 11+/Fedora 45+.
eabdullin deleted branch agent-fix/a10s-20260915-042622 2026-09-15 09:45:27 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
autopatch/rust!1
No description provided.