Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SKIA_USE_SYSTEM_LIBRARIES on Linux #852

Merged
merged 2 commits into from
Oct 14, 2023

Conversation

hack3ric
Copy link
Contributor

SKIA_USE_SYSTEM_LIBRARIES doesn't work as expected in two ways:

  • When building with system libraries, dependencies like wuffs still needs to be pulled:

    ninja: error: '../../../../../../../../../.cargo/git/checkouts/rust-skia-archrv-ea99b69400d8833f/7ad5220/skia-bindings/skia/third_party/externals/wuffs/release/c/wuffs-v0.3.c', needed by 'obj/third_party/externals/wuffs/release/c/libwuffs.wuffs-v0.3.o', missing and no known rule to make it
    
  • If SKIA_USE_SYSTEM_LIBRARIES=true and FORCE_SKIA_BUILD=true, binary_cache::resolve_dependencies will not be called, leaving the intended Skia source directory empty when calling gn gen:

    thread 'main' panicked at /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/build_support/skia/config.rs:315:10:
      gn error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
  • System dependencies isn't actually linked, causing errors like:

    /usr/bin/ld: /usr/lib/libpng16.so.16: error adding symbols: DSO missing from command line
    

    Adding all possible dependencies to link_libraries would fix, and should not link to unused libraries (-Wl,--as-needed is on by default)

When building with system libraries, dependencies like wuffs still needs
to be pulled:

```
ninja: error: '../../../../../../../../../.cargo/git/checkouts/rust-skia-archrv-ea99b69400d8833f/7ad5220/skia-bindings/skia/third_party/externals/wuffs/release/c/wuffs-v0.3.c', needed by 'obj/third_party/externals/wuffs/release/c/libwuffs.wuffs-v0.3.o', missing and no known rule to make it
```

Additionally, if `SKIA_USE_SYSTEM_LIBRARIES=true` and
`FORCE_SKIA_BUILD=true`, `binary_cache::resolve_dependencies` will not
be called, leaving the intended Skia source directory empty:

```
thread 'main' panicked at /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/build_support/skia/config.rs:315:10:
  gn error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
hack3ric added a commit to hack3ric/archriscv-packages that referenced this pull request Oct 14, 2023
De-vendor Skia dependencies by making `SKIA_USE_SYSTEM_LIBRARIES`
actually working; to be upstreamed to Arch.

Related upstream PRs (for now):
- rust-skia/rust-skia#851
- rust-skia/rust-skia#852
- rust-skia/rust-skia#854
- google/skia#146
@pragmatrix
Copy link
Member

All the changes look reasonable. Thank you for clarifying the behavior of SKIA_USE_SYSTEM_LIBRARIES. Merging now.

@pragmatrix pragmatrix merged commit d20f661 into rust-skia:master Oct 14, 2023
12 checks passed
@hack3ric hack3ric deleted the fix-use-system-deps branch October 14, 2023 09:37
felixonmars pushed a commit to felixonmars/archriscv-packages that referenced this pull request Oct 14, 2023
De-vendor Skia dependencies by making `SKIA_USE_SYSTEM_LIBRARIES`
actually working; to be upstreamed to Arch.

Related upstream PRs (for now):
- rust-skia/rust-skia#851
- rust-skia/rust-skia#852
- rust-skia/rust-skia#854
- google/skia#146
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants