Skip to content

Conversation

@hinto-janai
Copy link
Contributor

Description

Search /lib64 in build.rs in addition to /lib.

Motivation and Context

Building on Fedora needs /lib64 specified instead of /lib, else a linking error like this occurs: https://github.com/Cuprate/cuprate/actions/runs/15330922254/job/43137221458#step:9:26.

How Has This Been Tested?

cargo build on Fedora 42 and Debian 12 before/after change.

@lnchan
Copy link

lnchan commented Sep 1, 2025

Hi, just to add extra context: the reason this happens is because of CMake's implementation of the GNU Coding Standard's Installation Directories, which is described in the GNUInstallDirs module.

Debian-based distributions (Debian, Ubuntu, Linux Mint and others) are the only cases where lib/ would be the target LIBDIR when natively compiling on a 64-bit system, meaning no other Linux distribution would be able to build randomx-rs properly.

Copy-pasting the CMake logic for the default LIBDIR definition:

  # Override this default 'lib' with 'lib64' iff:
  #  - we are on Linux system but NOT cross-compiling
  #  - we are NOT on debian
  #  - we are on a 64 bits system
  # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
  # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
  # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
  # and CMAKE_INSTALL_PREFIX is "/usr"

While this does fix things on Fedora for me as well (and this fix or a similar fix is required for Tari projects to build on my Fedora setup), I feel this will still break: if cross-compiling, the LIBDIR would not be lib64/ but triples like x86_84-linux-gnu, causing the same problem again.

Sadly, that seems to be an issue with cmake-rs itself, and seems to be only possible to solve if the default CMakeLists does not allow overriding the install(...)'s library destination, meaning adding this hardcoded search path is the "official solution".

Copy link
Contributor

@hansieodendaal hansieodendaal left a comment

Choose a reason for hiding this comment

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

I checked the Windows build locally, which did not give any problems, however, we have some clippy issues: cargo lints clippy --all-targets --all-features.

@SWvheerden SWvheerden merged commit 3e1b8b3 into tari-project:development Sep 3, 2025
1 check passed
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.

4 participants