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

examples cannot begin to compile due to --features not working in workspaces #1319

Closed
drmason13 opened this issue Dec 1, 2019 · 3 comments
Closed

Comments

@drmason13
Copy link

As per the docs: https://docs.rs/conrod/0.61.1/conrod/guide/chapter_2/index.html

If you ran into any issues with these steps, please let us know by filing an issue at the Conrod issue tracker. Be sure to search for your issue first, as another user may have already encountered your problem.

I (running on Ubuntu 19.04 with rustc version rustc 1.40.0-nightly (9e346646e 2019-11-08)) ran through steps 1, 2 and 3 but step 4 failed:

$ git clone https://github.com/PistonDevelopers/conrod.git
$ cd conrod/
$ cargo build

Some warnings but it finished successfully:


warning: trait objects without an explicit dyn are deprecated
--> conrod_core/src/graph/mod.rs:71:33
|
71 | pub maybe_state: Option<Box<Any + Send>>,
| ^^^^^^^^^^ help: use dyn: dyn Any + Send
|
= note: #[warn(bare_trait_objects)] on by default

warning: trait objects without an explicit dyn are deprecated
--> conrod_core/src/theme.rs:63:20
|
63 | pub style: Box<Any + Send>,
| ^^^^^^^^^^ help: use dyn: dyn Any + Send

warning: trait objects without an explicit dyn are deprecated
--> conrod_core/src/theme.rs:79:27
|
79 | pub fn new(style: Box<Any + Send>) -> WidgetDefault {
| ^^^^^^^^^^ help: use dyn: dyn Any + Send

warning: use of deprecated item 'std::mem::uninitialized': use mem::MaybeUninit instead
--> backends/conrod_glium/./src/lib.rs:112:5
|
112 | implement_vertex!(Vertex, position, tex_coords, color, mode);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(deprecated)] on by default
= note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

warning: use of deprecated item 'std::mem::uninitialized': use mem::MaybeUninit instead
--> backends/conrod_glium/./src/lib.rs:112:5
|
112 | implement_vertex!(Vertex, position, tex_coords, color, mode);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

warning: trait objects without an explicit dyn are deprecated
--> backends/conrod_vulkano/src/lib.rs:172:19
|
172 | pipeline: Arc<GraphicsPipelineAbstract + Send + Sync>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use dyn: dyn GraphicsPipelineAbstract + Send + Sync
|
= note: #[warn(bare_trait_objects)] on by default

warning: trait objects without an explicit dyn are deprecated
--> backends/conrod_vulkano/src/lib.rs:180:48
|
180 | tex_descs: FixedSizeDescriptorSetsPool<Arc<GraphicsPipelineAbstract + Send + Sync>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use dyn: dyn GraphicsPipelineAbstract + Send + Sync

warning: trait objects without an explicit dyn are deprecated
--> backends/conrod_vulkano/src/lib.rs:197:32
|
197 | pub graphics_pipeline: Arc<GraphicsPipelineAbstract + Send + Sync>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use dyn: dyn GraphicsPipelineAbstract + Send + Sync

warning: trait objects without an explicit dyn are deprecated
--> backends/conrod_vulkano/src/lib.rs:199:29
|
199 | pub descriptor_set: Arc<DescriptorSet + Send + Sync>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use dyn: dyn DescriptorSet + Send + Sync

warning: trait objects without an explicit dyn are deprecated
--> backends/conrod_vulkano/src/lib.rs:921:32
|
921 | fn cause(&self) -> Option<&StdError> {
| ^^^^^^^^ help: use dyn: dyn StdError

warning: trait objects without an explicit dyn are deprecated
--> backends/conrod_vulkano/src/lib.rs:940:32
|
940 | fn cause(&self) -> Option<&StdError> {
| ^^^^^^^^ help: use dyn: dyn StdError

$ cargo run --release --features "winit glium" --example all_winit_glium
error: --features is not allowed in the root of a virtual workspace

This seems to be the cause: rust-lang/cargo#4753
I'm sure the examples can run but as a new user I am unsure about the structure of the workspace, the features flag or cargo workspaces so I need to ask for help.

None of the examples work as stated, simply because of the --features and yet the features are needed to run the examples, so they can't simply be omitted :(

Reading through rust-lang/cargo#4753 it seems like there is no known workaround (rust-lang/cargo#4753 (comment)), so I'm curious how conrod developers workaround this?

@alberdingk-thijm
Copy link
Contributor

The documentation's gotten a bit disorganized since the project was broken up into subcrates. You're looking at the old documentation for conrod; the more up to date docs explain how to compile the examples here: https://docs.rs/conrod_core/0.67.0/conrod_core/guide/chapter_2/index.html

The tl;dr is:

$ cd backends/conrod_glium
$ cargo run --release --example all_winit_glium

@drmason13
Copy link
Author

Thank you. The README points to the old docs, but you're right that it's a bit tricky to fix at the moment. I had a further issue running the examples still, it might be that's something missing on my system though?

error: linking with `cc` failed: exit code: 1
  |
...
  = note: /usr/bin/ld: cannot find -lxcb-render
          /usr/bin/ld: cannot find -lxcb-shape
          /usr/bin/ld: cannot find -lxcb-xfixes
          collect2: error: ld returned 1 exit status

Is there a list of *-dev packages that need installing on linux (Debian based)? It seems like a lot of non-rust packages are required for "graphics stuff", including conrod.

Is it libxcb? I might need to install some of these packages:

$ apt list libxcb*-dev
Listing... Done
libxcb-composite0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-cursor-dev/bionic 0.1.1-4ubuntu1 amd64
libxcb-damage0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-dpms0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-dri2-0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-dri3-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-ewmh-dev/bionic 0.4.1-1ubuntu1 amd64
libxcb-glx0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-icccm4-dev/bionic 0.4.1-1ubuntu1 amd64
libxcb-image0-dev/bionic 0.4.0-1build1 amd64
libxcb-keysyms1-dev/bionic 0.4.0-1 amd64
libxcb-present-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-randr0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-record0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-render-util0-dev/bionic 0.3.9-1 amd64
libxcb-render0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-res0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-screensaver0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-shape0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-shm0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-sync-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-util-dev/bionic 0.4.0-0ubuntu3 amd64
libxcb-util0-dev/bionic 0.4.0-0ubuntu3 amd64
libxcb-xf86dri0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-xfixes0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-xinerama0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-xinput-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-xkb-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-xrm-dev/bionic 1.0-3 amd64
libxcb-xtest0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-xv0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb-xvmc0-dev/bionic-updates 1.13-2~ubuntu18.04 amd64
libxcb1-dev/bionic-updates,now 1.13-2~ubuntu18.04 amd64 [installed,automatic]

Happy to open a new issue since this is a bit of a tangent!

@drmason13
Copy link
Author

Ah, found someone with a similar issue to me. There are dependencies required to run compile graphics applications in rust. Amethyst has a section in their documentation that seems to apply well here: https://github.com/amethyst/amethyst#debianubuntu

With those packages installed the example compiled no problem :)

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

No branches or pull requests

2 participants