You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The primary use of Zig is as the low level build system for Acton. The Acton compiler reads .act files and outputs C code. We use build.zig to compile that C code to libraries / executable binaries. It links with a number of C libraries shipped with the Acton base system (builtins, run time systems etc depends on things like libuv, Boehm GC ect).
One day we might very well output Zig code instead of C from the Acton compiler but that probably requires Zig to mature a bit first.
Acton uses a single zig cache in ~/.cache/acton which is automatically cleared when it hits an upper threshold. The next build after that will be rather slow since it has to rebuild the Acton base system (builtins, RTS, stdlib) and external C libraries from scratch
we work around it by adding in the missing headers ourselves in the deps/zig-extras directory
A bit of background on Acton use of Zig
Acton projects are arranged as a Zig project with a conceptual build.zig. Since all Acton projects follow a common form, the build.zig is actually built into an executable binary ahead of time and shipped together with the acton compiler. Thus you won't find the actual build.zig in an Acton project. We call our compiled build.zig builder. Once actonc (the Acton compiler) has outputted C files, actonc will invoke builder, providing some arguments and point to the correct folder to work in. Most dynamic things, like the list of C files, are discovered by builder by crawling the file system (actonc writes C files to e.g. out/types/foo.c in the acton project folder).
All Acton projects consist of sources from at least two locations:
the local project
acton base, e.g. builtins, stdlib, RTS
builder supports two "modes" of compilation, one based on prebuilt libraries and the other is building from source.
this is required to fix compilation of some of our external C libraries
like libuuid has src/uuid.h which is copied to include/uuid/uuid.h on build
our code expects to #include <uuid/uuid.h> and so libuuid must be built and installed
with this PR, we don't need to build&install libuuid but can just list it as a build.zig dependency
this in turn enables us to only ship the source code in the Acton distribution and let the full build happen when the user invokes acton build the first time, very cool!
The text was updated successfully, but these errors were encountered:
Our wish list for the upstream Zig project.
The primary use of Zig is as the low level build system for Acton. The Acton compiler reads .act files and outputs C code. We use build.zig to compile that C code to libraries / executable binaries. It links with a number of C libraries shipped with the Acton base system (builtins, run time systems etc depends on things like libuv, Boehm GC ect).
One day we might very well output Zig code instead of C from the Acton compiler but that probably requires Zig to mature a bit first.
build
(zig upstream issue!?) #1873~/.cache/acton
which is automatically cleared when it hits an upper threshold. The next build after that will be rather slow since it has to rebuild the Acton base system (builtins, RTS, stdlib) and external C libraries from scratchA bit of background on Acton use of Zig
Acton projects are arranged as a Zig project with a conceptual build.zig. Since all Acton projects follow a common form, the build.zig is actually built into an executable binary ahead of time and shipped together with the acton compiler. Thus you won't find the actual build.zig in an Acton project. We call our compiled build.zig
builder
. Onceactonc
(the Acton compiler) has outputted C files,actonc
will invokebuilder
, providing some arguments and point to the correct folder to work in. Most dynamic things, like the list of C files, are discovered by builder by crawling the file system (actonc
writes C files to e.g.out/types/foo.c
in the acton project folder).All Acton projects consist of sources from at least two locations:
builder
supports two "modes" of compilation, one based on prebuilt libraries and the other is building from source.Completed items
Compile.installHeader
behavior, addWriteFile.addCopyDirectory
ziglang/zig#19167#include <uuid/uuid.h>
and so libuuid must be built and installedacton build
the first time, very cool!The text was updated successfully, but these errors were encountered: