Skip to content
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

new build on save with watch mode #2096

Merged
merged 31 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e01e45d
set minimum runtime version to `0.14.0-dev.2046+b8795b4d0`
Techatrix Nov 26, 2024
8f3d67e
remove old Zig version compatibility from build runner
Techatrix Nov 13, 2024
3979eb0
change BuildConfig.zig to shared.zig
Techatrix Nov 26, 2024
47b2fd0
move ZCS logic into build_runner/shared.zig
Techatrix Nov 26, 2024
82bef30
remove the current build-on-save implementation
Techatrix Nov 26, 2024
f553680
store diagnostics in a separate container
Techatrix Nov 28, 2024
a1e195c
server error bundles through the build runner
Techatrix Nov 27, 2024
51d93d7
add missig fincremental flag to build runner
Techatrix Nov 28, 2024
64bc566
remove bad call to std.process.Child.kill
Techatrix Nov 28, 2024
cd148cc
add a "check" step
Techatrix Nov 28, 2024
fcc2a3c
improve some configuration log messages
Techatrix Nov 28, 2024
bdfd144
implement build-on-save with --watch
Techatrix Nov 29, 2024
050ca30
check whether the operating system supports --watch
Techatrix Nov 29, 2024
a3f3733
defer build-on-save initialization until after workspace configuratio…
Techatrix Nov 29, 2024
b6c195a
windows or whatever
Techatrix Nov 29, 2024
f909262
publish cImport diagnostics using error bundles
Techatrix Dec 1, 2024
bc2778d
handle missing source line in error bundle source locations
Techatrix Dec 1, 2024
76da7a2
more DiagnosticsCollection test coverage
Techatrix Dec 1, 2024
2b862db
update some configuration log message checks
Techatrix Dec 3, 2024
a490392
fix a bug where build on save wouldn't start if there is new workspac…
Techatrix Dec 3, 2024
1b23c83
set default offset encoding for DiagnosticsCollection.zig
Techatrix Dec 3, 2024
adeb618
Add back the std.build.Watch check for Linux pre 5.17
Techatrix Dec 5, 2024
e7de3c5
send step id in build runner to differentiate error between steps
Techatrix Dec 5, 2024
4812549
report stderr when build on save runner exits early
Techatrix Dec 5, 2024
2fd1502
remove invalid free
Techatrix Dec 6, 2024
3ba30bf
implement runtime zig version detection for build on save
Techatrix Dec 9, 2024
0927d16
set minimum runtime version to `0.14.0-dev.310+9d38e82b5`
Techatrix Dec 9, 2024
86c0d4d
CI: check build runner against mach-latest
Techatrix Dec 11, 2024
e390f5c
cleanup build runner process error handling
Techatrix Dec 15, 2024
81bc1fb
minor build on save runner tweaks
Techatrix Dec 19, 2024
3ee022a
improve wording of message when using an incompatible Zig version
Techatrix Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/build_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ jobs:
fail-fast: false
matrix:
include:
- zig-version: mach-latest
build-runner-file: master.zig
- zig-version: master
build-runner-file: 0.12.0.zig
- zig-version: 0.13.0
build-runner-file: 0.12.0.zig # The Zig 0.12.0 build runner is also compatible with Zig 0.13.0
- zig-version: 0.12.0
build-runner-file: 0.12.0.zig
build-runner-file: master.zig
runs-on: ubuntu-latest

steps:
Expand Down
25 changes: 23 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ const zls_version = std.SemanticVersion{ .major = 0, .minor = 14, .patch = 0, .p
const minimum_build_zig_version = "0.14.0-dev.2472+cc82620b2";

/// Specify the minimum Zig version that is required to run ZLS:
/// Release 0.12.0
/// make zig compiler processes live across rebuilds
///
/// Examples of reasons that would cause the minimum runtime version to be bumped are:
/// - breaking change to the Zig Syntax
/// - breaking change to AstGen (i.e `zig ast-check`)
///
/// A breaking change to the Zig Build System should be handled by updating ZLS's build runner (see src\build_runner)
const minimum_runtime_zig_version = "0.12.0";
const minimum_runtime_zig_version = "0.14.0-dev.310+9d38e82b5";

const release_targets = [_]std.Target.Query{
.{ .cpu_arch = .x86_64, .os_tag = .windows },
Expand Down Expand Up @@ -179,6 +179,25 @@ pub fn build(b: *Build) !void {
exe.root_module.addImport("zls", zls_module);
b.installArtifact(exe);

{
const exe_check = b.addExecutable(.{
.name = "zls",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
.single_threaded = single_threaded,
});
exe_check.root_module.addImport("exe_options", exe_options_module);
exe_check.root_module.addImport("tracy", tracy_module);
exe_check.root_module.addImport("diffz", diffz_module);
exe_check.root_module.addImport("lsp", lsp_module);
exe_check.root_module.addImport("known-folders", known_folders_module);
exe_check.root_module.addImport("zls", zls_module);

const check = b.step("check", "Check if ZLS compiles");
check.dependOn(&exe_check.step);
}

const test_step = b.step("test", "Run all the tests");

const tests = b.addTest(.{
Expand Down Expand Up @@ -485,6 +504,8 @@ fn release(b: *Build, target_queries: []const std.Target.Query, release_artifact
}

const Build = blk: {
@setEvalBranchQuota(10_000);

const min_build_zig = std.SemanticVersion.parse(minimum_build_zig_version) catch unreachable;
const min_runtime_zig = std.SemanticVersion.parse(minimum_runtime_zig_version) catch unreachable;

Expand Down
Loading
Loading