cat-in-136 / cargo-generate-rpm

Cargo helper command to generate a binary RPM package
MIT License
87 stars 19 forks source link

Issue with generate RPM not matching the PowerPC64 LE architecture #95

Closed runlevel5 closed 1 year ago

runlevel5 commented 1 year ago

Impacted version

0.12.1

System

Steps to reproduce

# I am trying to build amdgpu_top package
$ git clone https://github.com/Umio-Yasuno/amdgpu_top
$ cd amdgpu_top
$ cargo install --locked --path . --no-default-features --features="tui"
$ cargo build --release --target powerpc64le-unknown-linux-gnu # target ppc64le architecture
$ file ./target/release/amdgpu_top 
./target/release/amdgpu_top: ELF 64-bit LSB pie executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (SYSV), dynamically linked, interpreter /lib64/ld64.so.2, BuildID[sha1]=a6b0d839eb4db3d50d33cb9eb25f58723f00d224, for GNU/Linux 3.10.0, stripped
# Looks good ^ the binary is great and working
# let's try to package it
# firstly all config can be found in https://github.com/Umio-Yasuno/amdgpu_top/blob/main/Cargo.toml#L51
$ cargo generate-rpm --target powerpc64le-unknown-linux-gnu -a ppc64le
# let's try to install it
$ sudo rpm -i target/powerpc64le-unknown-linux-gnu/generate-rpm/amdgpu_top-0.2.0-1.powerpc64le.rpm 
# got error
#   package amdgpu_top-0:0.2.0-1.powerpc64le is intended for a different architecture
# let's double check the RPM one more time
$ sudo rpm -qip target/powerpc64le-unknown-linux-gnu/generate-rpm/amdgpu_top-0.2.0-1.powerpc64le.rpm 
Name        : amdgpu_top
Epoch       : 0
Version     : 0.2.0
Release     : 1
Architecture: powerpc64le
Install Date: (not installed)
Group       : Unspecified
Size        : 13658190
License     : MIT
Signature   : (none)
Source RPM  : (none)
Build Date  : Sat 02 Sep 2023 17:31:33
Build Host  : (none)
URL         : https://github.com/Umio-Yasuno/amdgpu_top
Summary     : Tool to displays AMDGPU usage.
The tool displays information gathered from performance counters (GRBM, GRBM2), sensors, fdinfo, gpu_metrics and AMDGPU driver.

Description :
Tool to displays AMDGPU usage.
The tool displays information gathered from performance counters (GRBM, GRBM2), sensors, fdinfo, gpu_metrics and AMDGPU driver.

Unsure if it is the fault of cargo-generate-rpm or rpm itself?

cat-in-136 commented 1 year ago

@runlevel5 This is the first time I have heard of the PowerPC 64 LE architecture. I have no PowerPC machine regardless of endian/bits.

https://github.com/cat-in-136/cargo-generate-rpm/blob/52bbfe79713eeec5d6956701ce931866ad09c0c1/src/build_target.rs#L57 It seems to me that we can add a conversion for PowerPC 64 LE to the match expression here. I don't know the proper value, but from your text I'm guessing "powerpc64le" => "ppc64le"?

runlevel5 commented 1 year ago

Yes powerpc64le is ppc64le

PowerPC is used to be more popular in the old days when Apple was producing consumer desktop/laptop. After moving away from PowerPC, the CPU lives on in the enterprise section. Recently IBM and other parties have tried to promote this architecture with the OpenPOWER initiative. The Raptor Computing System Blackbird is probably one of the most affordable OpenPOWER-based workstation since 2019. The price is out of reach for many people but eventually it would get cheaper as more people start embracing it

cat-in-136 commented 1 year ago

Thanks for the PR and the detailed explanation of powerpc64le!