strip trailing slashes in DEBUGINFOD_URLS#2
Conversation
|
@Feyorsh thank you! |
|
@Feyorsh |
|
Oh nice, is that using Also unrelated, do you maybe want to add a snippet for using debuginfod-zig with Nix to the README? (I'm using it in my CTF flake, I'm sure there's probably a better way to do that though lol) |
didn't know it exists 🙉 We just develop version in golang that downloads debuginfo+nar from cache.nixos.org, converts .nar to .erofs, etc.. 😆 But it not yet open sourced, maybe in few months when I will have more time. |
Right. Probably something like should work (added to readme): {
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
debuginfod-zig.url = "github:pwndbg/debuginfod-zig";
};
outputs =
inputs@{
self,
nixpkgs,
debuginfod-zig,
...
}:
let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
fun_pkgs =
system:
import nixpkgs {
inherit system;
overlays = [
debuginfod-zig.overlays.default
(final: prev: {
gdb-with-debuginfod = (prev.gdb.override { enableDebuginfod = false; }).overrideAttrs( old: {
buildInputs = (old.buildInputs or []) ++ [
prev.libdebuginfod-zig-static
];
configureFlags = (old.configureFlags or []) ++ [
"--with-debuginfod=yes"
];
});
})
];
};
in
{
packages = forAllSystems (
system:
let
pkgs = (fun_pkgs system);
in
{
gdb-with-debuginfod = pkgs.gdb-with-debuginfod;
}
);
};
} |
A trailing slash in a url in
DEBUGINFOD_URLS(the default on e.g. Fedora) causes the path to be completely ignored, resulting in a query returning nothing of value.And the contents of
~/.cache/debuginfod_client/265d92b5d001e68fc815c0716b5d6bd23124fe37/debuginfoisdebuginfod (elfutils) 0.194instead of the expected debuginfo (in this case specifically it should actually returnwarning(debuginfod_zig): findDebuginfo err: error.FetchStatusNotFoundbecause the elfutils server does not have symbols for this build-id).A simpler demonstration of the issue with curl: