Board.KolibriOS.org
http://board.kolibrios.org/

Система сборки Tup
http://board.kolibrios.org/viewtopic.php?f=7&t=2869
Страница 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)
 end
+output_files = {"kolibri.img"}^M
 -- make folders
 table.sort(img_dirs)
 for i,v in ipairs(img_dirs) do
@@ -715,8 +716,7 @@ for i,v in ipairs(img_files) do
   then
     -- 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
 end
 
 -- 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

Hello,

while dealing with fasm code in kolibri I'm always facing include directives like these.
Код:
include '../../../../struct.inc'
include '../../../../proc32.inc'
include '../../../../macros.inc'
include '../../../../config.inc'
include '../../../../debug-fdo.inc'
include '../../../../develop/libraries/libs-dev/libio/libio.inc'

Or these.
Код:
include '../../../../../../programs/proc32.inc'
include '../../../../../../programs/macros.inc'
include '../../../../../../programs/develop/libraries/box_lib/load_lib.mac'
include '../../../../../../programs/dll.inc'

I'm also tired of duplicate files like skin.inc (170 of them in svn) and once duplicate but now different files like proc32.inc (12 total, 6 different). Five years ago we had a similar issue with mem.inc and dll.inc 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
specified).

Pros:
  • 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 > lang.inc' is needed.

Cons:
  • 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 КБ]
9 скачиваний

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