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.
Hey. I noticed some inconsistency in the handling of C dependencies:
glibandexpatare installed as system packages;v8is downloaded inbuild.zigbut it is built in a dedicated task;iconvis downloaded (from a fork) in the Makefile;iconv/mimalloc/netsurfis built using the officialmake/cmake;ada/curl/mbedtlsare 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
gccwas 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.zonand building with the system tooling (addSystemCommand, which runsmake/cmake).Here's what it might look like:
linkLibraryso that zig can handle dependencies;zig ccis always used;zig buildon 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.