-
-
Notifications
You must be signed in to change notification settings - Fork 28
Move build system to zig build #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I ran into an issue with the latest Zig from Homebrew (which is the latest Zig release afaik):
|
4e59ad6
to
c1fbe47
Compare
bb83a46
to
7363572
Compare
Now that zig |
7edd710
to
a8b6045
Compare
a8b6045
to
c02c6c1
Compare
544ae1a
to
c25f3f9
Compare
37346b8
to
a890631
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few tweaks but lookin good otherwise
* This change introduces a new build system leveraging the Zig toolchain. With these changes, the orcadev workflow is deprecated, though the scripts are left in for now as a reference, and because there is still one python dependency left in the repo (generating GLES binding json). Some immediate benefits of the change: * Caching of intermediate artifacts - speeds up the build time for iterative builds. * Dependency tracking - don't have to worry about remembering to build specific dependencies for a given library. * Wasm support - no need to manually install the wasm compiler_rt builtins * Single compiler used for all builds - drops MSVC on windows * Avoids annoying issues with brew vs apple versions of clang on macos * --watch flag that watches for changes to any input files and rebuilds dependent artifacts * Removes angle/dawn builds in favor of leveraging the zig package manager to download platform- appropriate artfiacts from angle/dawn repos in the orca github org. This reduces a lot of complexity in the build system and lets us remove all related files and CI jobs. * Fixed a bunch of UBsan errors in C code * CI now builds and runs tests by default (disabled on windows for now) * CI now builds sketches by default to avoid further bitrotting * Checked in generated/copied files such as shader header, wasm-C bindings, GL header
a890631
to
242778c
Compare
* addStatic/addShared library -> addLibrary * unmanaged arraylist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs some fixes when cross compiling
…s, formatting changes Switched all calls of addExecutable/Library to use `.root_modue = b.createModule(.{...}),`. Switched target of build-time scripts to use the host target (including python). Switched unecessarily mutable variables to `const`. Not sure why these weren't compile errors. Reformatted some declarations (`const foo = Bar{} -> const foo: Bar = .{}`).
…mits. - The angle one also fixes the LC_ID_DYLIB name of the angle libs to use @rpath. - Remove some unneeded AddRPath calls from build.zig - Copy the orca-libc headers when packaging the sdk
a45ff73
to
f99f2a0
Compare
…rpath, to workaround rpath zig build issues (see ziglang/zig#24349)
* not needed now that we're checking in the generated files
* the GLES api very rarely changes, so we'll just checkin the .json file so it's always available * this also removes the last Python dependency
Closes #25. This change ports the python-based
orcadev
build system to build.zig. Some immediate benefits:--watch
flag that watches for changes to any input files and rebuilds dependent artifactsThere are a few guiding design principles for this change:
orcadev
and the locations of build artifact outputs as much as possible.zig build XXX
should just work on any system, regardless of system-installed dependencies. For example, if we require python to be present for part of the build, the build system should ensure a compatible version to be installed so the user doesn't have to, such as via build.zig.zon.Note that this is a draft and there still remains a bunch of work to be done before this can go in. Namely:
zig build
to runzig build orca-install
by defaultorca
executable in PATH if--sdk-dir
is supplied tozig build orca-install
orcabuild
->zig build
zig build test
Followup tasks for after this change goes in: