-
Notifications
You must be signed in to change notification settings - Fork 470
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
build: orthonormalize the interface #2033
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matklad
force-pushed
the
matklad/build-better
branch
2 times, most recently
from
June 20, 2024 12:51
5b1d51f
to
f333e86
Compare
Closes the remaining 80% of #1280 |
matklad
force-pushed
the
matklad/build-better
branch
3 times, most recently
from
June 25, 2024 15:43
d7b8c03
to
5501d85
Compare
matklad
force-pushed
the
matklad/build-better
branch
6 times, most recently
from
June 25, 2024 16:40
ac23cbc
to
a2b297d
Compare
matklad
force-pushed
the
matklad/build-better
branch
4 times, most recently
from
June 26, 2024 14:19
d3d639c
to
78e554d
Compare
matklad
force-pushed
the
matklad/build-better
branch
from
June 27, 2024 14:04
78e554d
to
d9ecf60
Compare
batiati
reviewed
Jun 28, 2024
build.zig
Outdated
.clients_java = b.step("clients:java", "Build Java client shared library"), | ||
.clients_node = b.step("clients:node", "Build Node client shared library"), | ||
.fuzz = b.step("fuzz", "Run non-VOPR fuzzers"), | ||
.fuzz_build = b.step("fuzz:build", "Run non-VOPR fuzzers"), |
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.
s/run/build
Refactor build.zig to make the interface easier to remember and the implementation somewhat easier to follow. Many step names changed to follow `step`/ `step:substep` pattern, with top-level `step` being the primary interface. Main steps: * `zig build` builds TigerBeetle to `./src/tigerbeetle[.exe]`, no changes here. * `zig build check` quickly check for compilation errors. No changes here, but now we can introduce `zig build vopr:check` in a clean way. * `zig build run` run TigerBeetle, no changes here. * `zig build scripts` -- free-form release automation, no changes here. * `zig build test`, `zig build test:unit`, `zig build test:integration`, `zig build test:fmt` runs various tests. * `zig build fuzz`, `zig build fuzz:build` run or just build minor fuzzers * `zig build vopr`, `zig build vopr:build` run or just build the simulator * `zig build client:{c,node,java,dotnet,go}` -- build corresponding native libraries. Odd steps which I'd love to get rid off, but which don't really fit anywhere else: * `zig build aof` for running the aof utility * `zig build clients:c:sample` for checking C sample * `zig build test:jni` for running JNI tests. These have a dependency on JAVA_HOME, so they are _not_ being run by default. The main implementation change is that all build steps and options are pre-declared at the top of the file, so you can see the entire interface at a glance (got the idea from https://ziggit.dev/t/build-system-tricks/3531) Closes: #1280
This builds on top of #2044 * print generated file to stdout, to avoid the need to parse cli arguments. That's the UNIX way -- let the caller to redirect the output whenever they need it! * Motivate why we need our own InstallStep, and rename it to CopyFile to avoid confusion with build-in install.
matklad
force-pushed
the
matklad/build-better
branch
from
July 1, 2024 12:20
d9ecf60
to
e68cacc
Compare
batiati
approved these changes
Jul 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor build.zig to make the interface easier to remember and the
implementation somewhat easier to follow.
Many step names changed to follow
step
/step:substep
pattern, withtop-level
step
being the primary interface.Main steps:
zig build
builds TigerBeetle to./src/tigerbeetle[.exe]
, nochanges here.
zig build check
quickly check for compilation errors. No changeshere, but now we can introduce
zig build vopr:check
in a clean way.zig build run
run TigerBeetle, no changes here.zig build scripts
-- free-form release automation, no changes here.zig build test
,zig build test:unit
,zig build test:integration
,zig build test:fmt
runs various tests.zig build fuzz
,zig build fuzz:build
run or just build minor fuzzerszig build vopr
,zig build vopr:build
run or just build the simulatorzig build client:{c,node,java,dotnet,go}
-- build correspondingnative libraries.
Odd steps which I'd love to get rid off, but which don't really fit
anywhere else:
zig build aof
for running the aof utilityzig build clients:c:sample
for checking C samplezig build test:jni
for running JNI tests. These have a dependency onJAVA_HOME, so they are not being run by default.
The main implementation change is that all build steps and options are
pre-declared at the top of the file, so you can see the entire interface
at a glance (got the idea from https://ziggit.dev/t/build-system-tricks/3531)
Closes: #1280