summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-11-27 21:04:36 +0800
committerruki <[email protected]>2019-11-27 00:27:40 +0800
commit45b739d927c89d93d85f626ab77dee70746c1cd3 (patch)
tree13da388ac80cbfa2c57bc0f69b7bf786e4e11379
parent4e7e61681429e7ea13501cae574f88bf90c5900a (diff)
fix trylock and improve stats
-rw-r--r--xmake/actions/build/main.lua6
-rw-r--r--xmake/actions/build/statistics.lua6
-rw-r--r--xmake/core/sandbox/modules/io.lua8
3 files changed, 9 insertions, 11 deletions
diff --git a/xmake/actions/build/main.lua b/xmake/actions/build/main.lua
index 5636a89c0..69a6cc4c6 100644
--- a/xmake/actions/build/main.lua
+++ b/xmake/actions/build/main.lua
@@ -38,6 +38,9 @@ function main()
return trybuild()
end
+ -- post statistics before locking project
+ statistics.post()
+
-- lock the whole project
project.lock()
@@ -50,9 +53,6 @@ function main()
-- enter project directory
local oldir = os.cd(project.directory())
- -- post statistics
- statistics.post()
-
-- clean up temporary files once a day
cleaner.cleanup()
diff --git a/xmake/actions/build/statistics.lua b/xmake/actions/build/statistics.lua
index 8c1840139..571aca06d 100644
--- a/xmake/actions/build/statistics.lua
+++ b/xmake/actions/build/statistics.lua
@@ -57,6 +57,9 @@ end
--
function post()
+ -- enter project directory
+ local oldir = os.cd(os.projectdir())
+
-- get the project directory name
local projectname = path.basename(os.projectdir())
@@ -91,6 +94,9 @@ function post()
end
end
}
+
+ -- leave project directory
+ os.cd(oldir)
end
-- the main function
diff --git a/xmake/core/sandbox/modules/io.lua b/xmake/core/sandbox/modules/io.lua
index 53ba52cc1..6c9fd036c 100644
--- a/xmake/core/sandbox/modules/io.lua
+++ b/xmake/core/sandbox/modules/io.lua
@@ -143,14 +143,6 @@ function sandbox_io_filelock.lock(lock, opt)
end
end
--- try to lock filelock
-function sandbox_io_filelock.trylock(lock, opt)
- local ok, errors = lock:_trylock(opt)
- if not ok then
- raise(errors)
- end
-end
-
-- unlock filelock
function sandbox_io_filelock.unlock(lock)
local ok, errors = lock:_unlock()