Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed building heim-host on s390x #371

Open
jabir366 opened this issue May 13, 2024 · 2 comments
Open

Failed building heim-host on s390x #371

jabir366 opened this issue May 13, 2024 · 2 comments

Comments

@jabir366
Copy link

jabir366 commented May 13, 2024

Description

While compiling heim-host on s390x platform . getting error

  heim-host # cargo build
    Updating crates.io index
   Compiling heim-common v0.1.0-rc.1 (/root/jab/heim/heim-common)
   Compiling heim-host v0.1.0-rc.1 (/root/jab/heim/heim-host)
error[E0308]: mismatched types
  --> heim-host/src/sys/linux/users/other.rs:80:25
   |
80 |             session_id: entry.ut_session,
   |                         ^^^^^^^^^^^^^^^^ expected `i32`, found `i64`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `heim-host` (lib) due to 1 previous error

Enviroment Details

cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="9.3 (Plow)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="9.3"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Red Hat Enterprise Linux 9.3 (Plow)"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_BUGZILLA_PRODUCT_VERSION=9.3
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.3"

Architecture : s390x

@jabir366
Copy link
Author

@svartalf I would be happy to contribute to fixing this issue

@jabir366
Copy link
Author

With the bellow fix It compiled successfully

diff --git a/heim-host/src/os/linux.rs b/heim-host/src/os/linux.rs
index 01fb44c..61908a8 100644
--- a/heim-host/src/os/linux.rs
+++ b/heim-host/src/os/linux.rs
@@ -5,8 +5,8 @@ use std::net::IpAddr;
 use crate::Pid;

 cfg_if::cfg_if! {
-    // aarch64-unknown-linux-gnu has different type
-    if #[cfg(all(target_arch = "aarch64", not(target_family = "musl")))] {
+    // aarch64-unknown-linux-gnu and s390x has different type
+    if #[cfg(any(target_arch = "s390x",all(target_arch = "aarch64", not(target_family = "musl"))))] {
         /// User session ID.
         pub type SessionId = i64;
     } else {

@svartalf Kindly have a review and I will raise PR for the same

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

No branches or pull requests

1 participant