Skip to content

Commit 3b85c5d

Browse files
committed
Make all Lua deps lazy
Now only the required version of Lua will be fetched by the package manager!
1 parent 4a5f946 commit 3b85c5d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

build.zig

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ pub fn build(b: *Build) void {
2222
const lang = b.option(Language, "lang", "Lua language version to build") orelse .lua54;
2323
const shared = b.option(bool, "shared", "Build shared library instead of static") orelse false;
2424
const luau_use_4_vector = b.option(bool, "luau_use_4_vector", "Build Luau to use 4-vectors instead of the default 3-vector.") orelse false;
25-
const upstream = b.dependency(@tagName(lang), .{});
25+
26+
const upstream = b.lazyDependency(@tagName(lang), .{}) orelse return;
2627

2728
if (lang == .luau and shared) {
2829
std.debug.panic("Luau does not support compiling or loading shared modules", .{});

build.zig.zon

+6
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,37 @@
1212
.lua51 = .{
1313
.url = "https://github.com/natecraddock/lua/archive/refs/tags/5.1.5-1.tar.gz",
1414
.hash = "12203fe1feebb81635f8df5a5a7242733e441fe3f3043989c8e6b4d6720e96988813",
15+
.lazy = true,
1516
},
1617

1718
.lua52 = .{
1819
.url = "https://www.lua.org/ftp/lua-5.2.4.tar.gz",
1920
.hash = "1220d5b2b39738f0644d9ed5b7431973f1a16b937ef86d4cf85887ef3e9fda7a3379",
21+
.lazy = true,
2022
},
2123

2224
.lua53 = .{
2325
.url = "https://www.lua.org/ftp/lua-5.3.6.tar.gz",
2426
.hash = "1220937a223531ef6b3fea8f653dc135310b0e84805e7efa148870191f5ab915c828",
27+
.lazy = true,
2528
},
2629

2730
.lua54 = .{
2831
.url = "https://www.lua.org/ftp/lua-5.4.6.tar.gz",
2932
.hash = "1220f93ada1fa077ab096bf88a5b159ad421dbf6a478edec78ddb186d0c21d3476d9",
33+
.lazy = true,
3034
},
3135

3236
.luajit = .{
3337
.url = "https://github.com/LuaJIT/LuaJIT/archive/c525bcb9024510cad9e170e12b6209aedb330f83.tar.gz",
3438
.hash = "1220ae2d84cfcc2a7aa670661491f21bbed102d335de18ce7d36866640fd9dfcc33a",
39+
.lazy = true,
3540
},
3641

3742
.luau = .{
3843
.url = "https://github.com/luau-lang/luau/archive/refs/tags/0.607.tar.gz",
3944
.hash = "122003818ff2aa912db37d4bbda314ff9ff70d03d9243af4b639490be98e2bfa7cb6",
45+
.lazy = true,
4046
},
4147
},
4248
}

0 commit comments

Comments
 (0)