Система сборки Tup
Страница 2 из 2

Автор:  dunkaist [ Ср ноя 22, 2017 1:01 am ]
Заголовок сообщения:  Re: Система сборки Tup

It seems that tup doesn't ignore dot files anymore. I set CONFIG_INSERT_REVISION_ID=1 and got an error.
tup error: File '/mnt/blah/mirror/kolibrios/data/.kernel.mnt' was written to, but is not in .tup/db. You probably should specify it as an output

Here is an obvious patch, ok for trunk?
Спойлер: Показать
diff --git a/data/Tupfile.lua b/data/Tupfile.lua
index 3c9fbc449..b3b0eff6f 100644
--- a/data/Tupfile.lua
+++ b/data/Tupfile.lua
@@ -701,6 +701,7 @@ bootloader = "../kernel/trunk/bootloader/boot_fat12.bin"
 make_img_command = make_img_command .. " && dd if=" .. bootloader .. " of=kolibri.img count=1 bs=512 conv=notrunc 2>&1"
 table.insert(input_deps, bootloader)
+output_files = {"kolibri.img"}^M
 -- make folders
 for i,v in ipairs(img_dirs) do
@@ -715,8 +716,7 @@ for i,v in ipairs(img_files) do
     -- for kernel.mnt, insert autobuild revision identifier
     -- from .revision to .kernel.mnt
-    -- note that .revision and .kernel.mnt must begin with .
-    -- to prevent tup from tracking them
+    table.insert(output_files, ".kernel.mnt")^M
     if build_type == "rus"
     then str='$(LANG=ru_RU.utf8 date -u +"[автосборка %d %b %Y %R, r$(cat .revision)]"|iconv -f utf8 -t cp866)'
     else str='$(date -u +"[auto-build %d %b %Y %R, r$(cat .revision)]")'
@@ -732,7 +732,7 @@ for i,v in ipairs(img_files) do
 -- generate tup rule for kolibri.img
-tup.definerule{inputs = input_deps, command = make_img_command, outputs = {"kolibri.img"}}
+tup.definerule{inputs = input_deps, command = make_img_command, outputs = output_files}^M
 -- generate command and dependencies for mkisofs
 input_deps = {"kolibri.img"}

Автор:  CleverMouse [ Ср ноя 22, 2017 3:56 pm ]
Заголовок сообщения:  Re: Система сборки Tup

"Here is an obvious patch, ok for trunk?" - не надо так. Так будет зависимость образа от .revision, .revision обновляется при каждом коммите, так что образ будет пересобираться при каждом коммите, даже когда изменилось что-то, не входящее в образ.

Автор:  dunkaist [ Вт ноя 28, 2017 2:47 am ]
Заголовок сообщения:  Re: Система сборки Tup


while dealing with fasm code in kolibri I'm always facing include directives like these.
include '../../../../'
include '../../../../'
include '../../../../'
include '../../../../'
include '../../../../'
include '../../../../develop/libraries/libs-dev/libio/'

Or these.
include '../../../../../../programs/'
include '../../../../../../programs/'
include '../../../../../../programs/develop/libraries/box_lib/load_lib.mac'
include '../../../../../../programs/'

I'm also tired of duplicate files like (170 of them in svn) and once duplicate but now different files like (12 total, 6 different). Five years ago we had a similar issue with and files.

Fortunately, recent versions of fasm (including the one on autobuild server) can look for include files into directories specified in an environment variable.
fasm manual писал(а):
The file is first
searched for in the directory containing file which included it and when it is
not found there, the search is continued in the directories specified in the
environment variable called INCLUDE (the multiple paths separated with
semicolons can be defined there, they will be searched in the same order as

  • You can use standard includes without duplicate files and without ../../../../ paths;
  • You can still copy standard includes into a program's dir if you checked out that single dir, and you don't have to edit include paths in source. I.e. you want to build inside kolibri to use debug info;
  • Thus no duplicates and ../../../../ paths;
  • As a bonus, it's possible to define lang variable inside use_fasm.lua via -d fasm option, then no 'echo lang fix en >' is needed.

  • Those who don't use tup will have to set environment variables manually;
  • If we switch to fasm's -d option to specify language, non-tup users will have to type -dlang=en/ru manually.

I attached a patch that adds use_fasm.lua file to /programs directory and updates /system/launch/Tupfile.lua as an example.
I tested the patch on linux. If you like my idea and have windows, please, try it there (build launch app).

use_fasm.diff [1.96 КБ]
39 скачиваний

Страница 2 из 2 Часовой пояс: UTC+03:00
Powered by phpBB® Forum Software © phpBB Limited