redox-os / orbtk

The Rust UI-Toolkit.
MIT License
3.77k stars 190 forks source link

Failed to build simple demo project #466

Closed hbina closed 2 years ago

hbina commented 2 years ago

Attempting to compile a simple project fails.

hbina@akarin ~/g/orbtk-demo (master)> cargo b
   Compiling cfg-if v1.0.0
   Compiling autocfg v1.0.1
  <compiling stuff>
   Compiling tiff v0.6.1
   Compiling wayland-cursor v0.25.0
   Compiling image v0.23.14
   Compiling xkbcommon-sys v0.7.5
   Compiling xkb v0.2.1
error[E0599]: no variant or associated item named `XKB_KEYMAP_FORMAT_TEXT_v1` found for enum `xkb_keymap_format` in the current scope
    --> /home/hbina/.cargo/registry/src/github.com-1ecc6299db9ec823/minifb-0.17.0/src/os/posix/wayland.rs:1056:59
     |
1056 |                         xkbcommon_sys::xkb_keymap_format::XKB_KEYMAP_FORMAT_TEXT_v1,
     |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^
     |                                                           |
     |                                                           variant or associated item not found in `xkb_keymap_format`
     |                                                           help: there is a variant with a similar name (notice the capitalization): `XKB_KEYMAP_FORMAT_TEXT_V1`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `minifb` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed

To Reproduce Steps to reproduce the behavior:

  1. cargo new orbtk-demo.
  2. cd orbtk-demo.
  3. cargo add orbtk.
  4. cargo b.
  5. ??
  6. No profit.

Expected behavior It should compile just fine.

Desktop (please complete the following information):

Additional context

I tried to debug this but I have no idea how the project is structured. Grepping for minifb in this repo yields..nothing??

hbina@akarin ~/g/orbtk-demo (master)> cargo tree | rg 'minifb' --context 10
    │   │       ├── approx v0.3.2
    │   │       │   └── num-traits v0.2.14 (*)
    │   │       ├── ordered-float v1.1.1
    │   │       │   └── num-traits v0.2.14 (*)
    │   │       └── stb_truetype v0.3.1
    │   │           └── byteorder v1.4.3
    │   ├── orbtk-shell v0.3.1-alpha3
    │   │   ├── derive_more v0.99.16 (proc-macro) (*)
    │   │   ├── image v0.23.14 (*)
    │   │   ├── lazy_static v1.4.0
    │   │   ├── minifb v0.17.0
    │   │   │   ├── cast v0.2.7
    │   │   │   │   [build-dependencies]
    │   │   │   │   └── rustc_version v0.4.0
    │   │   │   │       └── semver v1.0.4
    │   │   │   ├── raw-window-handle v0.3.3
    │   │   │   │   └── libc v0.2.107
    │   │   │   ├── tempfile v3.2.0
    │   │   │   │   ├── cfg-if v1.0.0
    │   │   │   │   ├── libc v0.2.107
    │   │   │   │   ├── rand v0.8.4

I am guessing bumping the version is enough? The strange thing is that the example showcase works. However, if I try to use this repo as the crate instead with path = ...; it still fails!

rzerres commented 2 years ago

Since you haven't shown any source code, i have to estimate. Minifb has been dropped and isn't supported anymore. Please have a look inside the example subdirectory to get a first starting point for your target.

nyovaya commented 2 years ago

@rzerres I have the same issue, I can basically create an empty cargo project and add "orbtk = "0.3.1-alpha3" to it and I will get exactly this error. Funny thing is when I clone the project, checkout to the exact same version and compile the examples it works flawlessly.

nyovaya commented 2 years ago

Seems like removing Cargo.lock and rebuilding is enough to actually compile but it still uses minifb, but grepping through any of the orbtk repositories I cant minifb anywhere as dependency…

rzerres commented 2 years ago

Seems like removing Cargo.lock and rebuilding is enough to actually compile but it still uses minifb, but grepping through any of the orbtk repositories I cant minifb anywhere as dependency…

For now, in your projects Cargo.toml, please reference

[dependencies]
...
orbtk = { git = "https://github.com/redox-os/orbtk.git", branch = "develop" }
...

0.3.1-alpha3 has issues that have been resolved in upcoming 0.3.1-alpha4. Updates are checked in the develop branch. And there is no timeline for a new stable release.

rzerres commented 2 years ago

@nifker is this still open? Did you try using 0.3.1-alpha4/development branch?