-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: Add tree builds #1001
build: Add tree builds #1001
Conversation
@andreittr, this fails when I try to build $ make
make[1]: Entering directory '/media/razvan/c4f6765a-efa5-4ebd-9cf0-7da9908a0189/razvan/unikraft/scripts/workdir/unikraft'
mkdir: cannot create directory ‘’: No such file or directory
/media/razvan/c4f6765a-efa5-4ebd-9cf0-7da9908a0189/razvan/unikraft/scripts/workdir/unikraft/lib/ukstore/Makefile.uk:3: *** could not create directory "". Stop.
Makefile:1033: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:32: recipe for target '_all' failed
make[1]: *** [_all] Error 2
make[1]: Leaving directory '/media/razvan/c4f6765a-efa5-4ebd-9cf0-7da9908a0189/razvan/unikraft/scripts/workdir/unikraft'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @andreittr. Can you give an idea on how the build directory should look like and on what application is this relevant to test?
@razvand are you adding anything else in the config menu or something? I tried it on my system and on the remote systems and it seems to work fine. |
Hi! Yes, this library PR right here: unikraft/lib-geos#1 makes use of tree building. It uses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @andreittr, this works fine!
Reviewed-by: Maria Sfiraiala maria.sfiraiala@gmail.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @andreittr. This seems to work fine, but we still have the issue mentioned above for ubuntu 18.04.
Also please rebase the pr on top of the staging branch so the ci/cd tests can run
0ee5c37
to
f1d5352
Compare
This still fails on ubuntu 18.04:
It's all good besides that. @razvand do we merge it as it is or do we search for a fix? |
No, we have to fix that. @andreittr, any idea what's causing this? Could you check on a container running Ubuntu 18.04? |
f1d5352
to
22ffd6d
Compare
@razvand found the issue while rebasing against staging; it was a typo that was excercised by new code. Pushed rebase w/ fix, should work ok now. |
@StefanJum, @mschlumpp, please take another look. |
@StefanJum I think it was just GitHub actions being broken for some reason. I triggered a retry of the failed jobs and they are now successful. |
22ffd6d
to
74b0a4f
Compare
Hmm, that seems to be due to use of the |
It's still a problem for commands without a library specifier:
|
74b0a4f
to
fa61ec4
Compare
Should be fixed now by judicious application of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-by: Marco Schlumpp marco@unikraft.io
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thanks.
Reviewed-by: Stefan Jumarea stefanjumarea02@gmail.com
ed7dc05
to
6cc383d
Compare
Rebased & addressed comments. |
ede06d3
to
52f90dd
Compare
This change adds the option to place build files in a dedicated `.../build/` directory under the library build path. This feature is opt-in per-library and enabled if the $(LIBNAME)__BUILDTREE make variable is set. Signed-off-by: Andrei Tatar <andrei@unikraft.io>
This adds the feature to place build products in a directory tree mirroring the tree their source files are in. This feature piggy-backs on top of the $(LIBNAME)__BUILDTREE flag from 87065c2f (build: Add option for dedicated build directory). In addition, the $(LIBNAME)_SRC make variable must point to the common prefix of a library's source file paths. Any intermediate directories are created automatically. Signed-off-by: Andrei Tatar <andrei@unikraft.io>
This change adds `addlib_tree` and `addlib_tree_s` as library registration functions that enable build products to be placed in a directory tree mirroring the source files. This is useful for code that shares source filenames across multiple directories. Signed-off-by: Andrei Tatar <andrei@unikraft.io>
52f90dd
to
aa4bead
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the work!
Reviewed-by: Simon Kuenzer simon@unikraft.io
Approved-by: Simon Kuenzer simon@unikraft.io
✅ Checkpatch passed Beep boop! I ran Unikraft's
|
This adds the feature to place build products in a directory tree mirroring the tree their source files are in. This feature piggy-backs on top of the $(LIBNAME)__BUILDTREE flag from 87065c2f (build: Add option for dedicated build directory). In addition, the $(LIBNAME)_SRC make variable must point to the common prefix of a library's source file paths. Any intermediate directories are created automatically. Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Reviewed-by: Marco Schlumpp <marco@unikraft.io> Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #1001
This change adds `addlib_tree` and `addlib_tree_s` as library registration functions that enable build products to be placed in a directory tree mirroring the source files. This is useful for code that shares source filenames across multiple directories. Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Reviewed-by: Marco Schlumpp <marco@unikraft.io> Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #1001
Description of changes
This PR adds tree builds -- builds that plate the products in a directory tree mirroring the source files.
The root of this source tree relative to which source files are considered is taken from the
$(LIBNAME)_SRC
make variable, if present.This feature is most useful in libraries with many files sharing the same basename (e.g. sources named after class names).
It consists of 3 commits:
build/
directory to place the build tree in (so source directories won't conflict with unikraft files); this feature is active if$(LIBNAME)_BUILDTREE
is set toy
.$(LIBNAME)_BUILDTREE
is set toy
.addlib_tree
andaddlib_tree_s
that automate setting$(LIBNAME)_BUILDTREE
.Prerequisite checklist
checkpatch.uk
on your commit series before opening this PR;Base target
Additional configuration
Use addlib_tree[_s] to register a treebuild library.