Skip to content

Commit

Permalink
dev-ml/llvm-ocaml: 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. Furthermore, in the current git version the additional
(fine-grained) test rules do not work correctly without llvm-lit, making
it impossible to run LLVM binding tests separately.
  • Loading branch information
mgorny committed Nov 16, 2017
1 parent bffe6a1 commit 20c1ad8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
12 changes: 1 addition & 11 deletions dev-ml/llvm-ocaml/llvm-ocaml-4.0.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ RDEPEND="
DEPEND="${RDEPEND}
dev-lang/perl
dev-ml/findlib
test? ( dev-ml/ounit
$(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
test? ( dev-ml/ounit )
!!<dev-python/configparser-3.3.0.2
${PYTHON_DEPS}"

Expand All @@ -48,11 +47,6 @@ S=${WORKDIR}/${MY_P/_/}.src
# least intrusive of all
CMAKE_BUILD_TYPE=RelWithDebInfo

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

pkg_setup() {
LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
python-any-r1_pkg_setup
Expand Down Expand Up @@ -92,10 +86,6 @@ src_configure() {
# TODO: ocamldoc
)

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

cmake-utils_src_configure

local llvm_libdir=$(llvm-config --libdir)
Expand Down
12 changes: 1 addition & 11 deletions dev-ml/llvm-ocaml/llvm-ocaml-5.0.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ RDEPEND="
DEPEND="${RDEPEND}
dev-lang/perl
dev-ml/findlib
test? ( dev-ml/ounit
$(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
test? ( dev-ml/ounit )
!!<dev-python/configparser-3.3.0.2
${PYTHON_DEPS}"

Expand All @@ -48,11 +47,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}]"
}

pkg_setup() {
LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
python-any-r1_pkg_setup
Expand Down Expand Up @@ -92,10 +86,6 @@ src_configure() {
# TODO: ocamldoc
)

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

# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
# also: custom rules for OCaml do not work for CPPFLAGS
use debug || local -x CFLAGS="${CFLAGS} -DNDEBUG"
Expand Down
9 changes: 1 addition & 8 deletions dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ RDEPEND="
DEPEND="${RDEPEND}
dev-lang/perl
dev-ml/findlib
test? ( dev-ml/ounit
$(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
test? ( dev-ml/ounit )
!!<dev-python/configparser-3.3.0.2
${PYTHON_DEPS}"

Expand All @@ -49,11 +48,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}]"
}

pkg_setup() {
llvm_pkg_setup
python-any-r1_pkg_setup
Expand Down Expand Up @@ -97,7 +91,6 @@ src_configure() {
)

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

Expand Down

0 comments on commit 20c1ad8

Please sign in to comment.