Skip to content

fix(copr): fix x86_64 builds with add nasm/cmake for Fedora and PREBUILT_NASM for RHEL/EPEL - #10947

Merged
jdx merged 3 commits into
jdx:mainfrom
bestagi:fix/copr-x86_64-nasm-aws-lc-sys
Jul 11, 2026
Merged

jdx merged 3 commits into
jdx:mainfrom
bestagi:fix/copr-x86_64-nasm-aws-lc-sys

Conversation

@bestagi

@bestagi bestagi commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Every x86_64 COPR chroot fails while aarch64 on the same targets succeeds:

Chroot Result
fedora-rawhide-x86_64 ❌ failed
fedora-44-x86_64 ❌ failed
fedora-43-x86_64 ❌ failed
epel-10-x86_64 ❌ failed
fedora-rawhide-aarch64 ✅ succeeded
fedora-44-aarch64 ✅ succeeded
fedora-43-aarch64 ✅ succeeded
epel-10-aarch64 ✅ succeeded

Root cause: aws-lc-sys requires NASM at build time to compile x86_64-optimized assembly crypto routines. nasm was not declared as a BuildRequires, so COPR's mock chroot does not install it and the aws-lc-sys build script panics with exit status 101. aarch64 is unaffected because aws-lc-sys has no NASM dependency on that architecture.

Failing build: https://copr.fedorainfracloud.org/coprs/jdxcode/mise/build/10703774/

Fix

Fedora (%{?fedora}): add BuildRequires: nasm and BuildRequires: cmake. Both are available in standard Fedora repos on all active releases (43, 44, rawhide).

RHEL/EPEL (%{?rhel}): export AWS_LC_SYS_NO_ASM=1 before cargo build. On EL9/EL10, nasm lives in CRB (CodeReady Builder) which is not enabled in COPR chroots by default. AWS_LC_SYS_NO_ASM=1 disables the ASM path, falling back to portable C — performance impact is negligible for mise's usage patterns (tool downloads, not throughput-sensitive crypto).

BuildRequires:  cmake
%if 0%{?fedora}
BuildRequires:  nasm
%endif
%if 0%{?rhel}
export AWS_LC_SYS_NO_ASM=1
%endif
cargo build --profile __BUILD_PROFILE__ --frozen --bin mise

Testing

This fix covers all 4 failing x86_64 chroots with a single conditional approach that requires no extra repo configuration in COPR.

Summary by CodeRabbit

  • Bug Fixes
    • Improved RPM build reliability across Fedora and RHEL by adjusting the generated spec’s build requirements.
    • Added an unconditional CMake build dependency to ensure consistent builds.
    • Enabled NASM support only for Fedora x86_64 builds, while RHEL x86_64 builds now use prebuilt NASM objects instead of requiring NASM in the COPR chroot.

All x86_64 COPR chroots fail (fedora-44, fedora-43, fedora-rawhide,
epel-10) while aarch64 succeeds. Root cause: aws-lc-sys requires NASM
at build time to compile x86_64-optimized assembly crypto routines.
nasm was not declared as a BuildRequires so COPR's mock chroot does
not install it, causing the aws-lc-sys build script to panic (exit 101).

aarch64 builds are unaffected as aws-lc-sys has no NASM dependency
on that architecture.

Fix:
- Fedora (%{?fedora}): add BuildRequires nasm and cmake. Both packages
  are available in standard Fedora repos on all active releases.
- RHEL/EPEL (%{?rhel}): export AWS_LC_SYS_NO_ASM=1 before cargo build.
  On EL9/EL10 nasm lives in CRB which is not enabled in COPR chroots
  by default. AWS_LC_SYS_NO_ASM=1 disables the ASM path and falls back
  to portable C with negligible performance impact for mise.

Fixes: https://copr.fedorainfracloud.org/coprs/jdxcode/mise/build/10703774/
@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The COPR RPM spec now includes CMake, conditionally requires NASM on Fedora x86_64, and enables prebuilt NASM objects for RHEL x86_64 builds.

Changes

COPR RPM build configuration

