pop-os / cosmic-text

Pure Rust multi-line text handling

Home Page:https://pop-os.github.io/cosmic-text/cosmic_text/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cosmic-text `0.11.0` is not `no_std` compatible

CryZe opened this issue · comments

error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7em-none-eabi` target may not support the standard library
  = note: `std` is required by `unicode_properties` because it does not declare `#![no_std]`

   Compiling unicode-script v0.5.5
error: cannot find attribute `derive` in this scope
Error:   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/unicode-properties-0.1.0/src/tables.rs:44:7
   |
44 |     #[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd, Debug)]
   |       ^^^^^^
   |
help: consider importing this attribute macro
   |
44 +     use core::prelude::rust_2024::derive;
   |

It seems like the unicode-properties doesn't support no_std. It probably makes sense for cosmic-text to add some CI target that tests against no_std.

It seems like there's already a fix on their side, but it's not released yet: unicode-rs/unicode-properties#3

I see what is going on, if a dependency breaks no_std then the only way to detect that is to build for a target that doesn't have a std. I will adjust the CI to catch this, and can release a 0.10.1 when unicode-properties has a new release.

They released a semver compatible version, so cosmic-text doesn't itself need a version bump.

The problem came back with 0.11. It probably would make sense to add an actual no_std target to CI (you can't test no_std on targets that have std cause it will just silently use it).

error[E0463]: can't find crate for `std`
Error:   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ttf-parser-0.20.0/src/lib.rs:50:1
   |
50 | extern crate std;
   | ^^^^^^^^^^^^^^^^^ can't find crate
   |
   = note: the `thumbv8m.main-none-eabihf` target may not support the standard library