-
nixpkgs version: ‘github:NixOS/nixpkgs/9e83b64f727c88a7711a2c463a7b16eedb69a84c?narHash=sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI%3D’ to ‘/nix/store/ny8c07vsrfwcb1c4i3jcpbi3qi4w9wy6-source’ (hash ‘sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=’
-
build cmd: nix build —expr ‘let pkgs = import /nix/store/ny8c07vsrfwcb1c4i3jcpbi3qi4w9wy6-source {}; in pkgs.callPackage ./mods/nurPkgs/pw-viz.nix {}’ —impure
- inside my config repo (github:c2vi/nixos)
-
features.h not found
- is part of the Header File (C)s from libcs…
-
stddef.h not found
- with Software Building, Distributing and Packaging you run into the weirdest things:
/nix/store/vfaqy7cvbb04fjalznf3lc0x8v3nwjnj-libcxx-20.1.5-dev/include/c++/v1/stddef.h:38:17: fatal error: 'stddef.h' file not found
a Header File (C) includes itself… but does not find itself… - Pasted image 20250619091252.png … according to https://github.com/NixOS/nixpkgs/issues/66456 there is also a stddef.h in the clang pkg… and that actually makes sense, as this file can be included multiple times (as it sais in it’s contents)
- with Software Building, Distributing and Packaging you run into the weirdest things:
-
errno.h not found
- aparently this needs kernel headers as well??? … well the libc needing it makes sense
-
errno.h not found
-
errno.h not found
-
endian.h not found … Pasted image 20250619095134.png
-
and then I ran into WEIRED errors (Pasted image 20250619092639.png), even syntax errors… and i think this is because I willy nilly combined the Header File (C)s with the right names without knowing if they are actually the correct ones
-
for endian.h which is included by this file: https://docs.pipewire.org/endian_8h_source.html I added
-I ${llvmPackages_20.libcxx.dev}/include/c++/v1/__bit
because this has a endian.h -
from a nix index search:
glibc.dev 2,299 r /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/endian.h
- ohhhhh… we don’t “compile” (idk what Rust bindgen is exactly doing here) with gcc (but LLM) but still against glibc…
-
aha we find (probably the correct) endian.h and byteswap.h now… but WTF
> --- stderr
> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/bits/byteswap.h:36:5: error: function-like macro '__GNUC_PREREQ' is not defined
> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/bits/byteswap.h:51:5: error: function-like macro '__GNUC_PREREQ' is not defined
> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/bits/byteswap.h:72:5: error: function-like macro '__GNUC_PREREQ' is not defined
>
-
oh, i have the wrong features.h… Pasted image 20250619100414.png
-
ahhhhhhhh, wenn mia a C Standard Library (software) dabei habn… brauch mia koan Kernel Headers mehr…
pw-viz> cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
pw-viz> cargo:rerun-if-changed=wrapper.h
pw-viz> --- stderr
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/stdint.h:95:11: warning: '__INT64_C' macro redefined [-Wmacro-redefined]
pw-viz> note: previous definition is here
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/stdint.h:96:11: warning: '__UINT64_C' macro redefined [-Wmacro-redefined]
pw-viz> note: previous definition is here
pw-viz> /nix/store/fmysfy9gl5d59yir4fksi29wz10maljg-clang-wrapper-19.1.7/resource-root/include/stdbool.h:26:15: error: expected identifier
pw-viz> /nix/store/fmysfy9gl5d59yir4fksi29wz10maljg-clang-wrapper-19.1.7/resource-root/include/stdbool.h:25:14: error: expected identifier
pw-viz> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/types.h:20:26: error: typedef redefinition with different types ('__kernel_fd_set' vs 'struct fd_set')
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/sys/select.h:70:5: note: previous definition is here
pw-viz> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/types.h:21:25: error: typedef redefinition with different types ('__kernel_dev_t' (aka 'unsigned int') vs '__dev_t' (aka 'unsigned long'))
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/sys/types.h:59:17: note: previous definition is here
pw-viz> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/types.h:25:15: error: typedef redefinition with different types ('u32' (aka 'unsigned int') vs '__nlink_t' (aka 'unsigned long'))
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/sys/types.h:74:19: note: previous definition is here
pw-viz> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/types.h:31:26: error: typedef redefinition with different types ('__kernel_timer_t' (aka 'int') vs '__timer_t' (aka 'void *'))
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/bits/types/timer_t.h:7:19: note: previous definition is here
pw-viz> /nix/store/fmysfy9gl5d59yir4fksi29wz10maljg-clang-wrapper-19.1.7/resource-root/include/stdbool.h:24:14: error: cannot combine with previous 'bool' declaration specifier
clude/sys/types.h:42:18: note: previous definition is here
pw-viz> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/types.h:113:15: error: typedef redefinition with different types ('u64' (aka 'unsigned long long') vs '__uint64_t' (aka 'unsigned long'))
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/bits/stdint-uintn.h:27:20: note: previous definition is here
pw-viz> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/types.h:114:15: error: typedef redefinition with different types ('u64' (aka 'unsigned long long') vs '__uint64_t' (aka 'unsigned long'))
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/sys/types.h:161:20: note: previous definition is here
pw-viz> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/types.h:115:15: error: typedef redefinition with different types ('s64' (aka 'long long') vs '__int64_t' (aka 'long'))
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/bits/stdint-intn.h:27:19: note: previous definition is here
pw-viz> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/types.h:136:13: error: typedef redefinition with different types ('u64' (aka 'unsigned long long') vs '__blkcnt_t' (aka 'long'))
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/sys/types.h:192:20: note: previous definition is here
pw-viz> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/vdso/limits.h:17:9: warning: 'UINTPTR_MAX' macro redefined [-Wmacro-redefined]
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/stdint.h:177:11: note: previous definition is here
pw-viz> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/limits.h:9:9: warning: 'SIZE_MAX' macro redefined [-Wmacro-redefined]
pw-viz> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/stdint.h:216:11: note: previous definition is here
pw-viz> clang diag: /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/stdint.h:95:11: warning: '__INT64_C' macro redefined [-Wmacro-redefined]
pw-viz> clang diag: /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/stdint.h:96:11: warning: '__UINT64_C' macro redefined [-Wmacro-redefined]
th different types ('s64' (aka 'long long') vs '__int64_t' (aka 'long'))
> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/bits/stdint-intn.h:27:19: note: previous definition is here
> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/types.h:136:13: error: typedef redefinition with different types ('u64' (aka 'unsigned long long') vs '__blkcnt_t' (aka 'long'))
> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/sys/types.h:192:20: note: previous definition is here
> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/vdso/limits.h:17:9: warning: 'UINTPTR_MAX' macro redefined [-Wmacro-redefined]
> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/stdint.h:177:11: note: previous definition is here
> /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/limits.h:9:9: warning: 'SIZE_MAX' macro redefined [-Wmacro-redefined]
> /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/stdint.h:216:11: note: previous definition is here
> clang diag: /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/stdint.h:95:11: warning: '__INT64_C' macro redefined [-Wmacro-redefined]
> clang diag: /nix/store/r25srliigrrv5q3n7y8ms6z10spvjcd9-glibc-2.40-66-dev/include/stdint.h:96:11: warning: '__UINT64_C' macro redefined [-Wmacro-redefined]
> clang diag: /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/types.h:35:1: warning: typedef requires a name [-Wmissing-declarations]
> clang diag: /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/vdso/limits.h:17:9: warning: 'UINTPTR_MAX' macro redefined [-Wmacro-redefined]
> clang diag: /nix/store/p47xj10mslxazgc00jml98lndd3qcyjh-linux-6.12.33-dev/lib/modules/6.12.33/source/include/linux/limits.h:9:9: warning: 'SIZE_MAX' macro redefined [-Wmacro-redefined]
>
> thread 'main' panicked at /build/pw-viz-0.3.0-vendor/pipewire-sys-0.8.0/build.rs:39:39:
> Unable to
-
oh and Kernel Headers and libc Headers are really similar… this should make it possible to compile C directly against Kernel Header…
-
so i removed all -Is for kernel headers…
-
ohhhhhh, the glibc/include/asm/ links to the Kernel Headers… Pasted image 20250619101602.png (for errno.h)
-
the finished pkg: https://github.com/c2vi/nixos/blob/d8064bd4c5a71c110c8b3bd16c37a0ceca2448f6/mods/nurPkgs/pw-viz.nix
- is part of my NUR = Nix User Repository
- and can be run like:
nix run github:c2vi/nixos#pw-viz
-
now it also works without this libc-full, so other nixpkgs revs other then the one at the top of this note…