I’m trying to package up rhine for the new river compositor and I’m running into an issue trying to pull zig dependencies from Codeberg.
No matter what method I use, either zon2nix or zig.deps, I end up getting the exact same build errors
error: builder for '/nix/store/y3hsr67y7awsvsh6xf36hsw3z3gs6w7q-rhine-0.3.0.drv' failed with exit code 1;
last 19 log lines:
> Using versionCheckHook
> Running phase: unpackPhase
> unpacking source archive /nix/store/jvd75z1h0ys2rd4b7xw7jqiblii7cida-source
> source root is source
> Running phase: patchPhase
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> Running phase: buildPhase
> zig build flags: -j16 -Dcpu=baseline --release=safe
> /build/source/build.zig.zon:8:20: error: unable to connect to server: NameServerFailure
> .url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.6.0.tar.gz",
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /build/source/build.zig.zon:12:20: error: unable to connect to server: NameServerFailure
> .url = "https://codeberg.org/Games-by-Mason/mr_tween/archive/v0.1.0.tar.gz",
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /build/source/build.zig.zon:16:20: error: unable to discover remote git server capabilities: NameServerFailure
> .url = "git+https://codeberg.org/Sivecano/libtributary#ad5ee12ecae34c6aac55c55eeffce50f85cb3856",
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
For full logs, run:
nix log /nix/store/y3hsr67y7awsvsh6xf36hsw3z3gs6w7q-rhine-0.3.0.drv
Here’s my (very rough) package.nix
{
lib,
pkgs,
...
}:
pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "rhine";
version = "0.3.0";
strictDeps = true;
src = pkgs.fetchFromCodeberg {
#url = "https://codeberg.org/Sivecano/rhine/archive/${finalAttrs.version}.tar.gz";
#hash = "sha256-1urSOudD12Ge/hy3mGFfGNQAKLjqvuyV+cO1T4HloYs=";
owner = "Sivecano";
repo = "rhine";
tag = finalAttrs.version;
hash = "sha256-1urSOudD12Ge/hy3mGFfGNQAKLjqvuyV+cO1T4HloYs=";
};
nativeBuildInputs = with pkgs; [
zig_0_16
pkg-config
];
buildInputs = with pkgs; [
wayland-scanner
river
libxkbcommon
wayland
dbus
wayland-protocols
];
zigDeps = pkgs.zig_0_16.fetchDeps {
inherit (finalAttrs) src pname version;
hash = "sha256-wvnECiDfK17uKGySe2SYEkpHL0RdRQTlS+b8zGw2F9g=";
};
postConfigure = ''
ln -s ${finalAttrs.zigDeps} $ZIG_GLOBAL_CACHE_DIR/p
'';
nativeInstallCheckInputs = with pkgs; [versionCheckHook];
versionCheckProgramArg = "-version";
postInstall = ''
install rhine.desktop -Dt $out/share/wayland-sessions
'';
doCheck = true;
doInstallCheck = true;
})
And, although this exact package doesn’t utilize it, this is what my build.zon.nix file looks like when I decide to use zon2nix
# generated by zon2nix (https://github.com/nix-community/zon2nix)
{ linkFarm, fetchzip, fetchgit }:
linkFarm "zig-packages" [
{
name = "mr_tween-0.1.0-WbH78YcBAQD3RF4QfCYFF6EJCYzAzdIU4BHCj0pFI5yq";
path = fetchzip {
url = "https://codeberg.org/Games-by-Mason/mr_tween/archive/v0.1.0.tar.gz";
hash = "sha256-+f3klYdTikb7qoggebyOET+xHH9IuZt78MQTfpJOZjM=";
extension = "tar.gz";
};
}
{
name = "tributary-0.4.0-tqCfW5fFAAC_PBxqMMwGJRlbwU8XThn9b2zIieRvQgDX";
path = fetchgit {
url = "https://codeberg.org/Sivecano/libtributary";
rev = "ad5ee12ecae34c6aac55c55eeffce50f85cb3856";
hash = "sha256-PKtVtnUbfjOkAkYOaUCaMgAT/2rplMxFESgKNL9DFJk=";
};
}
{
name = "wayland-0.6.0-lQa1kqz8AQADQmdNJsNhLoNHcnEGEUjrOaPV-dtEnEmX";
path = fetchzip {
url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.6.0.tar.gz";
hash = "sha256-3m/ITNhZUJ/5uD/Tqm+0uZSktGoYgWF5oldOqOCUkIE=";
extension = "tar.gz";
};
}
]
I tacked on the extension key for the zip archives after reading though this issue which also cued me into zig.fetchDeps. I also read this discourse thread discussing the current packaging workflow for zig, which gave me the resources for trying a few different dependency management methods, neither of which have worked.
After researching, I’m thoroughly convinced that this is a Codeberg issue (maybe too much bot prevention?). Am I missing something here that would make fetching these tarballs simply impossible using my current setup? Any help is appreciated.