1
0
mirror of https://github.com/natnat-mc/moonbuild synced 2026-05-28 18:49:40 +02:00

8 Commits

Author SHA1 Message Date
Codinget 77f73f3a21 Producing rockspec 2.1.3-1 2020-11-12 18:07:00 +01:00
Codinget 31fcc58ccd fix freeze with -j and sync targets 2020-11-12 18:06:41 +01:00
Codinget fcf7c3fa07 Producing rockspec 2.1.2-2 2020-11-09 19:53:43 +01:00
Codinget 88a8117f06 Producing rockspec 2.1.2-1 2020-11-09 19:53:14 +01:00
Codinget 69e781bc8f fix crash when multiple targets depend on the same target 2020-11-09 19:53:05 +01:00
Codinget ee0d76db98 Producing rockspec 2.1.1-1 2020-11-08 00:53:45 +01:00
Codinget 6a6334fc78 actually honor sync requests 2020-11-08 00:53:32 +01:00
Codinget e5bd85933a Producing rockspec 2.1.0-3 2020-11-08 00:45:59 +01:00
8 changed files with 155 additions and 2 deletions
+8 -1
View File
@@ -12,6 +12,8 @@ nodepriority = (a, b) ->
tb = type b.name tb = type b.name
da = #a.deps da = #a.deps
db = #b.deps db = #b.deps
sa = a.sync
sb = b.sync
if ta=='string' and tb!='string' if ta=='string' and tb!='string'
return true return true
elseif ta!='string' and tb=='string' elseif ta!='string' and tb=='string'
@@ -20,6 +22,10 @@ nodepriority = (a, b) ->
return true return true
elseif a.priority < b.priority elseif a.priority < b.priority
return false return false
elseif sa and not sb
return false
elseif sb and not sa
return true
else else
return da < db return da < db
@@ -28,6 +34,7 @@ transclosure = (obj, prop) ->
i = 1 i = 1
set = {} set = {}
imp = (e) -> imp = (e) ->
return unless e[prop]
for v in *e[prop] for v in *e[prop]
if not set[v] if not set[v]
elems[i], i = v, i+1 elems[i], i = v, i+1
@@ -116,7 +123,7 @@ class DepNode
return false return false
for file in *@ins for file in *@ins
if not exists file if not exists file
error "Node #{name} has ran all of its parents, but can't run since #{file} doesn't exist" error "Node #{@name} has ran all of its parents, but can't run since #{file} doesn't exist. Did you mean to use after instead of depends?"
return true return true
build: (opts={}) => build: (opts={}) =>
+8
View File
@@ -37,6 +37,14 @@ class Executor
error "Node #{name} wasn't built" unless node.built error "Node #{name} wasn't built" unless node.built
addprocess: (node, opts) => addprocess: (node, opts) =>
if node.sync
while @nprocesses != 0
@waitprocess!
node\build opts
node.built = true
node\updatecache!
return
pid = fork! pid = fork!
error "Failed to fork" unless pid error "Failed to fork" unless pid
if pid!=0 if pid!=0
+19 -1
View File
@@ -1670,6 +1670,8 @@ nodepriority = function(a, b)
local tb = type(b.name) local tb = type(b.name)
local da = #a.deps local da = #a.deps
local db = #b.deps local db = #b.deps
local sa = a.sync
local sb = b.sync
if ta == 'string' and tb ~= 'string' then if ta == 'string' and tb ~= 'string' then
return true return true
elseif ta ~= 'string' and tb == 'string' then elseif ta ~= 'string' and tb == 'string' then
@@ -1678,6 +1680,10 @@ nodepriority = function(a, b)
return true return true
elseif a.priority < b.priority then elseif a.priority < b.priority then
return false return false
elseif sa and not sb then
return false
elseif sb and not sa then
return true
else else
return da < db return da < db
end end
@@ -1689,6 +1695,9 @@ transclosure = function(obj, prop)
local set = { } local set = { }
local imp local imp
imp = function(e) imp = function(e)
if not (e[prop]) then
return
end
local _list_0 = e[prop] local _list_0 = e[prop]
for _index_0 = 1, #_list_0 do for _index_0 = 1, #_list_0 do
local v = _list_0[_index_0] local v = _list_0[_index_0]
@@ -1812,7 +1821,7 @@ do
for _index_0 = 1, #_list_1 do for _index_0 = 1, #_list_1 do
local file = _list_1[_index_0] local file = _list_1[_index_0]
if not exists(file) then if not exists(file) then
error("Node " .. tostring(name) .. " has ran all of its parents, but can't run since " .. tostring(file) .. " doesn't exist") error("Node " .. tostring(self.name) .. " has ran all of its parents, but can't run since " .. tostring(file) .. " doesn't exist. Did you mean to use after instead of depends?")
end end
end end
return true return true
@@ -2248,6 +2257,15 @@ do
end end
end, end,
addprocess = function(self, node, opts) addprocess = function(self, node, opts)
if node.sync then
while self.nprocesses ~= 0 do
self:waitprocess()
end
node:build(opts)
node.built = true
node:updatecache()
return
end
local pid = fork() local pid = fork()
if not (pid) then if not (pid) then
error("Failed to fork") error("Failed to fork")
+24
View File
@@ -0,0 +1,24 @@
build = {
install = {
bin = {
moonbuild = "out/moonbuild"
}
},
type = "builtin"
}
dependencies = {
"lua >= 5.1",
"argparse >= 0.7.1-1",
"moonscript >= 0.5.0-1"
}
description = {
detailed = "moonbuild is a small build system that simplifies your build definitions by allowing you to use declarative as well as imperative rules. It represents the build as a DAG with explicit ordering, and doesn't give you any default confusing rules (unlike make). If you can, installing luaposix and/or luafilesystem will speed up builds and increase stability.\n",
summary = "Small build system in between make and a build.sh"
}
package = "moonbuild"
rockspec_format = "3.0"
source = {
tag = "v2.1.0",
url = "git://github.com/natnat-mc/moonbuild"
}
version = "2.1.0-3"
+24
View File
@@ -0,0 +1,24 @@
build = {
install = {
bin = {
moonbuild = "out/moonbuild"
}
},
type = "builtin"
}
dependencies = {
"lua >= 5.1",
"argparse >= 0.7.1-1",
"moonscript >= 0.5.0-1"
}
description = {
detailed = "moonbuild is a small build system that simplifies your build definitions by allowing you to use declarative as well as imperative rules. It represents the build as a DAG with explicit ordering, and doesn't give you any default confusing rules (unlike make). If you can, installing luaposix and/or luafilesystem will speed up builds and increase stability.\n",
summary = "Small build system in between make and a build.sh"
}
package = "moonbuild"
rockspec_format = "3.0"
source = {
tag = "v2.1.1",
url = "git://github.com/natnat-mc/moonbuild"
}
version = "2.1.1-1"
+24
View File
@@ -0,0 +1,24 @@
build = {
install = {
bin = {
moonbuild = "out/moonbuild"
}
},
type = "builtin"
}
dependencies = {
"lua >= 5.1",
"argparse >= 0.7.1-1",
"moonscript >= 0.5.0-1"
}
description = {
detailed = "moonbuild is a small build system that simplifies your build definitions by allowing you to use declarative as well as imperative rules. It represents the build as a DAG with explicit ordering, and doesn't give you any default confusing rules (unlike make). If you can, installing luaposix and/or luafilesystem will speed up builds and increase stability.\n",
summary = "Small build system in between make and a build.sh"
}
package = "moonbuild"
rockspec_format = "3.0"
source = {
tag = "v2.1.2",
url = "git://github.com/natnat-mc/moonbuild"
}
version = "2.1.2-1"
+24
View File
@@ -0,0 +1,24 @@
build = {
install = {
bin = {
moonbuild = "out/moonbuild"
}
},
type = "builtin"
}
dependencies = {
"lua >= 5.1",
"argparse >= 0.7.1-1",
"moonscript >= 0.5.0-1"
}
description = {
detailed = "moonbuild is a small build system that simplifies your build definitions by allowing you to use declarative as well as imperative rules. It represents the build as a DAG with explicit ordering, and doesn't give you any default confusing rules (unlike make). If you can, installing luaposix and/or luafilesystem will speed up builds and increase stability.\n",
summary = "Small build system in between make and a build.sh"
}
package = "moonbuild"
rockspec_format = "3.0"
source = {
tag = "v2.1.2",
url = "git://github.com/natnat-mc/moonbuild"
}
version = "2.1.2-2"
+24
View File
@@ -0,0 +1,24 @@
build = {
install = {
bin = {
moonbuild = "out/moonbuild"
}
},
type = "builtin"
}
dependencies = {
"lua >= 5.1",
"argparse >= 0.7.1-1",
"moonscript >= 0.5.0-1"
}
description = {
detailed = "moonbuild is a small build system that simplifies your build definitions by allowing you to use declarative as well as imperative rules. It represents the build as a DAG with explicit ordering, and doesn't give you any default confusing rules (unlike make). If you can, installing luaposix and/or luafilesystem will speed up builds and increase stability.\n",
summary = "Small build system in between make and a build.sh"
}
package = "moonbuild"
rockspec_format = "3.0"
source = {
tag = "v2.1.3",
url = "git://github.com/natnat-mc/moonbuild"
}
version = "2.1.3-1"