swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.62k stars 10.37k forks source link

[SR-13621] llbuild: ninja install should install llbuild #56056

Open swift-ci opened 4 years ago

swift-ci commented 4 years ago
Previous ID SR-13621
Radar None
Original Reporter soloturn (JIRA User)
Type Task
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | | |Labels | Task | |Assignee | None | |Priority | Medium | md5: e6587d7f5aa7e82fcb31e8a871077c3e

Issue Description:

tried to create a llbuild package for arch linux, and called:

mkdir build
cd build
CXX=clang++ CC=clang cmake ../llbuild -G Ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr/
ninja
DESTDIR=../pkg ninja install

the result is without e.g. llbuild binary:
$ find pkg/llbuild-git/usr/
pkg/llbuild-git/usr/
pkg/llbuild-git/usr/lib
pkg/llbuild-git/usr/lib/libllbuild.so
pkg/llbuild-git/usr/bin
pkg/llbuild-git/usr/bin/swift-build-tool
pkg/llbuild-git/usr/include
pkg/llbuild-git/usr/include/llbuild
pkg/llbuild-git/usr/include/llbuild/buildkey.h
pkg/llbuild-git/usr/include/llbuild/db.h
pkg/llbuild-git/usr/include/llbuild/core.h
pkg/llbuild-git/usr/include/llbuild/llbuild.h
pkg/llbuild-git/usr/include/llbuild/buildvalue.h
pkg/llbuild-git/usr/include/llbuild/buildsystem.h
pkg/llbuild-git/usr/include/llbuild/llbuild-defines.h

it is produced though:
$ find src/build/bin/
src/build/bin/
src/build/bin/adjust-times
src/build/bin/NinjaTests
src/build/bin/CoreTests
src/build/bin/CAPITests
src/build/bin/CASTests
src/build/bin/swift-build-tool
src/build/bin/BuildSystemTests
src/build/bin/BasicTests
src/build/bin/EvoTests
src/build/bin/llbuild

typesanitizer commented 4 years ago

build-script has an --install-llbuild flag which lays out the subdirectories properly. The invocation ends up looking something like:

utils/build-script <other args> --llbuild --install-llbuild

This "installs" the llbuild stuff under the build directory. After this, you can copy over the directories to where you'd like them to be.

Does that work for you? Is there a specific reason you are invoking ninja directly instead of going through build-script?

swift-ci commented 4 years ago

Comment by solo turn (JIRA)

packaging swift and its parts via build-script with all the dependencies is painful as it runs forever. especially painful it is in linux distributions which rely on compiling the source on install. splitting it is much quicker, it checks out only llbuild. https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=llbuild-git . there is a couple of distributions which all patch the same thing, which made me create a ticket. see one example here: https://github.com/termux/termux-packages/blob/master/packages/llbuild/products-llbuild-CMakeLists.txt.patch
apart from the fact that the logic what is important to install ideally lies in the llbuild repository, not outside. if build-script could then call ninja install as well would be excellent.

typesanitizer commented 4 years ago

cc @ddunbar

swift-ci commented 4 years ago

Comment by solo turn (JIRA)

@ddunbar what you think?