Skip to content

Commit

Permalink
sys-devel/llvm: Stop enforcing external lit for tests
Browse files Browse the repository at this point in the history
Modify the ebuild to no longer enforce externally installed
dev-python/lit for tests, effectively causing the build system to use
the bundled copy of lit (along with llvm-lit). While using the external
package is more canonical, its disadvantages outweight the gain.

Most notably, lit is not slotted in Gentoo and the behavior of lit
frequently changes subtly which caused us to require a major version
match between LLVM and lit. As a result, attempting to build multiple
slots of LLVM with tests enabled cause package collisions. Building both
LLVM and lit simultaneously causes a circular dependency.

Since lit comes from the same package as LLVM itself and LLVM requires
explicit python-any-r1 use anyway, using the bundled copy has no added
cost. It reduces the risk of breakage resulting from skipping llvm-lit
wrapper and solves the forementioned problems caused by depending
on dev-python/lit.

The external package is still useful for projects that do not require
LLVM sources.
  • Loading branch information
mgorny committed Nov 16, 2017
1 parent 8de9da8 commit bffe6a1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
10 changes: 0 additions & 10 deletions sys-devel/llvm/llvm-4.0.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ DEPEND="${RDEPEND}
doc? ( dev-python/sphinx )
gold? ( sys-libs/binutils-libs )
libffi? ( virtual/pkgconfig )
test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
!!<dev-python/configparser-3.3.0.2
${PYTHON_DEPS}"
# There are no file collisions between these versions but having :0
Expand All @@ -71,11 +70,6 @@ S=${WORKDIR}/${P/_/}.src
# least intrusive of all
CMAKE_BUILD_TYPE=RelWithDebInfo

python_check_deps() {
! use test \
|| has_version "dev-python/lit[${PYTHON_USEDEP}]"
}

src_prepare() {
# Fix llvm-config for shared linking and sane flags
# https://bugs.gentoo.org/show_bug.cgi?id=565358
Expand Down Expand Up @@ -133,10 +127,6 @@ multilib_src_configure() {
)
# fi

use test && mycmakeargs+=(
-DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
)

if multilib_is_native_abi; then
mycmakeargs+=(
-DLLVM_BUILD_DOCS=$(usex doc)
Expand Down
10 changes: 0 additions & 10 deletions sys-devel/llvm/llvm-5.0.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ DEPEND="${RDEPEND}
doc? ( dev-python/sphinx )
gold? ( sys-libs/binutils-libs )
libffi? ( virtual/pkgconfig )
test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
!!<dev-python/configparser-3.3.0.2
${PYTHON_DEPS}"
# There are no file collisions between these versions but having :0
Expand All @@ -71,11 +70,6 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}
# least intrusive of all
CMAKE_BUILD_TYPE=RelWithDebInfo

python_check_deps() {
! use test \
|| has_version "dev-python/lit[${PYTHON_USEDEP}]"
}

src_prepare() {
# Fix llvm-config for shared linking and sane flags
# https://bugs.gentoo.org/show_bug.cgi?id=565358
Expand Down Expand Up @@ -133,10 +127,6 @@ multilib_src_configure() {
)
# fi

use test && mycmakeargs+=(
-DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
)

if multilib_is_native_abi; then
mycmakeargs+=(
-DLLVM_BUILD_DOCS=$(usex doc)
Expand Down
7 changes: 0 additions & 7 deletions sys-devel/llvm/llvm-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ DEPEND="${RDEPEND}
doc? ( dev-python/sphinx )
gold? ( sys-libs/binutils-libs )
libffi? ( virtual/pkgconfig )
test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
!!<dev-python/configparser-3.3.0.2
${PYTHON_DEPS}"
# There are no file collisions between these versions but having :0
Expand All @@ -73,11 +72,6 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}
# least intrusive of all
CMAKE_BUILD_TYPE=RelWithDebInfo

python_check_deps() {
! use test \
|| has_version "dev-python/lit[${PYTHON_USEDEP}]"
}

src_prepare() {
# Fix llvm-config for shared linking and sane flags
# https://bugs.gentoo.org/show_bug.cgi?id=565358
Expand Down Expand Up @@ -139,7 +133,6 @@ multilib_src_configure() {
# fi

use test && mycmakeargs+=(
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
-DLLVM_LIT_ARGS="-vv"
)

Expand Down

0 comments on commit bffe6a1

Please sign in to comment.