Closed Billli11 closed 2 months ago
I'm encountering the same issue when trying to build Sway. The build fails until I remove the *
in the line that assigns output_event->when
to output->last_presentation
. It seems like this might be a bug or an oversight.
Here’s a detailed description of the problem and my workaround:
[swapnanil@ch sway]$ ninja -C build/
ninja: Entering directory `build/'
[12/235] Compiling C object sway/sway.p/desktop_output.c.o
FAILED: sway/sway.p/desktop_output.c.o
cc -Isway/sway.p -Isway -I../sway -Iinclude -I../include -Iprotocols -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/json-c -I/usr/include/libevdev-1.0 -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/wlroots-0.19 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O0 -g -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -Wno-unused-parameter -Wno-unused-result -Wno-missing-braces -Wno-format-zero-length -Wundef -Wvla '-DSYSCONFDIR="//usr/local/etc"' '-DSWAY_VERSION="1.10-dev-7288f77b (" DATE ", branch '"'"'master'"'"')"' -fmacro-prefix-map=../= -pthread -MD -MQ sway/sway.p/desktop_output.c.o -MF sway/sway.p/desktop_output.c.o.d -o sway/sway.p/desktop_output.c.o -c ../sway/desktop/output.c
../sway/desktop/output.c: In function ‘handle_present’:
../sway/desktop/output.c:468:37: error: incompatible types when assigning to type ‘struct timespec’ from type ‘struct timespec *’
468 | output->last_presentation = output_event->when;
| ^~~~
[25/235] Compiling C object sway/sway.p/commands_exec_always.c.o
ninja: build stopped: subcommand failed.
After modifying the line to dereference the pointer:
output->last_presentation = *output_event->when;
The build completes successfully:
ninja -C build/ ninja: Entering directory `build/' [211/211] Linking target sway/sway
sudo ninja -C build/ install ninja: Entering directory `build/' [0/1] Installing files. Installing sway.1 to /usr/local/share/man/man1 Installing sway.5 to /usr/local/share/man/man5 Installing sway-bar.5 to /usr/local/share/man/man5 Installing sway-input.5 to /usr/local/share/man/man5 Installing sway-ipc.7 to /usr/local/share/man/man7 Installing sway-output.5 to /usr/local/share/man/man5 Installing swaybar-protocol.7 to /usr/local/share/man/man7 Installing swaymsg.1 to /usr/local/share/man/man1 Installing swaynag.1 to /usr/local/share/man/man1 Installing swaynag.5 to /usr/local/share/man/man5 Installing sway/sway to /usr/local/bin Installing swaymsg/swaymsg to /usr/local/bin Installing swaybar/swaybar to /usr/local/bin Installing swaynag/swaynag to /usr/local/bin Installing /home/swapnanil/repos/sway/build/config to /usr/local/etc/sway Installing /home/swapnanil/repos/sway/sway.desktop to /usr/local/share/wayland-sessions Installing /home/swapnanil/repos/sway/assets/Sway_Wallpaper_Blue_768x1024.png to /usr/local/share/backgrounds/sway Installing /home/swapnanil/repos/sway/assets/Sway_Wallpaper_Blue_768x1024_Portrait.png to /usr/local/share/backgrounds/sway Installing /home/swapnanil/repos/sway/assets/Sway_Wallpaper_Blue_1136x640.png to /usr/local/share/backgrounds/sway Installing /home/swapnanil/repos/sway/assets/Sway_Wallpaper_Blue_1136x640_Portrait.png to /usr/local/share/backgrounds/sway Installing /home/swapnanil/repos/sway/assets/Sway_Wallpaper_Blue_1366x768.png to /usr/local/share/backgrounds/sway Installing /home/swapnanil/repos/sway/assets/Sway_Wallpaper_Blue_1920x1080.png to /usr/local/share/backgrounds/sway Installing /home/swapnanil/repos/sway/assets/Sway_Wallpaper_Blue_2048x1536.png to /usr/local/share/backgrounds/sway Installing /home/swapnanil/repos/sway/assets/Sway_Wallpaper_Blue_2048x1536_Portrait.png to /usr/local/share/backgrounds/sway Installing /home/swapnanil/repos/sway/completions/zsh/_sway to /usr/local/share/zsh/site-functions Installing /home/swapnanil/repos/sway/completions/zsh/_swaymsg to /usr/local/share/zsh/site-functions Installing /home/swapnanil/repos/sway/completions/bash/sway to /usr/local/share/bash-completion/completions Installing /home/swapnanil/repos/sway/completions/bash/swaymsg to /usr/local/share/bash-completion/completions Installing /home/swapnanil/repos/sway/completions/bash/swaybar to /usr/local/share/bash-completion/completions Installing /home/swapnanil/repos/sway/completions/fish/sway.fish to /usr/local/share/fish/vendor_completions.d Installing /home/swapnanil/repos/sway/completions/fish/swaymsg.fish to /usr/local/share/fish/vendor_completions.d Installing /home/swapnanil/repos/sway/completions/fish/swaynag.fish to /usr/local/share/fish/vendor_completions.d ...
Please fill out the following:
Sway Version:
Debug Log:
Configuration File:
Stack Trace:
Description:
With MR4803
when
inwlr_output_event_present
has benn changed.Removing a asterisk in
sway/desktop/output.c
fix building but I don't know enough programing to know if this is the correct fix.