ash icon indicating copy to clipboard operation
ash copied to clipboard

Add Fuchsia support

Open abarth opened this issue 3 years ago • 5 comments

Use the proper name for libvulkan.so on Fuchsia.

abarth avatar May 26 '22 20:05 abarth

https://doc.rust-lang.org/reference/conditional-compilation.html#target_os I'm surprised the official docs don't mention the existence of fuchsia :/. It's "only an example", but still.

MarijnS95 avatar May 26 '22 20:05 MarijnS95

Fuchsia is a Tier 2 supported OS for Rust:

https://doc.rust-lang.org/rustc/platform-support.html#tier-2

For context, I'm a Fuchsia OS developer. We'd like to switch over from vk_sys to ash in our Vulkan stack for Rust, but we ran into this minor issue.

abarth avatar May 27 '22 00:05 abarth

Note that if you build ash with features = ["linked"], default-features = false, existing versions of ash should Just Work, and be less fragile at runtime besides.

Ralith avatar May 27 '22 00:05 Ralith

Fuchsia doesn't do the unixy .so.$MAJOR thing?

Yes, we do that for most shared libraries. I'm not sure why libvulkan.so doesn't have a .$MAJOR suffix.

Interesting; is this documented anywhere?

https://fuchsia.dev/fuchsia-src/development/graphics/magma/concepts/vulkan?hl=en#buildtime_dependencies

Any way we can sensibly cover this in CI?

Not yet. We're working on that as part of our quest for Tier 1 support in Rust.

Note that if you build ash with features = ["linked"], default-features = false, existing versions of ash should Just Work, and be less fragile at runtime besides.

Ok, I'll give that a try.

abarth avatar May 27 '22 01:05 abarth

Yes, we do that for most shared libraries. I'm not sure why libvulkan.so doesn't have a .$MAJOR suffix.

Hmm, are you using the standard Khronos Vulkan loader? This may be a bug in the upstream build system, if so. I'm not entirely clear on the significance of respecting that pattern vs. not, but I figure it's probably worth being consistent with the system at large.

Ralith avatar May 27 '22 01:05 Ralith

@abarth any update on not using/having a .MAJOR suffix on Fuchsia?

MarijnS95 avatar Mar 24 '24 18:03 MarijnS95

Looking at the linked Fuchsia docs it's still libvulkan.so without .MAJOR suffix; I'll merge this in for the 0.38 release.

MarijnS95 avatar Apr 01 '24 09:04 MarijnS95

For cargo:rustc-link-lib=vulkan under the linked feature, this should keep working OOTB :)

MarijnS95 avatar Apr 01 '24 09:04 MarijnS95