Compilation fails on linux amd64 `warning: 'constraint' may be used uninitialized`
Closed this issue · 3 comments
Ramblurr commented
Compilation of hy3 is failling on
error: builder for '/nix/store/6gg9ndcx7l0zgrjhbqr8ywwlpclnmzq6-hy3-hl0.37.1.drv' failed with exit code 1;
last 10 log lines:
> [5/7] Building CXX object CMakeFiles/hy3.dir/src/TabGroup.cpp.o
> [6/7] Building CXX object CMakeFiles/hy3.dir/src/Hy3Node.cpp.o
> /build/vij9pxlfscvr8ydkkfb59kmd6w1a1xrm-source/src/Hy3Node.cpp: In member function 'void Hy3Node::recalcSizePosRecursive(bool)':
> /build/vij9pxlfscvr8ydkkfb59kmd6w1a1xrm-source/src/Hy3Node.cpp:352:72: warning: 'constraint' may be used uninitialized [-Wmaybe-
> 352 | group->layout != Hy3GroupLayout::Tabbed ? child_count <= 0 ? 0 : constraint / child_count : 0;
> | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /build/vij9pxlfscvr8ydkkfb59kmd6w1a1xrm-source/src/Hy3Node.cpp:333:16: note: 'constraint' was declared here
> 333 | double constraint;
> | ^~~~~~~~~~
> ninja: build stopped: subcommand failed.
For full logs, run 'nix log /nix/store/6gg9ndcx7l0zgrjhbqr8ywwlpclnmzq6-hy3-hl0.37.1.drv'.
error: 1 dependencies of derivation '/nix/store/0zl78cjmlijhknykz36hx6d611gl94ll-system-path.drv' failed to build
error (ignored): error: cannot unlink '/tmp/nix-build-nvidia-x11-550.67-6.7.11.drv-0': Directory not empty
error: 1 dependencies of derivation '/nix/store/gaahrspfqbmf1wxqsx4sd9x06zkv078x-nixos-system-quine-24.05.20240329.d8fe5e6.drv' failed to build
- Hyprland input rev: 416b3d6167a996c7e94bd537cec20a12a0784efa
- Hy3 input rev: cc953fc
- Last known working hyprland rev: fcd9d77b642c0cd45cae61cf10ed1924f2e7945b
Mange commented
Also happens on Nix x86_64.
The warning itself isn't the reason for the build failing, that is shown when using the nix log
command:
-- Build files have been written to: /build/source/build
cmake: enabled parallel building
cmake: enabled parallel installing
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
build flags: -j32 SHELL=/nix/store/agkxax48k35wdmkhmmija2i2sxg8i7ny-bash-5.2p26/bin/bash
[ 57%] Building CXX object CMakeFiles/hy3.dir/src/Hy3Layout.cpp.o
[ 57%] Building CXX object CMakeFiles/hy3.dir/src/dispatchers.cpp.o
[ 57%] Building CXX object CMakeFiles/hy3.dir/src/main.cpp.o
[ 57%] Building CXX object CMakeFiles/hy3.dir/src/Hy3Node.cpp.o
[ 71%] Building CXX object CMakeFiles/hy3.dir/src/TabGroup.cpp.o
[ 85%] Building CXX object CMakeFiles/hy3.dir/src/SelectionHook.cpp.o
/build/source/src/TabGroup.cpp:14:10: fatal error: src/helpers/memory/SharedPtr.hpp: No such file or directory
14 | #include "src/helpers/memory/SharedPtr.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/hy3.dir/build.make:132: CMakeFiles/hy3.dir/src/TabGroup.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/build/source/src/dispatchers.cpp: In function 'void dispatch_focustab(std::string)':
/build/source/src/dispatchers.cpp:177:22: error: 'isNumber' was not declared in this scope
177 | if (!isNumber(args[i])) return;
| ^~~~~~~~
/build/source/src/Hy3Node.cpp: In member function 'PHLWINDOW Hy3Node::bringToTop()':
/build/source/src/Hy3Node.cpp:212:1: warning: control reaches end of non-void function [-Wreturn-type]
212 | }
| ^
/build/source/src/Hy3Node.cpp: In member function 'Hy3Node* Hy3Node::getFocusedNode(bool, bool)':
/build/source/src/Hy3Node.cpp:275:1: warning: control reaches end of non-void function [-Wreturn-type]
275 | }
| ^
/build/source/src/Hy3Node.cpp: In member function 'bool Hy3Node::isUrgent()':
/build/source/src/Hy3Node.cpp:620:1: warning: control reaches end of non-void function [-Wreturn-type]
620 | }
| ^
make[2]: *** [CMakeFiles/hy3.dir/build.make:90: CMakeFiles/hy3.dir/src/dispatchers.cpp.o] Error 1
/build/source/src/Hy3Layout.cpp: In member function 'bool Hy3Layout::shouldRenderSelected(const PHLWINDOW&)':
/build/source/src/Hy3Layout.cpp:1401:1: warning: control reaches end of non-void function [-Wreturn-type]
1401 | }
| ^
/build/source/src/Hy3Node.cpp: In member function 'void Hy3Node::recalcSizePosRecursive(bool)':
/build/source/src/Hy3Node.cpp:381:71: warning: 'constraint' may be used uninitialized [-Wmaybe-uninitialized]
381 | group.layout != Hy3GroupLayout::Tabbed ? child_count <= 0 ? 0 : constraint / child_count : 0;
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/source/src/Hy3Node.cpp:362:16: note: 'constraint' was declared here
362 | double constraint;
| ^~~~~~~~~~
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/hy3.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
This might be a Nix packaging issue, or it could be caused by an incompatibility between specific versions of Hyprland and hy3.
Mange commented
Yeah, this is likely a Nix-specific issue since it was fixed here: #120
Seems like some activity may be happening in Nix upstream here:
outfoxxed commented
fixed compile again