Skip to content

cp: integer conversion panic on ppc64le #8161

@kaathewisegit

Description

@kaathewisegit

I'm packaging Nushell 0.105 for Alpine right now, and ppc64le is one of the supported architectures. Nushell's cp, which uses uu_cp underneath, failed the tests because of a panic:

---- commands::ucp::copies_files_with_glob_metachars::case_1 stdout ----
=== stderr
Error:   × Main thread panicked.
  ├─▶ at /home/buildozer/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/
  │   uu_cp-0.1.0/src/platform/linux.rs:69:54
  ╰─▶ called `Result::unwrap()` on an `Err` value: TryFromIntError(())
  help: set the `RUST_BACKTRACE=1` environment variable to display a
        backtrace.
thread 'commands::ucp::copies_files_with_glob_metachars::case_1' panicked at crates/nu-command/tests/commands/ucp.rs:1014:9:
assertion failed: actual.err.is_empty()

Full log: https://gitlab.alpinelinux.org/kaathewise/aports/-/jobs/1891916

This is the code which fails:

// Using .try_into().unwrap() is required as glibc, musl & android all have different type for ioctl()
#[allow(clippy::unnecessary_fallible_conversions)]
let result = unsafe {
libc::ioctl(
dst_fd,
linux_raw_sys::ioctl::FICLONE.try_into().unwrap(),
src_fd,
)
};

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions