Running androidmk tool for converting .mk file to .bp file

3,385 views
Skip to first unread message

shalini...@gmail.com

unread,
Aug 4, 2017, 9:57:01 AM8/4/17
to Android Building

Hi,

I have been working with o-master preview source code and have been studying the new android build system soong. Documentation suggests that there is “androidmk” tool which converts .mk files to .bp files.  I would like to make use of this tool for converting .mk file to .bp file.

Running the tool threw below errors:

build/soong/androidmk/cmd/androidmk/androidmk.go:11:2: cannot find package "android/soong/androidmk/parser" in any of:

        /home/bodapati/o_master/build/src/android/soong/androidmk/parser (from $GOROOT)

        /home/bodapati/go/src/android/soong/androidmk/parser (from $GOPATH)

build/soong/androidmk/cmd/androidmk/androidmk.go:11:2: cannot find package "github.com/google/blueprint/parser" in any of:

        /home/bodapati/o_master/build/src/github.com/google/blueprint/parser (from $GOROOT)

        /home/bodapati/go/src/github.com/google/blueprint/parser (from $GOPATH)

 

To resolve the missing dependencies, we manually copied these packages from build/soong into GOROOT’s src folder but some structure and property definitions are not present in these packages and compiling androidmk.go  gave below errors :

build/soong/androidmk/cmd/androidmk/androidmk.go:99: undefined: androidScope

build/soong/androidmk/cmd/androidmk/androidmk.go:120: undefined: soongModuleTypes

build/soong/androidmk/cmd/androidmk/androidmk.go:123: undefined: clear_vars

build/soong/androidmk/cmd/androidmk/androidmk.go:132: undefined: conditionalTranslations

build/soong/androidmk/cmd/androidmk/androidmk.go:204: undefined: propertyPrefixes

build/soong/androidmk/cmd/androidmk/androidmk.go:217: undefined: conditionalTranslations

build/soong/androidmk/cmd/androidmk/androidmk.go:235: undefined: rewriteProperties

build/soong/androidmk/cmd/androidmk/androidmk.go:236: undefined: variableAssignmentContext

build/soong/androidmk/cmd/androidmk/androidmk.go:267: undefined: conditionalTranslations

build/soong/androidmk/cmd/androidmk/androidmk.go:271: undefined: conditionalTranslations

build/soong/androidmk/cmd/androidmk/androidmk.go:271: too many errors

I replaced the parser that was copied from  build/soong in GOROOT with the parser from this source https://github.com/google/blueprint.git. This resolved errors for undefined variables but gave below errors :

go build github.com/google/blueprint/parser: prebuilts/go/linux-x86/pkg/tool/linux_amd64/compile: fork/exec prebuilts/go/linux-x86/pkg/tool/linux_amd64/compile: no such file or directory

go build android/soong/androidmk/parser: prebuilts/go/linux-x86/pkg/tool/linux_amd64/compile: fork/exec prebuilts/go/linux-x86/pkg/tool/linux_amd64/compile: no such file or directory

Can anyone help on how to get the tool running?

Thank You.

 

 

Thanks & Regards,

B. Shalini

Colin Cross

unread,
Aug 4, 2017, 8:11:30 PM8/4/17
to android-...@googlegroups.com
The O preview source code is not buildable, but all of the relevant
code is in AOSP, so use that instead. Sync aosp normally, then run
source build/envsetup.sh && m -j blueprint_tools to build the
androidmk tool.
> --
> --
> 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-buildi...@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-buildi...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages