Compilation database support?

39 views
Skip to first unread message

Tom DuBuisson

unread,
Mar 25, 2021, 6:25:38 PM3/25/21
to redo
There doesn't appear to be any native support in redo for emitting compilation databases.  Does anyone have thoughts on either external tools or adding compilation database support to redo?

-Tom

spacefro...@meterriblecrew.net

unread,
Mar 25, 2021, 7:13:27 PM3/25/21
to redo...@googlegroups.com
Could you be more specific what you are thinking of?

Redo is solely a dependency management tool (with a focus on compiling software). It does not have support for anything in particular, except for the make job system, for sake of its ubiquity.

You may want to take a look at redoconf and what is said about it in the documentation. Maybe, that has already what you seek.

–Michael

Tom DuBuisson

unread,
Mar 25, 2021, 8:15:56 PM3/25/21
to spacefro...@meterriblecrew.net, redo...@googlegroups.com
Michael,

A compilation database is a JSON list of the steps taken in the compilation of a project [0].  Seeing as redo can compile code and otherwise replace Make I was hoping to find a matching replacement for compiledb or bear [1] [2].  It would be even better if we could get native compdb support like in cmake [3].

For my purposes, the compilation database is used to run numerous static analysis tools inside the Muse platform [4].  By decomposing the build system into a set of compilation steps we can drive numerous analysis tools without making each tool understand each build system.  This has proven to work well in practice and allows many C projects to run Infer without significant configuration effort.

Regards,
Tom


--
You received this message because you are subscribed to the Google Groups "redo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redo-list+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redo-list/058aa894-6b98-4add-8013-c8b8cf5908a1%40meterriblecrew.net.

Timothy Allen

unread,
Mar 25, 2021, 10:58:19 PM3/25/21
to redo...@googlegroups.com
On 26/3/21 11:15, Tom DuBuisson wrote:
> A compilation database is a JSON list of the steps taken in the
> compilation of a project [0].  Seeing as redo can compile code and
> otherwise replace Make I was hoping to find a matching replacement for
> compiledb or bear [1] [2].  It would be even better if we could get
> native compdb support like in cmake [3].

Redo does not, itself, actually invoke the compiler so it doesn't know
what compilation flags are used for which files. It just runs
shell-scripts which might invoke the compiler or might do other things,
and redo doesn't know or care.

A tool like bear should work just as well for redo as it does for make.


Tim.

Sergey Matveev

unread,
Mar 26, 2021, 1:22:49 AM3/26/21
to redo...@googlegroups.com
It is not the same, but slightly related to LLVM/Clang's static analysis
tools. I use compile_flags.txt.do in my projects like this:

redo-ifchange \
../conf/flags/common.rc \
../conf/flags/asn1.rc \
../conf/flags/crypto.rc \
../conf/flags/libpcsclite.pc.rc \
../conf/flags/tai.rc
. ../conf/flags/common.rc
. ../conf/flags/asn1.rc
. ../conf/flags/crypto.rc
. ../conf/flags/libpcsclite.pc.rc
. ../conf/flags/tai.rc
echo "$ASN1_CFLAGS $CRYPTO_CFLAGS $LIBPCSCLITE_CFLAGS $LIBTAI_CFLAGS $CFLAGS" |
tr " " "\n" | grep -v "^$" | sort | uniq

that produces compile_flags.txt that is completely enough for
clang-*/clangd and similar tools:

-D_THREAD_SAFE
-DDMALLOC
-DDMALLOC_FUNC_CHECK
-ffunction-sections
[...]
-g
-I/usr/local/include
-I/usr/local/include/PCSC
-O0
-pthread
-std=c99
-W
-Weverything

But of course it is manually created.

--
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263 6422 AE1A 8109 E498 57EF

Tom DuBuisson

unread,
Mar 26, 2021, 5:34:24 PM3/26/21
to redo...@googlegroups.com
OK, I have some ideas on how to proceed.  Thank you for the information and insight.

-Tom

--
You received this message because you are subscribed to the Google Groups "redo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redo-list+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages