Page 2 of 2

Re: Система сборки Tup

Posted: Wed Nov 22, 2017 1:01 am
by dunkaist
It seems that tup doesn't ignore dot files anymore. I set CONFIG_INSERT_REVISION_ID=1 and got an error.

Code: Select all

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?
Spoiler:

Code: Select all

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"}

Re: Система сборки Tup

Posted: Wed Nov 22, 2017 3:56 pm
by CleverMouse
"Here is an obvious patch, ok for trunk?" - не надо так. Так будет зависимость образа от .revision, .revision обновляется при каждом коммите, так что образ будет пересобираться при каждом коммите, даже когда изменилось что-то, не входящее в образ.

Re: Система сборки Tup

Posted: Tue Nov 28, 2017 2:47 am
by dunkaist
Hello,

while dealing with fasm code in kolibri I'm always facing include directives like these.

Code: Select all

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.

Code: Select all

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 wrote: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).

Re: Система сборки Tup

Posted: Tue Nov 10, 2020 10:50 pm
by maxcodehack
Hello.
How I can setup autobuild for program? My problem: program use C_Layer. Folder C_Layer/OBJ is empty. But this objects need to compilation.

Re: Система сборки Tup

Posted: Sat Nov 28, 2020 10:15 am
by dunkaist
There are many examples in repository, read them.
I committed Tupfile.lua for /contrib/C_Layer/ASM/* in #8265.

Re: Система сборки Tup

Posted: Wed Dec 02, 2020 10:12 am
by maxcodehack
I set up autobuild to program use C_Layer, but: "loadlibimg.obj not recognized". Maybe kpack for objects broken them?

Re: Система сборки Tup

Posted: Wed Dec 02, 2020 2:08 pm
by dunkaist
May be. You can set up tup autobuild locally as described in documentation and check it.

Re: Система сборки Tup

Posted: Mon Sep 27, 2021 11:57 pm
by punk_joker
I just want to build kernel, how to exclude build DDK?

Re: Система сборки Tup

Posted: Sat Apr 27, 2024 3:12 pm
by dunkaist
New tup 0.8 introduces backward-incompatible changes. If you set up the autobuild locally and it has stopped working recently, read this: https://gittup.org/tup/ex_explicit_variants.html

punk_joker, you can build a single file via 'tup path/to/file'. You can also continue using plain fasm like 'fasm -m 262144 kernel.asm kernel.mnt'.