| 20 Sep 2025 |
emily | I was hoping the broken = stdenv.hostPlatform.isDarwin; in netcat-openbsd would be outdated, but it is sadly now. | 18:18:25 |
emily | * I was hoping the broken = stdenv.hostPlatform.isDarwin; in netcat-openbsd would be outdated, but it is sadly not. | 18:18:26 |
emily | netcat.c:817:14: error: call to undeclared function 'accept4'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
817 | connfd = accept4(s, (struct sockaddr *)&cliaddr,
| ^
netcat.c:817:14: note: did you mean 'accept'?
/nix/store/8f25drv3142v3pijkqyx03gags0rscw0-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/socket.h:700:9: note: 'accept' declared here
700 | int accept(int, struct sockaddr * __restrict, socklen_t * __restrict)
| ^
netcat.c:818:15: error: use of undeclared identifier 'SOCK_NONBLOCK'
818 | &len, SOCK_NONBLOCK);
| ^~~~~~~~~~~~~
netcat.c:1152:42: error: use of undeclared identifier 'SOCK_CLOEXEC'
1152 | if ((s = unix_bind(unix_dg_tmp_socket, SOCK_CLOEXEC)) == -1)
| ^~~~~~~~~~~~
netcat.c:1155:42: error: use of undeclared identifier 'SOCK_CLOEXEC'
1155 | if ((s = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0)) == -1)
| ^~~~~~~~~~~~
netcat.c:1222:7: error: use of undeclared identifier 'SOCK_NONBLOCK'
1222 | SOCK_NONBLOCK, res->ai_protocol)) == -1)
| ^~~~~~~~~~~~~
netcat.c:2102:17: error: use of undeclared identifier 'IPTOS_LOWCOST'
2102 | { "lowcost", IPTOS_LOWCOST },
| ^~~~~~~~~~~~~
| 18:18:59 |
emily | I suppose this is why Homebrew packages GNU netcat. | 18:19:10 |
Marie | no, i just did netcat = prev.netcat-gnu | 18:19:13 |
aloisw | Not sure about users. At least the libvirtd module did originally not depend on netcat-openbsd for TLS (which was the Debian fork at that time I think), but for unix socket (https://github.com/NixOS/nixpkgs/pull/1087). | 18:25:46 |
ghpzin | Just FYI I figured out how to "fix" mesa with gcc15, apparently rustPlatform.bindgenHook just propagates gcc/glib by default. So everything that has that hook can use gcc instead of clang (maybe even always uses them, depending on whether bindgen cares about order in BINDGEN_EXTRA_CLANG_ARGS). | 18:44:57 |
emily | as in your fix is to just make it use Clang instead? | 18:45:26 |
ghpzin | As in just removing hook and leaving bindgen fixes it. | 18:45:43 |
ghpzin | * As in just removing hook and leaving bindgen fixes it, yes. | 18:46:14 |
dramforever | ... is it including two copies of <stdatomic.h> | 18:46:18 |
dramforever | and breaking #include_next? | 18:47:13 |
ghpzin | I do not think so, but it was pretty hard to get any info out of that thing. | 18:47:40 |
emily | where does bindgenHook do that propagation? | 18:48:09 |
emily | bindgenHook = makeSetupHook {
name = "rust-bindgen-hook";
substitutions = {
libclang = (lib.getLib clang.cc);
inherit clang;
};
} ./rust-bindgen-hook.sh;
| 18:48:18 |
ghpzin | https://github.com/symphorien/nixpkgs/blob/777a91f6f893c09cbbcf1144e48be2acd2a620e9/pkgs/build-support/rust/hooks/rust-bindgen-hook.sh#L9 | 18:48:29 |
ghpzin | * https://github.com/nixos/nixpkgs/blob/master/pkgs/build-support/rust/hooks/rust-bindgen-hook.sh#L9 | 18:48:46 |
emily | that's because bindgen uses libclang, right…? | 18:48:49 |
emily | so it needs to know how to compile C code with Clang flags | 18:49:10 |
Lun | include_next and wrappers adding hundreds of weirdly ordered isystem include dirs, name a better duo | 18:49:28 |
dramforever | looks like it's sending $NIX_CFLAGS_COMPILE into bindgen wrapper | 18:49:48 |
ghpzin | clang has all gcc/glibc things in /nix-support/cc-cflags and /nix-support/libcxx-cxxflags, probably because it itself is build with gcc | 18:50:17 |
emily | but… that's correct right? | 18:50:36 |
emily | those are the flags you'd use if you were compiling with clang | 18:50:37 |
emily | if you mean libgcc, that's correct | 18:50:47 |
emily | or well | 18:50:51 |
emily | depending… | 18:50:54 |
emily | but I mean if clang has the wrong flags for compiling with Clang in it then Clang would be broken | 18:51:12 |
ghpzin | But do you expect to bindgen to always use those things by default ? | 18:51:17 |
emily | like it should mirror the flags you'd get with llvmPackages.stdenv… | 18:51:20 |