[Tarantool-patches] [PATCH luajit 3/5] test: run LuaJIT tests via CMake
Igor Munkin
imun at tarantool.org
Tue Feb 9 11:43:19 MSK 2021
Timur,
On 09.02.21, Timur Safin wrote:
> : From: Igor Munkin <imun at tarantool.org>
> : Subject: Re: [PATCH luajit 3/5] test: run LuaJIT tests via CMake
> :
> : Timur,
> :
> : Thanks for your review!
> :
> : >
> : > I don't like this. It reminds me of bad examples of this note
> : > in the libev code like "this is so uncontrollably lame" which
> : > actually distract users. We should rather put comments in more
> : > neutral way (IMVHO).
> :
> : Unfortunately... CMake is a crap and I can't fix it. Well, honestly I
> : don't want to fix it. But you're right: I can fix all these comments
> : (athough I don't really want to). I have no idea how to express this in
> : a more neutral way, so I propose the following:
> : 1. s/CMake is a crap/there is no convenient way to make it in CMake/g.
> : 2. Leave everything else unchanged.
>
> Hmm, ok.
Fixed, squashed, force-pushed to the branch. Diff is below:
================================================================================
diff --git a/src/host/CMakeLists.txt b/src/host/CMakeLists.txt
index 011a630..59094d0 100644
--- a/src/host/CMakeLists.txt
+++ b/src/host/CMakeLists.txt
@@ -44,7 +44,7 @@ add_executable(buildvm EXCLUDE_FROM_ALL
buildvm_fold.c
buildvm_lib.c
buildvm_peobj.c
- # XXX: Unfortunately CMake is a crap. I failed to specify
+ # XXX: Unfortunately, there is no convenient way to specify
# autogenerated host/buildvm_arch.h as a dependency for
# host/buildvm.c, so I simply explicitly mentioned it in this
# *sources* list.
diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index 0be4b34..5345e12 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -38,8 +38,8 @@ macro(BuildTestLib lib sources)
)
endif()
# XXX: Append the lib to be built to the dependecy list.
- # Unfortunately, CMake is a crap and there is no other way to
- # extend the list in parent scope but join two strings with
+ # Unfortunately, there is no convenient way in CMake to extend
+ # the list in parent scope other than join two strings with
# semicolon. If one finds the normal way to make it work, feel
# free to reach me.
set(TESTLIBS "${lib};${TESTLIBS}" PARENT_SCOPE)
================================================================================
Small exercise for self-check:
| $ grep -rF 'CMake is a crap' | wc -l
| 0
>
> :
> : This is not only emotions. Such comments prevent one from unintentional
> : refactoring of such fragile places with no failures and also from
> : bothering the oldies with the questions kinda "dude, why is this done so
> : badly". In other words, primarily I have left this for the history.
> :
> : If you're OK, then I'll fix the way described above.
> :
> : >
> : > : + # Add the directory where the lib is built to the LUA_CPATH
> : > : + # environment variable, so interpreter can find and load it.
> : > : + # XXX: Here we see the other side of the coin. If one joins two
> : > : + # strings with semicolon, the value automatically becomes the
> : > : + # list. I have no idea what is wrong with this tool, but I found
> : > : + # a single working solution to make LUA_CPATH be a string via
> : > : + # "escaping" the semicolon right in string interpolation.
> : > : + set(LUA_CPATH
> : > :
> : "${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}\;${LUA_CPATH}"
> : > : PARENT_SCOPE)
> : > : + # Also add this directory to LD_LIBRARY_PATH environment
> : > : + # variable, so FFI machinery can find and load it.
> : > : + set(LD_LIBRARY_PATH "${CMAKE_CURRENT_BINARY_DIR}:${LD_LIBRARY_PATH}"
> : > : PARENT_SCOPE)
> : > : +endmacro()
> : > : +
> : > : +add_subdirectory(gh-4427-ffi-sandwich)
> : > : +add_subdirectory(lj-flush-on-trace)
> : > : +add_subdirectory(misclib-getmetrics-capi)
> : >
> : > I liked you introduced globs for test files addition (blow),
> : > but unfortunately you didn't complete this with subdirectory addition
> :
> : I have thought about it for some time, and I have a strong rationale (at
> : least for me) to not introducing such change: this doesn't work whether
> : there are directories inside containing no tests. Furthermore, we're
> : going to re-implement several C tests, so I would like to leave
> : everything as it is (if you don't mind) and return to this place later.
>
> Ok, if you plan to refactor it, because today it looks inconsistent a bit.
I personally also don't like to explicitly mention new auxiliary libs in
tests: it makes backporting harder, it broke CI several times, so we
will definitely refactor the current approach after incorporating other
tests in public domain[1].
>
> :
> : >
> : > Please see my proposed patch (with reworded comments and new macro) here
> : https://gist.github.com/tsafin/6c7505c0c764ab2b474667bf0d65fb45.
> : >
> :
> : <snipped>
> :
> : >
> : > Regards,
> : > Timur
> : >
> :
> : --
> : Best regards,
> : IM
>
> Regards,
> Timur
>
[1]: https://github.com/tarantool/tarantool/issues/4473
--
Best regards,
IM
More information about the Tarantool-patches
mailing list