Re: [android-building] how to get compile_commands.json by mma or mm from android.mk in aosp project of android 9

2020-05-26 Thread Paschalis Mpeis
In my case SOONG_GEN_COMPDB exists (android 10), but following the 
instructions here 

 did 
not generate the json file,
unless you actually proceed with a full build (i.e., make nothing didn't 
produce the file, and `m ` also didn't work.

But the suggested approach of building the json file using the output build 
log did work.
So you do the compilation as you would normally do (either full, or a 
subset), and then use the log file to generate the compdb like:

`compiledb --parse out/verbose.log`



On Monday, August 26, 2019 at 3:43:30 AM UTC+3, Rounak Agarwal wrote:
>
> Hi Dan. It looks like the option SOONG_GEN_COMPDB is not available in Pie 
> branches. Perhaps it was added later. I wish to make use of this option. 
> Will it be safe to use soong from master branch with Pie source code ? Were 
> any breaking changes made in soong since Pie was branched out ?
>
> On Monday, 18 March 2019 22:48:35 UTC+5:30, Dan Willemsen wrote:
>>
>> The ninja compilation database support doesn't work very well for our 
>> ninja files due to kati using a rule per command. This upstream ninja 
>> feature request may help, but that's assuming that whatever is parsing the 
>> compdb files can understand the raw rules (which is usually a bash script, 
>> not just a call to the compiler): 
>> https://github.com/ninja-build/ninja/issues/1377
>>
>> I'd recommend converting to Android.bp so that you can use 
>> SOONG_GEN_COMPDB.
>>
>> - Dan
>>
>> On Mon, Mar 18, 2019 at 9:54 AM  wrote:
>>
>>> I can get CMakeLists.txt from Android.bp by soong, then get 
>>> compile_commands, but cann't get CMakeLists.json from android.mk. I've 
>>> tried pass ' -t compdb cxx' but just get empty "[ \n ]" , any one can help 
>>> me?
>>>
>>> -- 
>>> -- 
>>> You received this message because you are subscribed to the "Android 
>>> Building" mailing list.
>>> To post to this group, send email to android-...@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> android-...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-building?hl=en
>>>
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Android Building" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to android-...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/2b23cae5-1a53-4c4a-b93a-633f5093d9a8%40googlegroups.com.


Re: [android-building] how to get compile_commands.json by mma or mm from android.mk in aosp project of android 9

2019-08-25 Thread Rounak Agarwal
Hi Dan. It looks like the option SOONG_GEN_COMPDB is not available in Pie 
branches. Perhaps it was added later. I wish to make use of this option. 
Will it be safe to use soong from master branch with Pie source code ? Were 
any breaking changes made in soong since Pie was branched out ?

On Monday, 18 March 2019 22:48:35 UTC+5:30, Dan Willemsen wrote:
>
> The ninja compilation database support doesn't work very well for our 
> ninja files due to kati using a rule per command. This upstream ninja 
> feature request may help, but that's assuming that whatever is parsing the 
> compdb files can understand the raw rules (which is usually a bash script, 
> not just a call to the compiler): 
> https://github.com/ninja-build/ninja/issues/1377
>
> I'd recommend converting to Android.bp so that you can use 
> SOONG_GEN_COMPDB.
>
> - Dan
>
> On Mon, Mar 18, 2019 at 9:54 AM > wrote:
>
>> I can get CMakeLists.txt from Android.bp by soong, then get 
>> compile_commands, but cann't get CMakeLists.json from android.mk. I've 
>> tried pass ' -t compdb cxx' but just get empty "[ \n ]" , any one can help 
>> me?
>>
>> -- 
>> -- 
>> You received this message because you are subscribed to the "Android 
>> Building" mailing list.
>> To post to this group, send email to android-...@googlegroups.com 
>> 
>> To unsubscribe from this group, send email to
>> android-...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/android-building?hl=en
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Android Building" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to android-...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/f0fc8483-d78b-4f2a-a4c6-05b1a1c035a3%40googlegroups.com.


Re: [android-building] how to get compile_commands.json by mma or mm from android.mk in aosp project of android 9

2019-03-18 Thread 刘昊
thanks, I've tried *compiledb-aosp.sh* in android-9.0.0_r34, but failed.
here is the out put

alex@alex-pc:~/code-reviww/aosp$ ./aosp-compdb.sh
# Loading build env
# Configuring x86_64 build
# Chosen module: bionic/libc
# Generating compilation database file
/home/alex/code-reviww/aosp/bionic/libc/compile_commands.json
alex@alex-pc:~/code-reviww/aosp$ ls
/home/alex/code-reviww/aosp/bionic/libc/compile_commands.json
ls: cannot access
'/home/alex/code-reviww/aosp/bionic/libc/compile_commands.json': No such
file or directory


Nick Diego Yamane  于2019年3月19日周二 上午4:34写道:

> An alternative option would be compiledb tool (
> https://github.com/nickdiego/compiledb), which is able to parse compile
> commands from a build log. Some years ago I've been able to parse
> compilation database from some AOSP modules using a similar approach.
>
> On Mon, Mar 18, 2019, 13:18 'Dan Willemsen' via Android Building <
> android-building@googlegroups.com> wrote:
>
>> The ninja compilation database support doesn't work very well for our
>> ninja files due to kati using a rule per command. This upstream ninja
>> feature request may help, but that's assuming that whatever is parsing the
>> compdb files can understand the raw rules (which is usually a bash script,
>> not just a call to the compiler):
>> https://github.com/ninja-build/ninja/issues/1377
>>
>> I'd recommend converting to Android.bp so that you can use
>> SOONG_GEN_COMPDB.
>>
>> - Dan
>>
>> On Mon, Mar 18, 2019 at 9:54 AM  wrote:
>>
>>> I can get CMakeLists.txt from Android.bp by soong, then get
>>> compile_commands, but cann't get CMakeLists.json from android.mk. I've
>>> tried pass ' -t compdb cxx' but just get empty "[ \n ]" , any one can help
>>> me?
>>>
>>> --
>>> --
>>> You received this message because you are subscribed to the "Android
>>> Building" mailing list.
>>> To post to this group, send email to android-building@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> android-building+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-building?hl=en
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Building" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to android-building+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> --
>> You received this message because you are subscribed to the "Android
>> Building" mailing list.
>> To post to this group, send email to android-building@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-building+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-building?hl=en
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Android Building" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to android-building+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-building@googlegroups.com
> To unsubscribe from this group, send email to
> android-building+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-building+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-building] how to get compile_commands.json by mma or mm from android.mk in aosp project of android 9

2019-03-18 Thread 刘昊
some module like frameworks/av is really hard to convert to Android.bp.  In
android-9.0.0_r34 , SOONG_GEN_COMPDB can't use directly, I need add related
file to aosp soong module, then recompile soong, then I can
SOONG_GEN_COMPDB, but the generated compile_commands is really big, like
83M. generated by CMakeLists.txt is much smaller. :)

'Dan Willemsen' via Android Building 
于2019年3月19日周二 上午1:18写道:

> The ninja compilation database support doesn't work very well for our
> ninja files due to kati using a rule per command. This upstream ninja
> feature request may help, but that's assuming that whatever is parsing the
> compdb files can understand the raw rules (which is usually a bash script,
> not just a call to the compiler):
> https://github.com/ninja-build/ninja/issues/1377
>
> I'd recommend converting to Android.bp so that you can use
> SOONG_GEN_COMPDB.
>
> - Dan
>
> On Mon, Mar 18, 2019 at 9:54 AM  wrote:
>
>> I can get CMakeLists.txt from Android.bp by soong, then get
>> compile_commands, but cann't get CMakeLists.json from android.mk. I've
>> tried pass ' -t compdb cxx' but just get empty "[ \n ]" , any one can help
>> me?
>>
>> --
>> --
>> You received this message because you are subscribed to the "Android
>> Building" mailing list.
>> To post to this group, send email to android-building@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-building+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-building?hl=en
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Android Building" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to android-building+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-building@googlegroups.com
> To unsubscribe from this group, send email to
> android-building+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-building+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-building] how to get compile_commands.json by mma or mm from android.mk in aosp project of android 9

2019-03-18 Thread Nick Diego Yamane
An alternative option would be compiledb tool (
https://github.com/nickdiego/compiledb), which is able to parse compile
commands from a build log. Some years ago I've been able to parse
compilation database from some AOSP modules using a similar approach.

On Mon, Mar 18, 2019, 13:18 'Dan Willemsen' via Android Building <
android-building@googlegroups.com> wrote:

> The ninja compilation database support doesn't work very well for our
> ninja files due to kati using a rule per command. This upstream ninja
> feature request may help, but that's assuming that whatever is parsing the
> compdb files can understand the raw rules (which is usually a bash script,
> not just a call to the compiler):
> https://github.com/ninja-build/ninja/issues/1377
>
> I'd recommend converting to Android.bp so that you can use
> SOONG_GEN_COMPDB.
>
> - Dan
>
> On Mon, Mar 18, 2019 at 9:54 AM  wrote:
>
>> I can get CMakeLists.txt from Android.bp by soong, then get
>> compile_commands, but cann't get CMakeLists.json from android.mk. I've
>> tried pass ' -t compdb cxx' but just get empty "[ \n ]" , any one can help
>> me?
>>
>> --
>> --
>> You received this message because you are subscribed to the "Android
>> Building" mailing list.
>> To post to this group, send email to android-building@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-building+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-building?hl=en
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Android Building" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to android-building+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-building@googlegroups.com
> To unsubscribe from this group, send email to
> android-building+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-building+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-building] how to get compile_commands.json by mma or mm from android.mk in aosp project of android 9

2019-03-18 Thread 'Dan Willemsen' via Android Building
The ninja compilation database support doesn't work very well for our ninja
files due to kati using a rule per command. This upstream ninja feature
request may help, but that's assuming that whatever is parsing the compdb
files can understand the raw rules (which is usually a bash script, not
just a call to the compiler):
https://github.com/ninja-build/ninja/issues/1377

I'd recommend converting to Android.bp so that you can use SOONG_GEN_COMPDB.

- Dan

On Mon, Mar 18, 2019 at 9:54 AM  wrote:

> I can get CMakeLists.txt from Android.bp by soong, then get
> compile_commands, but cann't get CMakeLists.json from android.mk. I've
> tried pass ' -t compdb cxx' but just get empty "[ \n ]" , any one can help
> me?
>
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-building@googlegroups.com
> To unsubscribe from this group, send email to
> android-building+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-building+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.