googlefonts / googlefonts/fontations

Build failure in write-fonts caused by incompatible change in read-fonts 0.35.1

Open
#1,693 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
826
Forks
75
Avg merge
22h 33m
Merged PRs (30d)
75

Description

We got this error on our CI:

```
error[E0277]: the trait bound `u16: from_obj::FromObjRef>` is not satisfied
--> /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/write-fonts-0.43.0/src/tables/../../generated/generated_cpal.rs:126:62
|
126 | palette_labels_array: obj.palette_labels_array().to_owned_obj(offset_data),
| ^^^^^^^^^^^^ the trait `from_obj::FromObjRef>` is not implemented for `u16`
|
= help: the trait `from_obj::FromObjRef` is implemented for `u8`
note: required for `Vec` to implement `from_obj::FromObjRef<&[types::BigEndian]>`
--> /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/write-fonts-0.43.0/src/from_obj.rs:90:12
|
90 | impl FromObjRef<&[U]> for Vec
| ^^^^^^^^^^^^^^^^ ^^^^^^
91 | where
92 | T: FromObjRef,
| ------------- unsatisfied trait bound introduced here
= note: 1 redundant requirement hidden
= note: required for `offsets::NullableOffsetMarker, 4>` to implement `FromObjRef], ReadError>>>`
note: required for `Option], read_fonts::ReadError>>` to implement `from_obj::ToOwnedObj, 4>>`
--> /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/write-fonts-0.43.0/src/from_obj.rs:55:12
|
55 | impl ToOwnedObj for T
| ^^^^^^^^^^^^^ ^
56 | where
57 | U: FromObjRef,
| ------------- unsatisfied trait bound introduced here
= note: the full name for the type has been written to '/Users/runner/work/slint/slint/target/debug/deps/write_fonts-73860f28664ddb3d.long-type-2410230489728484686.txt'
= note: consider using `--verbose` to print the full type name to the console
```

Presumably, this is caused by this change in the recent read-fonts 0.35.1 that changes the signature of `palette_labels_array`
https://github.com/googlefonts/fontations/commit/707ebc840ac827e6f6f3cdaa3adf9b67db0a144e#diff-a69acb71aa0ad51fbd7755c2e95b280a00c1bc8c20507a684f72729e832daf1cR200

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with generated/generated_cpal.rs:126 and from_obj.rs:55-92, then compare the palette_labels_array signature change in read-fonts 0.35.1 and commit 707ebc840ac827e6f6f3cdaa3adf9b67db0a144e. Done means the write-fonts build succeeds against that release without the reported trait-bound error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.