Skip to content

aarch64 Linux build + runtime: XLookupString mismatch, max_color_attachments limit, lib name #55

Description

@ElYaiko

Three blockers to build and run on this platform:

1. XLookupString type mismatch (build error)

error[E0308]: mismatched types
  --> src/lib.rs:397:29
   |
397 |   buf.as_mut_ptr() as *mut i8,
   |                     ^^^^^^^^^^ expected `*mut u8`, found `*mut i8`

native/linux/src/lib.rs:397 casts buf.as_mut_ptr() (which is *mut u8) to *mut i8, but on aarch64 Linux c_char = u8 (ARM C ABI defines char as unsigned). Rust 1.95+ on Fedora 42 correctly sets c_char per-target. The x11 crate's XLookupString takes *mut c_char = *mut u8 here, so the cast is wrong.

Fix: remove the as *mut i8 cast — just use buf.as_mut_ptr().

2. max_color_attachments: requested 8, allowed: 5 (runtime crash)

thread panicked at src/lib.rs:582 — Failed to create device: 
RequestDeviceError { inner: Core(LimitsExceeded(FailedLimit { 
  name: "max_color_attachments", requested: 8, allowed: 5 
}))}

This platform caps at 5 color attachments. wgpu::Limits::default() returns downlevel_defaults() which hardcodes max_color_attachments: 8. The engine uses Limits::default() at native/linux/src/lib.rs:565 as the base for required_limits instead of adapter.limits().

Fix: replace wgpu::Limits::default() with adapter.limits() — capping limits to what the adapter actually supports.

3. Cargo.toml lib name mismatch

native/linux/Cargo.toml names the lib bloom_linux, but perry's package.json expects libbloom_linux_bundled.a, so perry fails with:

Error: Native library libbloom_linux_bundled.a not found after building bloom/core crate

Fix: rename lib in Cargo.toml:3name = "bloom_linux_bundled".


Environments tested:

  • OS: Fedora Asahi Remix 42 (aarch64)
  • GPU: Apple M1 (G13G B1) via Asahi Linux Vulkan driver
  • Rust: 1.95.0 (Fedora 1.95.0-1.fc42)
  • @bloomengine/engine: 0.4.3
  • @perryts/perry: 0.5.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions