| 20 Sep 2023 |
K900 โก๏ธ | Yeah but it could work as a proof of concept | 10:31:15 |
K900 โก๏ธ | To make sure it's patchelf that's breaking things | 10:31:26 |
K900 โก๏ธ | $env.LD_LIBRARY_PATH = (nix-instantiate --eval --expr --json 'let pkgs = import <nixpkgs> {}; in pkgs.lib.strings.makeLibraryPath (with pkgs; [ alsa-lib gtk3 xorg.libXtst dbus-glib ])' | jq -r); ./firefox | 10:47:00 |
K900 โก๏ธ | Works on the latest nightly | 10:47:03 |
K900 โก๏ธ | Time to break it | 10:47:25 |
K900 โก๏ธ | * $env.LD_LIBRARY_PATH = (nix-instantiate --eval --expr --json 'let pkgs = import <nixpkgs> {}; in pkgs.lib.strings.makeLibraryPath (with pkgs; [ alsa-lib gtk3 xorg.libXtst dbus-glib ])' | jq -r); ./firefox ( + nix-ld) | 10:47:37 |
K900 โก๏ธ | Ok found it | 10:54:11 |
K900 โก๏ธ | OK so basically patchelf --set-rpath on pretty much any .so file makes it die horribly | 10:57:16 |
K900 โก๏ธ | The executables are fine | 10:57:20 |
K900 โก๏ธ | It's the dylibs that are the problem | 10:57:24 |
K900 โก๏ธ | https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/networking/browsers/firefox-bin/default.nix#L179-L181 | 10:58:14 |
K900 โก๏ธ | I'm pretty sure this is entirely unnecessary | 10:58:20 |
K900 โก๏ธ | And can just be removed | 10:58:22 |
K900 โก๏ธ | Also I'm pretty sure literally any attempt to load the patchelf-ed library just dies | 10:59:13 |
K900 โก๏ธ | ~/downloads/firefox
โ โฏ bat test.c
โโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ File: test.c
โโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1 โ #include <dlfcn.h>
2 โ
3 โ int main() {
4 โ dlopen("./libmozsqlite3.so", RTLD_LAZY);
5 โ }
โโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
~/downloads/firefox
โ โฏ gcc test.c
~/downloads/firefox
โ โฏ ./a.out
Segmentation fault: oops, process './a.out' core dumped
Error: nu::shell::external_command
ร External command failed
โญโ[entry #7:1:1]
1 โ ./a.out
ยท โโโโฌโโโ
ยท โฐโโ core dumped
โฐโโโโ
help: Segmentation fault: child process './a.out' core dumped | 11:00:44 |
K900 โก๏ธ | I think we need @Mic92 | 11:01:19 |
K900 โก๏ธ | OK what the fuck is going on with firefox-bin anyway | 11:10:08 |
K900 โก๏ธ | Is it just older than autoPatchelfHook | 11:10:13 |
vcunat | IIRC it can be necessary to set RPATHs on libs, not just executables. Generally, I mean. | 11:25:39 |
K900 โก๏ธ | https://github.com/NixOS/nixpkgs/pull/256292 | 11:28:04 |
K900 โก๏ธ | OK I just deleted like half the firefox-bin expression | 11:28:14 |
K900 โก๏ธ | And it still works | 11:28:16 |
K900 โก๏ธ | Now let's see if this also works with Nightly | 11:31:42 |
| * nbp will not ask about GPU support โฆ | 11:33:11 |
K900 โก๏ธ | Nope, still crashes | 11:39:37 |
K900 โก๏ธ | In reply to@nbp:mozilla.org will not ask about GPU support โฆ It does work | 11:39:41 |
K900 โก๏ธ |  Download image.png | 11:40:52 |
K900 โก๏ธ | [GFX1-]: glxtest: libpci missing | 11:40:57 |
K900 โก๏ธ | Does say this | 11:40:59 |
K900 โก๏ธ | I wonder if it'll stop if I just add it | 11:41:03 |