1
0
mirror of https://github.com/natnat-mc/moonbuild synced 2026-05-29 01:39:41 +02:00

3 Commits

Author SHA1 Message Date
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
5 changed files with 77 additions and 0 deletions
+6
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
+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
+15
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
@@ -2248,6 +2254,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
local _ = 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"