I recently found out that the polybar package is broken on nixpkgs-unstable.
Here’s the actual error:
error: Cannot build '/nix/store/gb99cwmakrs4vvdppfzcak3xrymml306-polybar-3.7.2.drv'.
Reason: builder failed with exit code 2.
Output paths:
/nix/store/wgz50yhvyn10kp68g3ffa0h1khzb55rf-polybar-3.7.2
Last 25 log lines:
> 28 | vector<uint8_t> encode(const type_t type, const string& payload) {
> | ^~~~~~~
> /build/source/src/ipc/encoder.cpp:28:10: note: 'uint8_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
> /build/source/src/ipc/encoder.cpp:28:17: error: template argument 1 is invalid
> 28 | vector<uint8_t> encode(const type_t type, const string& payload) {
> | ^
> /build/source/src/ipc/encoder.cpp:28:17: error: template argument 2 is invalid
> /build/source/src/ipc/encoder.cpp:28:32: error: 'type_t' does not name a type; did you mean 'time_t'?
> 28 | vector<uint8_t> encode(const type_t type, const string& payload) {
> | ^~~~~~
> | time_t
> [ 35%] Building CXX object bin/CMakeFiles/poly.dir/modules/bspwm.cpp.o
> make[2]: *** [bin/CMakeFiles/poly.dir/build.make:401: bin/CMakeFiles/poly.dir/ipc/encoder.cpp.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> In file included from /build/source/src/ipc/util.cpp:9:
> /build/source/include/utils/string.hpp:48:3: error: 'uint32_t' does not name a type
> 48 | uint32_t codepoint{0};
> | ^~~~~~~~
> /build/source/include/utils/string.hpp:4:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
> 3 | #include <sstream>
> +++ |+#include <cstdint>
> 4 |
> make[2]: *** [bin/CMakeFiles/poly.dir/build.make:415: bin/CMakeFiles/poly.dir/ipc/util.cpp.o] Error 1
> make[1]: *** [CMakeFiles/Makefile2:607: bin/CMakeFiles/poly.dir/all] Error 2
> make: *** [Makefile:136: all] Error 2
For full logs, run:
nix log /nix/store/gb99cwmakrs4vvdppfzcak3xrymml306-polybar-3.7.2.drv
error: Cannot build '/nix/store/9a29ls4rk0hff3vimg209l1rnx8dfgjn-nix-shell-env.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/fpxw11288b59czpnkr1szjfm38plf060-nix-shell-env
error: Build failed due to failed dependency
And here’s the shell.nix that can reproduce the error:
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/76eec3925eb9bbe193934987d3285473dbcfad50.tar.gz";
pkgs = import nixpkgs { };
in
pkgs.mkShell {
buildInputs = [ pkgs.polybar ];
}
I’d like to be able to troubleshoot this error and similar errors in general, but I’m a little unsure where to start.
I can see that the latest change to the polybar source in nixpkgs is about three weeks ago. Within that time, I’ve built polybar from unstable successfully multiple times (up until yesterday in fact). So the actual error must be from elsewhere.
Any tips on what those places might be? The GitHub issue tracker hasn’t been that helpful.