Layer / File(s) Summary
Distro-specific RPM build setup
packaging/copr/build-copr.sh
The generated spec adds CMake, limits NASM to Fedora x86_64, and exports AWS_LC_SYS_PREBUILT_NASM=1 for RHEL x86_64 builds.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a bunny with a build in flight,
CMake hops in, NASM stays light.
Fedora gets its tools in line,
RHEL prebuilt parts take flight.
COPR builds now spring just right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the COPR build fix for x86_64, including Fedora NASM/cmake dependencies and the RHEL/EPEL PREBUILT_NASM change.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes x86_64 COPR build failures for mise by adding missing build dependencies (cmake, nasm) to the RPM spec and working around the unavailability of NASM in RHEL/EPEL COPR chroots.

  • Fedora fix (correct): adds BuildRequires: cmake unconditionally and BuildRequires: nasm gated on %{?fedora} && x86_64. This directly addresses the root cause and the architecture guard is correctly scoped.
  • RHEL/EPEL fix (broken): exports AWS_LC_SYS_PREBUILT_NASM=1 on RHEL x86_64, but per the official aws-lc-rs docs and build script source, this variable is a Windows-only feature \u2014 the use_prebuilt_nasm() function gates on target_os() == \"windows\" and is a no-op on Linux. RHEL x86_64 builds will still fail.

Confidence Score: 4/5

The Fedora half of the fix is correct and safe to merge; the RHEL/EPEL half relies on a Windows-only environment variable that has no effect on Linux and will leave RHEL x86_64 builds broken.

The AWS_LC_SYS_PREBUILT_NASM=1 export for RHEL is documented as a Windows-only control in aws-lc-sys — it does nothing on Linux. The RHEL x86_64 chroots will still fail to find NASM during the aws-lc-sys build step.

packaging/copr/build-copr.sh — specifically the RHEL %build section that sets AWS_LC_SYS_PREBUILT_NASM

Important Files Changed

Filename Overview
packaging/copr/build-copr.sh Fixes Fedora x86_64 COPR builds correctly (nasm + cmake BuildRequires, arch-guarded), but the RHEL/EPEL fix uses AWS_LC_SYS_PREBUILT_NASM=1 which is a Windows-only env var in aws-lc-sys and has no effect on Linux builds — RHEL x86_64 will still fail

Reviews (3): Last reviewed commit: "fix(copr): replace AWS_LC_SYS_NO_ASM wit..." | Re-trigger Greptile

Comment thread packaging/copr/build-copr.sh Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packaging/copr/build-copr.sh`:
- Around line 227-233: The RHEL/EPEL workaround in the RPM build must not export
AWS_LC_SYS_NO_ASM for the default release profile, because aws-lc-sys rejects it
there. Update the surrounding build-profile logic near BUILD_PROFILE to use a
supported no-ASM configuration for release builds, or enable the required
NASM/CRB dependency instead, while preserving successful builds on RHEL/EPEL.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ac0d952-c62f-4ea4-8b03-48a963bceca4

📥 Commits

Reviewing files that changed from the base of the PR and between 588d2e7 and 2265302.

📒 Files selected for processing (1)
  • packaging/copr/build-copr.sh

Comment thread packaging/copr/build-copr.sh Resolved
bestagi and others added 2 commits July 12, 2026 00:56
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…r RHEL/EPEL

AWS_LC_SYS_NO_ASM=1 is rejected by aws-lc-sys when OPT_LEVEL != 0,
causing a panic in the build script at release profile. The correct
variable is AWS_LC_SYS_PREBUILT_NASM=1, which uses prebuilt NASM
objects already bundled inside the aws-lc-sys crate. This works at
all optimization levels including release.

Also scope the RHEL guard to x86_64 only, consistent with the Fedora
nasm BuildRequires guard added in the previous commit.
@bestagi bestagi changed the title fix(copr): fix x86_64 builds — add nasm/cmake for Fedora, NO_ASM for RHEL/EPEL fix(copr): fix x86_64 builds with add nasm/cmake for Fedora, NO_ASM for RHEL/EPEL Jul 11, 2026
@bestagi bestagi changed the title fix(copr): fix x86_64 builds with add nasm/cmake for Fedora, NO_ASM for RHEL/EPEL fix(copr): fix x86_64 builds with add nasm/cmake for Fedora, PREBUILT_NASM for RHEL/EPEL Jul 11, 2026
@bestagi bestagi changed the title fix(copr): fix x86_64 builds with add nasm/cmake for Fedora, PREBUILT_NASM for RHEL/EPEL fix(copr): fix x86_64 builds with add nasm/cmake for Fedora and PREBUILT_NASM for RHEL/EPEL Jul 11, 2026
@bestagi

bestagi commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

wait prebuilt_nasm only for windows, will fix it later.
or maybe turn on CRB in COPR project setting ? @jdx

@jdx
jdx merged commit 759723a into jdx:main Jul 11, 2026
33 checks passed
@bestagi

bestagi commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

oh wait, copr publish process are canceled and its still broke, i will check it again tomorrow @jdx

@bestagi
bestagi deleted the fix/copr-x86_64-nasm-aws-lc-sys branch July 14, 2026 23:29
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.

2 participants