Skip to content

Support for Fedora 64bit directory linking#29

Merged
flxo merged 2 commits intonanomsg:mainfrom
lukefrasera:main
Feb 11, 2026
Merged

Support for Fedora 64bit directory linking#29
flxo merged 2 commits intonanomsg:mainfrom
lukefrasera:main

Conversation

@lukefrasera
Copy link
Contributor

@lukefrasera lukefrasera commented Nov 21, 2025

When using Fedora CMake defaults to generating targets within <build>/lib64/libnng.a instead of <build>/lib/libnng.a. nng-sys/build.rs only looks for libraries within the lib folder and as such fails to build. This PR adds support for this alternative directory.

This is likely not the best implementation solution, but I'm hoping to shed light on the underlying issue.

Summary by CodeRabbit

  • Chores
    • Improved build configuration for enhanced library directory compatibility during vendored builds.

Copy link
Collaborator

@flxo flxo left a comment

Choose a reason for hiding this comment

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

Thank you! Can please leave a comment on the lines about the order?

nit: avoid the allocation lib if lib64 is present:

    let lib64 = dst.join("lib64");
    if lib64.exists() { lib64 } else { dst.join("lib") }

Copy link
Collaborator

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

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

Looks good to me subject to @flxo's comment!

@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

The build script for nng-sys now conditionally prioritizes a lib64 directory during vendored builds, falling back to lib if lib64 does not exist. This enables library path flexibility based on the available directory structure.

Changes

Cohort / File(s) Summary
Build Configuration
nng-sys/build.rs
Added conditional logic to prefer lib64 directory over lib when resolving library paths in vendored builds. Falls back to lib if lib64 is unavailable.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A rabbit hops through build paths with glee,
Preferring lib64, when it comes to be,
But lib stands ready, just in case,
A conditional hop—the right embrace! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: adding support for Fedora's 64-bit lib64 directory linking, which matches the core objective of resolving build failures on Fedora systems.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
nng-sys/build.rs (1)

438-443: The lib64 fallback logic correctly addresses the Fedora lib64 directory issue.

The current approach is pragmatic and works well. If you want a more CMake-idiomatic solution, you can override the library directory at configure time by adding .define("CMAKE_INSTALL_LIBDIR", "lib") to the cmake config. This assumes nng's CMakeLists.txt respects this standard CMake variable (which it should via GNUInstallDirs), and would let you simplify the code to always use dst.join("lib") without the runtime existence check.

Either approach is fine; the current code is solid and the alternative is a cleaner long-term solution.

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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 and usage tips.

@flxo flxo merged commit 3a16192 into nanomsg:main Feb 11, 2026
25 of 26 checks passed
flxo added a commit to flxo/nng-rs that referenced this pull request Feb 12, 2026
support for fedora systems where cmake defaults to the lib64 directory for 64bit architectures

---------

Co-authored-by: Felix Obenhuber <flxo@users.noreply.github.com>
flxo added a commit that referenced this pull request Feb 13, 2026
support for fedora systems where cmake defaults to the lib64 directory for 64bit architectures

---------

Co-authored-by: Luke Fraser <luke@fratkins.com>
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.

3 participants