ms-jpq / sad

CLI search and replace | Space Age seD
MIT License
1.67k stars 22 forks source link

compile from source fails on aarch64 #319

Open daniejstriata opened 1 month ago

daniejstriata commented 1 month ago

I'm trying to build sad into a RPM package. I am not using the distros rust as some distros rust package is too old. That means I have to download and install rust/cargo. Here is the portion of the code:

# Install Rust using curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$PATH:$HOME/.cargo/bin"
$HOME/.cargo/bin/cargo build --release --all-features

The build on x86_64 succeeds but because the config.toml contains cross-compilation for aarch64 the build fails to compile on actual aarch64 with the error below:

  Compiling unicode-ident v1.0.12
   Compiling rustix v0.38.32
   Compiling autocfg v1.1.0
error: linker `aarch64-linux-gnu-gcc` not found
  |
  = note: No such file or directory (os error 2)

I see that there is a line in BUILD/sad-0.4.28/.cargo/config.toml that needs to be deleted if building on aarch64. The same issue is being referenced here for NixOS: https://github.com/NixOS/nixpkgs/issues/145726

I've built a RPM for a couple of distros in COPR here: https://copr.fedorainfracloud.org/coprs/faramirza/sad/ I'll check if they work and will revert back here.

daniejstriata commented 1 month ago

So far the COPR builds I've tested works fine. Will need to install some VM's for Magia and OpenMandriva to test them on.

daniejstriata commented 1 month ago

sad works as expected on Magia and OpenMandriva.