Skip to content

Hermetic builds #1179

@mrdimidium

Description

@mrdimidium

Hey. I noticed some inconsistency in the handling of C dependencies:

  • glib and expat are installed as system packages;
  • v8 is downloaded in build.zig but it is built in a dedicated task;
  • iconv is downloaded (from a fork) in the Makefile;
  • iconv/mimalloc/netsurf is built using the official make/cmake;
  • ada/curl/mbedtls are built directly from build.zig.

For some dependencies the system clang is used, and for some zig cc, which can also create problems.

I don't think there's a perfect way, but it would be easier if all dependencies were delivered uniformly. For example, I was building a browser on Fedora and encountered a build failure if gcc was installed on the system (unless clang was explicitly specified for make).

What do you think about standardizing this? The simplest solution would be to switch to delivering dependencies through build.zig.zon and building with the system tooling (addSystemCommand, which runs make/cmake).

Here's what it might look like:

  • all dependencies are loaded into build.zig.zon;
  • small libraries are built locally (like libcurl now);
  • complex systems (like netsurf) are built using their official tooling (taking into account the build type, dev/safe, valgrind, etc.);
  • all of this is linked via linkLibrary so that zig can handle dependencies;
  • instead of the system clang, zig cc is always used;
  • building the browser is as simple as running zig build on any system.

In addition to more reliable and reproducible local builds (which would also lower the entry barrier for new contributors), this would significantly simplify packaging the browser in Linux repositories in the future.

Let me know if you are interested in PR on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions