Skip to content

Commit

Permalink
backend: Add scoped-tls as a dev-dependency
Browse files Browse the repository at this point in the history
Since aa8607e moved scoped-tls to an optional dependency,
`cargo test -p wayland-backend` fails to build since neither the
client_system nor server_system features are enabled:

    error[E0432]: unresolved import `scoped_tls`
      --> wayland-backend/src/sys/client_impl/mod.rs:26:5
       |
    26 | use scoped_tls::scoped_thread_local;
       |     ^^^^^^^^^^ use of undeclared crate or module `scoped_tls`

    error[E0432]: unresolved import `scoped_tls`
      --> wayland-backend/src/sys/server_impl/mod.rs:20:5
       |
    20 | use scoped_tls::scoped_thread_local;
       |     ^^^^^^^^^^ use of undeclared crate or module `scoped_tls`

    error[E0425]: cannot find value `BACKEND` in this scope
       --> wayland-backend/src/sys/client_impl/mod.rs:378:19
        |
    378 |         let ret = BACKEND.set(&backend, || unsafe {
        |                   ^^^^^^^ help: a local variable with a similar name exists: `backend`

There is code gated with `#[cfg(any(test, feature = "..._system"))]`
which therefore requires scoped-tls during test.
  • Loading branch information
jamessan authored and ids1024 committed Feb 7, 2025
1 parent 48b04f1 commit f55d302
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wayland-backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ wayland-scanner = { path = "../wayland-scanner"}
wayland-sys = { path = "../wayland-sys", features = ["client", "server"] }
concat-idents = "1.1"
env_logger = "0.10"
scoped-tls = "1.0"

[features]
client_system = ["wayland-sys/client", "dep:scoped-tls"]
Expand Down

0 comments on commit f55d302

Please sign in to comment.