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

Linux compilation errors related to smithay-client-toolkit #1562

Closed
AustinJ235 opened this issue May 10, 2020 · 4 comments
Closed

Linux compilation errors related to smithay-client-toolkit #1562

AustinJ235 opened this issue May 10, 2020 · 4 comments

Comments

@AustinJ235
Copy link

OS: Arch Linux
GPU: Amd Vega 56 & Nvidia GTX 780

The version that winit uses of the lib smithay-client-toolkit seems to be a bit dated. This dependancy brings in wayland-protocols which fails to build on my linux systems.

   --> /home/austin/Workspace/vk-voxel/target/release/build/wayland-protocols-aba19884de702452/out/fullscreen-shell-v1_client_api.rs:728:1
    |
655 |         fn capability(&mut self, object: ZwpFullscreenShellV1, capability: u32) {}
    |                                                                                 -- this block is empty, you might have not meant to close it
...
728 | }
    | ^ unexpected closing delimiter

   --> /home/austin/Workspace/vk-voxel/target/release/build/wayland-protocols-aba19884de702452/out/keyboard-shortcuts-inhibit-v1_client_api.rs:362:1
    |
313 |     pub trait EventHandler {}
    |                            -- this block is empty, you might have not meant to close it
...
362 | }
    | ^ unexpected closing delimiter

   --> /home/austin/Workspace/vk-voxel/target/release/build/wayland-protocols-aba19884de702452/out/linux-explicit-synchronization-v1_client_api.rs:368:1
    |
322 |     pub trait EventHandler {}
    |                            -- this block is empty, you might have not meant to close it
...
368 | }
    | ^ unexpected closing delimiter

I can manually fix these errors as they seem to be code generation problems. There are functions that begin within comments that shouldn't be in the comments.

It has been fairly annoying to manually go through and change these files everytime I do a fresh build on my linux systems. I am not sure if this would be solved by updating the lib used. These does seem to be a fairly large task just taking a glance at it, but I think this is something that should be looked at.

@kchibisov
Copy link
Member

Could you explain how are you compiling winit, are you passing some special flags to do certain stuff? winit compiles just fine and tested on Ci on Linux, so something like that would be noticed long time ago. I'm not even sure how to repro it.

cc @vberger

@AustinJ235
Copy link
Author

AustinJ235 commented May 10, 2020

Interesting so if I compile it alone it works fine, if I compile vulkano-win it works fine, but If I compile basalt I get the errors. I don't use any additional features. Maybe if someone else could give one of my examples a go in my repo that'd be appreciated. All of the winit code used in my lib is within one file, basalt/src/window/winit.rs

Currrently using rustc 1.44.0-nightly (94d346360 2020-04-09)

@kchibisov
Copy link
Member

kchibisov commented May 10, 2020

I can compile your lib, but I had to delete rustfmt.toml, I guess. It seems like someone is trying to run formatter on bindings, which is failing due to fmt bugs (IIRC I've seen that issue in the past already). But by default it shouldn't run formatter, I guess.

@elinorbgr
Copy link
Contributor

You are hitting this issue: Smithay/wayland-rs#291

TL;DR : wayland-scanner runs rustfmt on the generated code if available, to ease debugging (otherwise the whole thing is generated on a single line which is horrible to inspect).

However rustfmt's normalize_doc_attributes = true is bugged, and comments out parts of the generated code during the formatting: rust-lang/rustfmt#3988

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants