Amethyst does not compile on certain Linux platforms. This is due to wayland-client releasing a breaking change on a patch release. This breaks winit which breaks amethyst.
Related issue in winit: https://github.com/tomaka/winit/issues/754
Step 1: Clone winit locally and apply the following patch:
diff --git a/src/platform/linux/wayland/touch.rs b/src/platform/linux/wayland/touch.rs
index e9e28d61..3e1e0f9c 100644
--- a/src/platform/linux/wayland/touch.rs
+++ b/src/platform/linux/wayland/touch.rs
@@ -91,6 +91,8 @@ pub(crate) fn implement_touch(
pt.wid,
);
},
+ TouchEvent::Shape {..} => {},
+ TouchEvent::Orientation {..} => {},
}
}, ())
}).unwrap()
If you run cargo build before applying this patch, all this does is fix the complation error in src/platform/linux/wayland/touch.rs.
Step 2: In the Cargo.toml file of your amethyst project, add the following:
[replace]
"winit:0.18.0" = { path = "../winit" }
Make sure you have the dependencies installed: sudo apt install libasound2-dev libx11-xcb-dev libssl-dev cmake libfreetype6-dev libexpat1-dev libxcb1-dev
amethyst new ...cargo runIt should compile.
$ cargo run
...lots omitted...
error[E0004]: non-exhaustive patterns: `Shape { .. }` and `Orientation { .. }` not covered
--> /home/sunjay/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.18.0/src/platform/linux/wayland/touch.rs:30:19
|
30 | match evt {
| ^^^ patterns `Shape { .. }` and `Orientation { .. }` not covered
error: aborting due to previous error
For more information about this error, try `rustc --explain E0004`.
error: Could not compile `winit`.
warning: build failed, waiting for other jobs to finish...
error: build failed
Full Output
$ cargo run
Compiling proc-macro2 v0.4.24
Compiling unicode-xid v0.1.0
Compiling cc v1.0.28
Compiling semver-parser v0.7.0
Compiling libc v0.2.46
Compiling serde v1.0.84
Compiling arrayvec v0.4.10
Compiling cfg-if v0.1.6
Compiling void v1.0.2
Compiling nodrop v0.1.13
Compiling rand_core v0.3.0
Compiling num-traits v0.2.6
Compiling xml-rs v0.8.0
Compiling memoffset v0.2.1
Compiling scopeguard v0.3.3
Compiling lazy_static v1.2.0
Compiling stable_deref_trait v1.1.1
Compiling nix v0.12.0
Compiling rayon-core v1.4.1
Compiling khronos_api v2.2.0
Compiling bitflags v1.0.4
Compiling autocfg v0.1.1
Compiling khronos_api v3.0.0
Compiling crossbeam-utils v0.5.0
Compiling byteorder v1.2.7
Compiling rayon v1.0.3
Compiling downcast-rs v1.0.3
Compiling either v1.5.0
Compiling linked-hash-map v0.5.1
Compiling same-file v1.0.4
Compiling pkg-config v0.3.14
Compiling typenum v1.10.0
Compiling num-complex v0.2.1
Compiling matrixmultiply v0.1.15
Compiling mopa v0.2.2
Compiling atom v0.3.5
Compiling num-integer v0.1.39
Compiling xdg v2.2.0
Compiling rustc-demangle v0.1.13
Compiling fnv v1.0.6
Compiling num-bigint v0.2.2
Compiling futures v0.1.25
Compiling num-iter v0.1.37
Compiling nonzero_signed v1.0.2
Compiling rawpointer v0.1.0
Compiling libm v0.1.2
Compiling num-derive v0.2.3
Compiling tuple_utils v0.2.0
Compiling percent-encoding v1.0.1
Compiling mint v0.5.1
Compiling unicode-xid v0.0.4
Compiling num-rational v0.2.1
Compiling adler32 v1.0.3
Compiling safemem v0.3.0
Compiling cgmath v0.16.1
Compiling failure_derive v0.1.5
Compiling approx v0.1.1
Compiling lzw v0.10.0
Compiling quote v0.3.15
Compiling color_quant v1.0.1
Compiling build_const v0.2.1
Compiling scoped_threadpool v0.1.9
Compiling siphasher v0.2.3
Compiling xi-unicode v0.1.0
Compiling hetseq v0.2.0
Compiling wavefront_obj v5.1.0
Compiling ansi_term v0.11.0
Compiling unicode-width v0.1.5
Compiling strsim v0.7.0
Compiling seahash v3.0.5
Compiling claxon v0.3.2
Compiling hound v3.4.0
Compiling matches v0.1.8
Compiling vec_map v0.8.1
Compiling float-ord v0.2.0
Compiling fluent-locale v0.4.1
Compiling unicode-normalization v0.1.7
Compiling unicode-segmentation v1.2.1
Compiling crossbeam-utils v0.2.2
Compiling crossbeam-utils v0.6.3
Compiling proc-macro2 v0.3.8
Compiling unreachable v1.0.0
Compiling rand_core v0.2.2
Compiling rand_xorshift v0.1.1
Compiling rand_hc v0.1.0
Compiling rand_isaac v0.1.1
Compiling semver v0.9.0
Compiling owning_ref v0.4.0
Compiling owning_ref v0.3.3
Compiling colored v1.6.1
Compiling xml-rs v0.7.0
Compiling rand_chacha v0.1.1
Compiling rand v0.6.3
Compiling backtrace v0.3.13
Compiling itertools v0.7.11
Compiling libloading v0.5.0
Compiling backtrace-sys v0.1.28
Compiling cmake v0.1.35
Compiling minimp3-sys v0.3.1
Compiling rustc-hash v1.0.1
Compiling stb_truetype v0.2.5
Compiling fxhash v0.2.1
Compiling ogg v0.7.0
Compiling hashbrown v0.1.7
Compiling walkdir v2.2.7
Compiling wayland-scanner v0.21.9
Compiling x11-dl v2.18.3
Compiling alsa-sys v0.1.2
Compiling servo-fontconfig-sys v4.0.7
Compiling synom v0.11.3
Compiling base64 v0.9.3
Compiling deflate v0.7.19
Compiling inflate v0.4.4
Compiling crc v1.8.1
Compiling gif v0.10.1
Compiling phf_shared v0.7.24
Compiling textwrap v0.10.0
Compiling annotate-snippets v0.1.0
Compiling lock_api v0.1.5
Compiling rustc_version v0.2.3
Compiling quote v0.5.2
Compiling expat-sys v2.1.6
Compiling servo-freetype-sys v4.0.5
Compiling syn v0.11.11
Compiling phf v0.7.24
Compiling wayland-client v0.21.9
Compiling wayland-protocols v0.21.9
Compiling fluent-syntax v0.1.1
Compiling crossbeam-epoch v0.3.1
Compiling crossbeam-epoch v0.7.0
Compiling crossbeam-epoch v0.5.2
Compiling crossbeam-epoch v0.6.1
Compiling rand v0.5.5
Compiling num_cpus v1.9.0
Compiling rand v0.4.3
Compiling rand_os v0.1.0
Compiling memmap v0.7.0
Compiling shared_library v0.1.9
Compiling time v0.1.41
Compiling xcb v0.8.2
Compiling slice-deque v0.1.16
Compiling atty v0.2.11
Compiling dirs v1.0.4
Compiling memmap v0.6.2
Compiling syn v0.13.11
Compiling parking_lot_core v0.3.1
Compiling rand_pcg v0.1.1
Compiling parking_lot_core v0.4.0
Compiling rustc_version_runtime v0.1.5
Compiling quote v0.6.10
Compiling intl_pluralrules v1.0.1
Compiling approx v0.3.1
Compiling ordered-float v1.0.1
Compiling line_drawing v0.7.0
Compiling num-traits v0.1.43
Compiling euclid v0.19.4
Compiling generic-array v0.11.1
Compiling crossbeam-deque v0.2.0
Compiling crossbeam-deque v0.5.2
Compiling crossbeam-deque v0.6.3
Compiling gfx_macros v0.2.1
Compiling osmesa-sys v0.1.2
Compiling clap v2.32.0
Compiling rand v0.3.22
Compiling dlib v0.4.1
Compiling minimp3 v0.3.2
Compiling cpal v0.8.2
Compiling syn v0.15.23
Compiling chrono v0.4.6
Compiling rusttype v0.7.3
Compiling lyon_geom v0.12.2
Compiling wayland-sys v0.21.9
Compiling cgmath v0.14.1
Compiling error-chain v0.12.0
Compiling glsl-layout-derive v0.1.1
Compiling freetype v0.4.1
Compiling png v0.12.0
Compiling andrew v0.1.4
Compiling glyph_brush_layout v0.1.3
Compiling vergen v3.0.4
Compiling wayland-commons v0.21.9
Compiling servo-fontconfig v0.4.0
Compiling lyon_path v0.12.0
Compiling genmesh v0.6.2
Compiling hibitset v0.5.4
Compiling jpeg-decoder v0.1.15
Compiling serde_derive v1.0.84
Compiling derivative v1.0.2
Compiling shred-derive v0.5.1
Compiling synstructure v0.10.1
Compiling amethyst_derive v0.3.0 (https://github.com/amethyst/amethyst#36835499)
Compiling derive-new v0.5.6
Compiling tiff v0.2.1
Compiling smithay-client-toolkit v0.4.4
Compiling image v0.20.1
Compiling failure v0.1.5
Compiling fluent v0.4.3
Compiling amethyst v0.10.0 (https://github.com/amethyst/amethyst#36835499)
Compiling smallvec v0.6.7
Compiling log v0.4.6
Compiling draw_state v0.8.0
Compiling ron v0.4.0
Compiling bincode v1.0.1
Compiling uuid v0.7.1
Compiling gl_generator v0.9.0
Compiling gl_generator v0.10.0
Compiling glyph_brush v0.2.4
Compiling font-kit v0.1.0
Compiling fern v0.5.7
Compiling parking_lot_core v0.2.14
Compiling shred v0.7.1
Compiling lewton v0.9.3
Compiling laminar v0.1.0
Compiling alga v0.7.2
Compiling num v0.2.0
Compiling amethyst_config v0.9.0 (https://github.com/amethyst/amethyst#36835499)
Compiling gfx_core v0.8.3
Compiling gfx_gl v0.5.0
Compiling glutin v0.19.0
Compiling x11-clipboard v0.3.0
Compiling parking_lot v0.6.4
Compiling parking_lot v0.5.5
Compiling minterpolate v0.4.0
Compiling parking_lot v0.7.1
Compiling rodio v0.8.1
Compiling clipboard v0.5.0
Compiling crossbeam-channel v0.2.6
Compiling winit v0.18.0
Compiling shrev v1.0.1
Compiling nalgebra v0.16.13
Compiling crossbeam-channel v0.3.6
Compiling crossbeam v0.4.1
Compiling specs v0.14.3
error[E0004]: non-exhaustive patterns: `Shape { .. }` and `Orientation { .. }` not covered
--> /home/sunjay/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.18.0/src/platform/linux/wayland/touch.rs:30:19
|
30 | match evt {
| ^^^ patterns `Shape { .. }` and `Orientation { .. }` not covered
error: aborting due to previous error
For more information about this error, try `rustc --explain E0004`.
error: Could not compile `winit`.
warning: build failed, waiting for other jobs to finish...
error: build failed
N/A
Full system info
System: Host: brown-dynamite Kernel: 4.15.0-43-generic x86_64 bits: 64 compiler: gcc v: 7.3.0
Desktop: Cinnamon 4.0.8 wm: muffin dm: LightDM Distro: Linux Mint 19.1 Tessa
base: Ubuntu 18.04 bionic
Machine: Type: Laptop System: Dell product: XPS 15 9560 v: N/A serial: <filter> Chassis:
type: 10 serial: <filter>
Mobo: Dell model: 05FFDN v: A00 serial: <filter> UEFI: Dell v: 1.9.4 date: 04/23/2018
Battery: ID-1: BAT0 charge: 84.5 Wh condition: 84.5/97.0 Wh (87%) volts: 13.2/11.4
model: SMP DELL GPM0365 serial: <filter> status: Full
CPU: Topology: Quad Core model: Intel Core i7-7700HQ bits: 64 type: MT MCP arch: Kaby Lake
rev: 9 L2 cache: 6144 KiB
flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 44928
Speed: 1545 MHz min/max: 800/3800 MHz Core speeds (MHz): 1: 1450 2: 1427 3: 1402
4: 1477 5: 1400 6: 1422 7: 1429 8: 1402
Graphics: Device-1: Intel vendor: Dell driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:591b
Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] vendor: Dell driver: nvidia v: 390.77
bus ID: 01:00.0 chip ID: 10de:1c8d
Display: x11 server: X.Org 1.19.6 driver: modesetting unloaded: fbdev,vesa
resolution: 3840x2160~60Hz
OpenGL: renderer: Mesa DRI Intel HD Graphics 630 (Kaby Lake GT2) v: 4.5 Mesa 18.0.5
compat-v: 3.0 direct render: Yes
Audio: Device-1: Intel CM238 HD Audio vendor: Dell driver: snd_hda_intel v: kernel
bus ID: 00:1f.3 chip ID: 8086:a171
Sound Server: ALSA v: k4.15.0-43-generic
Network: Device-1: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter
vendor: Bigfoot Networks driver: ath10k_pci v: kernel port: e000 bus ID: 02:00.0
chip ID: 168c:003e
IF: wlp2s0 state: up mac: <filter>
Device-2: Atheros type: USB driver: btusb bus ID: 1-4:2 chip ID: 0cf3:e301
IF-ID-1: docker0 state: down mac: <filter>
Drives: Local Storage: total: 953.87 GiB used: 708.96 GiB (74.3%)
ID-1: /dev/nvme0n1 vendor: Hynix model: PC401 NVMe SK 1TB size: 953.87 GiB
speed: 31.6 Gb/s lanes: 4 serial: <filter>
Partition: ID-1: / size: 906.93 GiB used: 708.96 GiB (78.2%) fs: ext4 dev: /dev/nvme0n1p2
ID-2: swap-1 size: 31.86 GiB used: 4 KiB (0.0%) fs: swap dev: /dev/nvme0n1p3
Sensors: System Temperatures: cpu: 54.0 C mobo: 46.0 C
Fan Speeds (RPM): cpu: 2466
Repos: No active apt repos in: /etc/apt/sources.list
Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
1: deb http: //mirrors.evowise.com/linuxmint/packages tessa main upstream import backport
2: deb http: //archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
3: deb http: //archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
4: deb http: //archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
5: deb http: //security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
6: deb http: //archive.canonical.com/ubuntu/ bionic partner
Info: Processes: 293 Uptime: 2d 14h 53m Memory: 31.27 GiB used: 6.22 GiB (19.9%)
Init: systemd v: 237 runlevel: 5 default: 2 Compilers: gcc: 5.5.0 alt: 5/8
clang: 3.8.0-2ubuntu4 Client: Unknown python3.6 client inxi: 3.0.27
Related issue in winit: https://github.com/tomaka/winit/issues/754
An easier work around is to just add wayland-client = "=0.21.7" to your cargo.toml
It's fixed! Delete the workaround and run cargo update to get the latest versions of everything.
Thanks for reporting the issue and keeping us up to date <3