silicon icon indicating copy to clipboard operation
silicon copied to clipboard

[Build Failed] `silicon` build failed on RISC-V board, looking for a solution.

Open TinySnow opened this issue 2 years ago • 0 comments

Hi, I'm from ArchRISC-V Team, a community porting Arch Linux software to RISC-V architecture.

Description

While porting silicon, we encountered a error, located on src/hb_wrapper.rs:17:17 and src/hb_wrapper.rs:91:17.

It seems a force convert error, but I'm not sure. Maybe it's related to riscv architecture instruction set?

Is there any advice about that? If so, I'll appreciate it.

More info comes Appendix.

Appendix

Platform: Arch Linux, 6.0.2-arch1-1 #1 SMP PREEMPT Tue, 25 Oct 2022 14:31:13 +0000 riscv64 GNU/Linux

Error Log

   Compiling env_logger v0.9.1
   Compiling syntect v5.0.0
   Compiling imageproc v0.23.0
   Compiling tempfile v3.3.0
   Compiling dirs v4.0.0
   Compiling clipboard v0.5.0
   Compiling structopt v0.3.26
   Compiling shell-words v1.1.0
   Compiling silicon v0.5.1 (/build/silicon/src/silicon-0.5.1)
error[E0308]: mismatched types
   --> src/hb_wrapper.rs:17:17
    |
16  |             hb_feature_from_string(
    |             ---------------------- arguments to this function are incorrect
17  |                 tag.as_ptr() as *const i8,
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`
note: function defined here
   --> /build/.cargo/registry/src/github.com-1ecc6299db9ec823/harfbuzz-sys-0.5.0/src/bindings.rs:422:12
    |
422 |     pub fn hb_feature_from_string(
    |            ^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> src/hb_wrapper.rs:91:17
     |
89   |             hb_buffer_add_utf8(
     |             ------------------ arguments to this function are incorrect
90   |                 self.buffer,
91   |                 s.as_ptr() as *const i8,
     |                 ^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
     |
     = note: expected raw pointer `*const u8`
                found raw pointer `*const i8`
note: function defined here
    --> /build/.cargo/registry/src/github.com-1ecc6299db9ec823/harfbuzz-sys-0.5.0/src/bindings.rs:2651:12
     |
2651 |     pub fn hb_buffer_add_utf8(
     |            ^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `silicon` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Build failed, check /var/lib/archbuild/extra-riscv64/tinysnow/build
Arch Linux PKGBUILD file
# Maintainer: Sven-Hendrik Haase <[email protected]>
# Contributor: Radoslaw Mejer <[email protected]>
pkgname=silicon
pkgver=0.5.1
pkgrel=1
pkgdesc="Create beautiful images of your code"
depends=('fontconfig' 'freetype2' 'xclip')
makedepends=('rust' 'cargo' 'glibc' 'llvm-libs' 'gcc-libs' 'clang' 'python')
arch=('x86_64' 'riscv64')
license=('MIT')
url="https://github.com/Aloxaf/silicon"
source=("$pkgname-$pkgver.tar.gz::https://github.com/Aloxaf/silicon/archive/v$pkgver.tar.gz")
options=('!lto')
sha256sums=('784a6f99001f2000422b676e637fe83a5dc27f5fc55ad33e227c882ce20e6439')

build() {
    cd "$srcdir/silicon-$pkgver"
    cargo build --release --locked
}

check() {
    cd "$srcdir/silicon-$pkgver"
    cargo check --locked
}

package() {
    cd "$srcdir/silicon-$pkgver"
    install -Dm755 "target/release/silicon" "$pkgdir/usr/bin/$pkgname"
    install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

TinySnow avatar Dec 11 '22 11:12 TinySnow