#Build fails when pulling a Git repository from Codeberg, but using Git `clone` manually works fine

1 messages · Page 1 of 1 (latest)

tired sundial
#

I get the error message unrecognized 'Content-Type' header: 'text/html; charset=utf-8' when using a Codeberg *.git link. Is this behaviour known?

#

I tried looking it up but haven't found anything about it

mental fiber
#

what is the non manual way you are doing it? zig fetch? can you send the command/build.zig.zon

tired sundial
#

I am running zig build with the following build.zig.zon:

.{
        .name = .my_game,
        .version = "0.0.1",
        .minimum_zig_version = "0.15.2",
        .fingerprint = 0xe30c18d87ca58a54,

        .paths = .{
                "build.zig",
                "build.zig.zon",
                "src/*",
        },

        .dependencies = .{
                .sdl3 = .{
                        .url = "https://codeberg.org/7Games/zig-sdl3.git"
                }
        },
}
#

I found an issue in the Zig GitHub that mentions something like this - that a request to Codeberg fails, but only if you don't specify a Host:* correctly?

GitHub

Zig Version 0.12.0-dev.3633+f7a76bdfe Steps to Reproduce and Observed Behavior Works with 0.12.0-dev.3610+9d27f34d0, no longer works with 0.12.0-dev.3633+f7a76bdfe. Possibly related to #19500? (cc ...

mental fiber
#

you need git+https://......
also use zig fetch --save git+https://..., that will resolve a better url that points to a specific commit.
the one you have will just point to the latest commit in the default branch, which means the next time you clear your cache causing zig to refetch it, you will get a different version that will break your build.
zig will catch that though and give you a useful error message.

tired sundial
#

would the links in the tags page that link to *.tar.gz files work?

mental fiber
#

yes, but dont use the git+... in that case.
better yet, use zig fetch --save git+https://....#tagorbranchname

tired sundial
#

so something like zig fetch --save "https://codeberg.org/7Games/zig-sdl3/archive/v0.1.9.tar.gz#v0.1.9"? the # is just a way to point out the tag and has no actual function since it just highlights right?

mental fiber
#

i dont know if its actually better, probably doesnt matter. my brain just prefers going via git.
at least you know what zig fetch can do

mental fiber
tired sundial
#

ahh I see

mental fiber
#

on further thought, the git one is better, since it gives a commit which practically cant be deleted (they can its just difficult, and not at all recomended)
but a tag can be deleted (still not recomended, but its too easy to do)