Skip to content

Commit

Permalink
Merge pull request #2096 from zigtools/techatrix/dev
Browse files Browse the repository at this point in the history
new build on save with watch mode
  • Loading branch information
Techatrix authored Dec 20, 2024
2 parents fa650ca + 3ee022a commit f5cd111
Show file tree
Hide file tree
Showing 14 changed files with 1,461 additions and 905 deletions.
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

0 comments on commit f5cd111

Please sign in to comment.