[GUIDE] How to build LineageOS on Windows 10 (WSL 2.0)

Search This thread

wlsxg

New member
Jan 30, 2014
2
0
linux-x86/bison/bison: Syntax error: "(" u

I'm trying to compile android8.1 on ubuntu16.04, but I get the error "prebuilts/misc/linux-x86/bison/bison: Syntax error: "(" unexpected".

ubuntu16.04 is based on 'ubuntu on windows'.

Help me,please

log: No need to regenerate ninja file [ 0% 1/364] //system/tools/hidl:libhidl-gen-ast yacc hidl-gen_y.yy [linux] FAILED: out/soong/.intermediates/system/tools/hidl/libhidl-gen-ast/linux_x86_64_shared/gen/yacc/system/tools/hidl/hidl-gen_y.cpp out/soong/.intermediates/system/tools/hidl/libhidl-gen-ast/linux_x86_64_shared/gen/yacc/system/tools/hidl/hidl-gen_y.h BISON_PKGDATADIR=external/bison/data prebuilts/misc/linux-x86/bison/bison -d --defines=out/soong/.intermediates/system/tools/hidl/libhidl-gen-ast/linux_x86_64_shared/gen/yacc/system/tools/hidl/hidl-gen_y.h -o out/soong/.intermediates/system/tools/hidl/libhidl-gen-ast/linux_x86_64_shared/gen/yacc/system/tools/hidl/hidl-gen_y.cpp system/tools/hidl/hidl-gen_y.yy prebuilts/misc/linux-x86/bison/bison: 1: prebuilts/misc/linux-x86/bison/bison: Syntax error: "(" unexpected [ 1% 6/364] //external/boringssl:libcrypto clang src/crypto/cipher_extra/e_aesgcmsiv.c [linux] ninja: build stopped: subcommand failed. 09:44:20 ninja failed with: exit status 1
 

Uldiniad

Senior Member
Mar 17, 2016
343
266
I'm trying to compile android8.1 on ubuntu16.04, but I get the error "prebuilts/misc/linux-x86/bison/bison: Syntax error: "(" unexpected".

ubuntu16.04 is based on 'ubuntu on windows'.

Help me,please

log: No need to regenerate ninja file [ 0% 1/364] //system/tools/hidl:libhidl-gen-ast yacc hidl-gen_y.yy [linux] FAILED: out/soong/.intermediates/system/tools/hidl/libhidl-gen-ast/linux_x86_64_shared/gen/yacc/system/tools/hidl/hidl-gen_y.cpp out/soong/.intermediates/system/tools/hidl/libhidl-gen-ast/linux_x86_64_shared/gen/yacc/system/tools/hidl/hidl-gen_y.h BISON_PKGDATADIR=external/bison/data prebuilts/misc/linux-x86/bison/bison -d --defines=out/soong/.intermediates/system/tools/hidl/libhidl-gen-ast/linux_x86_64_shared/gen/yacc/system/tools/hidl/hidl-gen_y.h -o out/soong/.intermediates/system/tools/hidl/libhidl-gen-ast/linux_x86_64_shared/gen/yacc/system/tools/hidl/hidl-gen_y.cpp system/tools/hidl/hidl-gen_y.yy prebuilts/misc/linux-x86/bison/bison: 1: prebuilts/misc/linux-x86/bison/bison: Syntax error: "(" unexpected [ 1% 6/364] //external/boringssl:libcrypto clang src/crypto/cipher_extra/e_aesgcmsiv.c [linux] ninja: build stopped: subcommand failed. 09:44:20 ninja failed with: exit status 1

can you try repo sync again and run a new build? same for you @Mcenzie.
I've recompiled bison and uploaded it to GitHub (/prebuilts/misc folder again). Otherwise, please look at the new note in the OP and let me know if that helps
 
Last edited:

LordInfernvs

New member
May 18, 2010
1
0
Porto
Code:
Applying change number 208102...
--> Subject:       "Adapt ijar for WSL"
--> Project path:  build/make
--> Change number: 208102 (Patch Set 208102)
['git fetch github', u'refs/changes/02/208102/3']
From https://github.com/LineageOS/android_build
 * branch            refs/changes/02/208102/3 -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
        tools/ijar/zip.cc
Please, commit your changes or stash them before you can merge.
Aborting
ERROR: git command failed

i'm getting this error, any advice?
 

Uldiniad

Senior Member
Mar 17, 2016
343
266
i'm getting this error, any advice?

It is saying you have saved changes in the file ijar.cc which is the file that is going to be modified by the cherry pick. So if you don't care about the changes you've made, just git reset --hard. If you want to have your tree matching upstream (don't care about any local changes being overwritten, repo forall -vc "git reset --hard")
 
Last edited:
  • Like
Reactions: LordInfernvs

SaberShip

Senior Member
May 15, 2017
54
62
Thanks @Uldiniad for your work here, it has been very helpful so far!

Using your instructions in the OP I've been able to make it further along in the Lineage 15.1 build process on WSL (build 17618 RS5) than before.

I'm currently running into some odd consistency issues, for example I can run a build and it might not be able to find file X (that I can verify exists) then I can "make clean" and start again from the "source build/envsetup.sh" without doing a "repo sync" or making any other changes and the problem will be completely different. The build might fail Immediately, or it might run awhile before hitting a snag with something seemingly simple (for example after 10 mins or so of building a "touch" command failed on me once).

Here's a silly one:
Code:
[ 10% 10372/96279] //external/libopus:libopus clang src/opus_multistream_encoder.c [arm]
FAILED: /mnt/s/Projects/Android/Clark-Lineage-Oreo/out/soong/.intermediates/external/libopus/libopus/android_arm_armv7-a-neon_cortex-a53.a57_shared_core/obj/external/libopus/src/opus_multistream_encoder.o
PWD=/proc/self/cwd /usr/bin/ccache prebuilts/clang/host/linux-x86/clang-4053586/bin/clang -c -Iexternal/libopus/include -Iexternal/libopus/src -Iexternal/libopus/silk -Iexternal/libopus/celt -Iexternal/libopus/silk/fixed -Iexternal/libopus -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -fno-exceptions -Wno-multichar -ffunction-sections -fdata-sections -funwind-tables -fstack-protector-strong -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -fno-short-enums -no-canonical-prefixes -DNDEBUG -g -Wstrict-aliasing=2 -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -DNDEBUG -UDEBUG -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -fdebug-prefix-map=$PWD/= -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -nostdlibinc -msoft-float -mfloat-abi=softfp -mfpu=neon -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -D__ARM_FEATURE_LPAE=1 -Iexternal/libcxx/include -Iexternal/libcxxabi/include -Isystem/core/include -Isystem/media/audio/include -Ihardware/libhardware/include -Ihardware/libhardware_legacy/include -Ihardware/ril/include -Ilibnativehelper/include -Iframeworks/native/include -Iframeworks/native/opengl/include -Iframeworks/av/include -isystem bionic/libc/arch-arm/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -Ilibnativehelper/include_deprecated -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Drestrict= -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -O2 -fno-math-errno -DOPUS_ARM_ASM -DOPUS_ARM_INLINE_ASM -DOPUS_ARM_MAY_HAVE_EDSP -DOPUS_ARM_INLINE_EDSP -DOPUS_ARM_MAY_HAVE_MEDIA -DOPUS_ARM_INLINE_MEDIA -DOPUS_HAVE_RTCD -DOPUS_ARM_MAY_HAVE_NEON -DOPUS_ARM_MAY_HAVE_NEON_INTR -DOPUS_ARM_PRESUME_NEON -DOPUS_ARM_INLINE_NEON -target arm-linux-androideabi -Bprebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin -fPIC -D_USING_LIBCXX -std=gnu99  -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -MD -MF /mnt/s/Projects/Android/Clark-Lineage-Oreo/out/soong/.intermediates/external/libopus/libopus/android_arm_armv7-a-neon_cortex-a53.a57_shared_core/obj/external/libopus/src/opus_multistream_encoder.o.d -o /mnt/s/Projects/Android/Clark-Lineage-Oreo/out/soong/.intermediates/external/libopus/libopus/android_arm_armv7-a-neon_cortex-a53.a57_shared_core/obj/external/libopus/src/opus_multistream_encoder.o external/libopus/src/opus_multistream_encoder.c
Can't read /proc/cpuinfo: No such file or directory
clang.real: error: unable to execute command: Segmentation fault (core dumped)
clang.real: error: clang frontend command failed due to signal (use -v to see invocation)
Android clang version 5.0.300080  (based on LLVM 5.0.300080)
Target: arm--linux-android
Thread model: posix
InstalledDir: prebuilts/clang/host/linux-x86/clang-4053586/bin
clang.real: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang.real: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang.real: note: diagnostic msg: /tmp/opus_multistream_encoder-2d41d9.c
clang.real: note: diagnostic msg: /tmp/opus_multistream_encoder-2d41d9.sh
clang.real: note: diagnostic msg:

********************
[ 10% 10381/96279] //frameworks/wilhelm/src:libopensles_helper clang handlers.c
ninja: build stopped: subcommand failed.
22:40:04 ninja failed with: exit status 1

#### failed to build some targets (25:59 (mm:ss)) ####

/proc/cpuinfo is an interesting choice... :eek:
My understanding is that the random nature of the errors is probably a WSL thing? I use WSL quite a bit for things other than building android and havn't run into any behavior like this yet. Do you have any suggestions or would I be better off going back to native Ubuntu for this?

Thanks.
 

Uldiniad

Senior Member
Mar 17, 2016
343
266
Thanks @Uldiniad for your work here, it has been very helpful so far!

Using your instructions in the OP I've been able to make it further along in the Lineage 15.1 build process on WSL (build 17618 RS5) than before.

I'm currently running into some odd consistency issues, for example I can run a build and it might not be able to find file X (that I can verify exists) then I can "make clean" and start again from the "source build/envsetup.sh" without doing a "repo sync" or making any other changes and the problem will be completely different. The build might fail Immediately, or it might run awhile before hitting a snag with something seemingly simple (for example after 10 mins or so of building a "touch" command failed on me once).

Here's a silly one:
Code:
[ 10% 10372/96279] //external/libopus:libopus clang src/opus_multistream_encoder.c [arm]
FAILED: /mnt/s/Projects/Android/Clark-Lineage-Oreo/out/soong/.intermediates/external/libopus/libopus/android_arm_armv7-a-neon_cortex-a53.a57_shared_core/obj/external/libopus/src/opus_multistream_encoder.o
PWD=/proc/self/cwd /usr/bin/ccache prebuilts/clang/host/linux-x86/clang-4053586/bin/clang -c -Iexternal/libopus/include -Iexternal/libopus/src -Iexternal/libopus/silk -Iexternal/libopus/celt -Iexternal/libopus/silk/fixed -Iexternal/libopus -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -fno-exceptions -Wno-multichar -ffunction-sections -fdata-sections -funwind-tables -fstack-protector-strong -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -fno-short-enums -no-canonical-prefixes -DNDEBUG -g -Wstrict-aliasing=2 -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -DNDEBUG -UDEBUG -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -fdebug-prefix-map=$PWD/= -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -nostdlibinc -msoft-float -mfloat-abi=softfp -mfpu=neon -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -D__ARM_FEATURE_LPAE=1 -Iexternal/libcxx/include -Iexternal/libcxxabi/include -Isystem/core/include -Isystem/media/audio/include -Ihardware/libhardware/include -Ihardware/libhardware_legacy/include -Ihardware/ril/include -Ilibnativehelper/include -Iframeworks/native/include -Iframeworks/native/opengl/include -Iframeworks/av/include -isystem bionic/libc/arch-arm/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -Ilibnativehelper/include_deprecated -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Drestrict= -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -O2 -fno-math-errno -DOPUS_ARM_ASM -DOPUS_ARM_INLINE_ASM -DOPUS_ARM_MAY_HAVE_EDSP -DOPUS_ARM_INLINE_EDSP -DOPUS_ARM_MAY_HAVE_MEDIA -DOPUS_ARM_INLINE_MEDIA -DOPUS_HAVE_RTCD -DOPUS_ARM_MAY_HAVE_NEON -DOPUS_ARM_MAY_HAVE_NEON_INTR -DOPUS_ARM_PRESUME_NEON -DOPUS_ARM_INLINE_NEON -target arm-linux-androideabi -Bprebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin -fPIC -D_USING_LIBCXX -std=gnu99  -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -MD -MF /mnt/s/Projects/Android/Clark-Lineage-Oreo/out/soong/.intermediates/external/libopus/libopus/android_arm_armv7-a-neon_cortex-a53.a57_shared_core/obj/external/libopus/src/opus_multistream_encoder.o.d -o /mnt/s/Projects/Android/Clark-Lineage-Oreo/out/soong/.intermediates/external/libopus/libopus/android_arm_armv7-a-neon_cortex-a53.a57_shared_core/obj/external/libopus/src/opus_multistream_encoder.o external/libopus/src/opus_multistream_encoder.c
Can't read /proc/cpuinfo: No such file or directory
clang.real: error: unable to execute command: Segmentation fault (core dumped)
clang.real: error: clang frontend command failed due to signal (use -v to see invocation)
Android clang version 5.0.300080  (based on LLVM 5.0.300080)
Target: arm--linux-android
Thread model: posix
InstalledDir: prebuilts/clang/host/linux-x86/clang-4053586/bin
clang.real: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang.real: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang.real: note: diagnostic msg: /tmp/opus_multistream_encoder-2d41d9.c
clang.real: note: diagnostic msg: /tmp/opus_multistream_encoder-2d41d9.sh
clang.real: note: diagnostic msg:

********************
[ 10% 10381/96279] //frameworks/wilhelm/src:libopensles_helper clang handlers.c
ninja: build stopped: subcommand failed.
22:40:04 ninja failed with: exit status 1

#### failed to build some targets (25:59 (mm:ss)) ####

/proc/cpuinfo is an interesting choice... :eek:
My understanding is that the random nature of the errors is probably a WSL thing? I use WSL quite a bit for things other than building android and havn't run into any behavior like this yet. Do you have any suggestions or would I be better off going back to native Ubuntu for this?

Thanks.

I've never seen that error. Main errors so far have been dex2oat hangs and bison/libc++.so related. Sadly, only Google can help on that one and I agree it is a very strange error.

Your understanding is correct. WSL is improving but it is most definitely not a replacement for any Linux distro. If people are looking for reliability, consistency and speed then I doubt anything will ever beat a clean hard drive installation of the distro. The only reason I made this article is because I believe I'm not alone in wishing I could build Android on Windows (in my case, it is because I dislike dual-booting and virtual machines). And, so far, building lineage-15.1 on WSL has had varying degrees of success (especially between the different preview builds). Sadly I cannot skip ahead to RedStone 5 (registered too late for the previews). I'd like to be on the bleeding edge so that I can pick up on the new errors in the builds that come with the changes made on the latest available builds.

In any case, if you have more insights or if you find fixes to the errors, please share them with us. And if you go back to native linux, then I understand ;)
Personally, the instability isn't bothering me enough to guarantee a dual-boot or vm :p
 
Last edited:

Uldiniad

Senior Member
Mar 17, 2016
343
266
Thanks @Uldiniad for your work here, it has been very helpful so far!

Using your instructions in the OP I've been able to make it further along in the Lineage 15.1 build process on WSL (build 17618 RS5) than before.

I'm currently running into some odd consistency issues, for example I can run a build and it might not be able to find file X (that I can verify exists) then I can "make clean" and start again from the "source build/envsetup.sh" without doing a "repo sync" or making any other changes and the problem will be completely different. The build might fail Immediately, or it might run awhile before hitting a snag with something seemingly simple (for example after 10 mins or so of building a "touch" command failed on me once).

Here's a silly one:
Code:
[ 10% 10372/96279] //external/libopus:libopus clang src/opus_multistream_encoder.c [arm]
FAILED: /mnt/s/Projects/Android/Clark-Lineage-Oreo/out/soong/.intermediates/external/libopus/libopus/android_arm_armv7-a-neon_cortex-a53.a57_shared_core/obj/external/libopus/src/opus_multistream_encoder.o
PWD=/proc/self/cwd /usr/bin/ccache prebuilts/clang/host/linux-x86/clang-4053586/bin/clang -c -Iexternal/libopus/include -Iexternal/libopus/src -Iexternal/libopus/silk -Iexternal/libopus/celt -Iexternal/libopus/silk/fixed -Iexternal/libopus -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -fno-exceptions -Wno-multichar -ffunction-sections -fdata-sections -funwind-tables -fstack-protector-strong -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -fno-short-enums -no-canonical-prefixes -DNDEBUG -g -Wstrict-aliasing=2 -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -DNDEBUG -UDEBUG -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -fdebug-prefix-map=$PWD/= -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -nostdlibinc -msoft-float -mfloat-abi=softfp -mfpu=neon -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -D__ARM_FEATURE_LPAE=1 -Iexternal/libcxx/include -Iexternal/libcxxabi/include -Isystem/core/include -Isystem/media/audio/include -Ihardware/libhardware/include -Ihardware/libhardware_legacy/include -Ihardware/ril/include -Ilibnativehelper/include -Iframeworks/native/include -Iframeworks/native/opengl/include -Iframeworks/av/include -isystem bionic/libc/arch-arm/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -Ilibnativehelper/include_deprecated -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Drestrict= -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -O2 -fno-math-errno -DOPUS_ARM_ASM -DOPUS_ARM_INLINE_ASM -DOPUS_ARM_MAY_HAVE_EDSP -DOPUS_ARM_INLINE_EDSP -DOPUS_ARM_MAY_HAVE_MEDIA -DOPUS_ARM_INLINE_MEDIA -DOPUS_HAVE_RTCD -DOPUS_ARM_MAY_HAVE_NEON -DOPUS_ARM_MAY_HAVE_NEON_INTR -DOPUS_ARM_PRESUME_NEON -DOPUS_ARM_INLINE_NEON -target arm-linux-androideabi -Bprebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin -fPIC -D_USING_LIBCXX -std=gnu99  -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -MD -MF /mnt/s/Projects/Android/Clark-Lineage-Oreo/out/soong/.intermediates/external/libopus/libopus/android_arm_armv7-a-neon_cortex-a53.a57_shared_core/obj/external/libopus/src/opus_multistream_encoder.o.d -o /mnt/s/Projects/Android/Clark-Lineage-Oreo/out/soong/.intermediates/external/libopus/libopus/android_arm_armv7-a-neon_cortex-a53.a57_shared_core/obj/external/libopus/src/opus_multistream_encoder.o external/libopus/src/opus_multistream_encoder.c
Can't read /proc/cpuinfo: No such file or directory
clang.real: error: unable to execute command: Segmentation fault (core dumped)
clang.real: error: clang frontend command failed due to signal (use -v to see invocation)
Android clang version 5.0.300080  (based on LLVM 5.0.300080)
Target: arm--linux-android
Thread model: posix
InstalledDir: prebuilts/clang/host/linux-x86/clang-4053586/bin
clang.real: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang.real: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang.real: note: diagnostic msg: /tmp/opus_multistream_encoder-2d41d9.c
clang.real: note: diagnostic msg: /tmp/opus_multistream_encoder-2d41d9.sh
clang.real: note: diagnostic msg:

********************
[ 10% 10381/96279] //frameworks/wilhelm/src:libopensles_helper clang handlers.c
ninja: build stopped: subcommand failed.
22:40:04 ninja failed with: exit status 1

#### failed to build some targets (25:59 (mm:ss)) ####

/proc/cpuinfo is an interesting choice... :eek:
My understanding is that the random nature of the errors is probably a WSL thing? I use WSL quite a bit for things other than building android and havn't run into any behavior like this yet. Do you have any suggestions or would I be better off going back to native Ubuntu for this?

Thanks.

I found this on WSL github. I think it might be related
https://github.com/Microsoft/WSL/issues/2925
 

SaberShip

Senior Member
May 15, 2017
54
62
I found this on WSL github. I think it might be related
https://github.com/Microsoft/WSL/issues/2925

Thanks for your help, as I understand the CPU Microcode is incorrect in the WSL /proc/cpuinfo. To my knowledge this has been this way for awhile. The build seems to be complaining that the file just out right doesn't exist. I'll definitely keep searching around and see if I can figure out whats going on. However, with the strange inconsistent behavior I'm seeing I may never run across the /proc/cpuinfo error again.

I can't complain though as I'm on a fairly early Windows Insider build... I'll update my Windows build to a later build soon and see if it helps at all and report back here.

On another note, my WSL install location is unchanged on my C-drive however I changed my build location to a separate SSD through the /mnt/driveletter/ directory. As most of my problems are random missing files in the build directory (that don't actually seem to be missing) I'm wondering, could using a separate drive in the /mnt directory cause some instabilities in WSL?
 

Uldiniad

Senior Member
Mar 17, 2016
343
266
Thanks for your help, as I understand the CPU Microcode is incorrect in the WSL /proc/cpuinfo. To my knowledge this has been this way for awhile. The build seems to be complaining that the file just out right doesn't exist. I'll definitely keep searching around and see if I can figure out whats going on. However, with the strange inconsistent behavior I'm seeing I may never run across the /proc/cpuinfo error again.

I can't complain though as I'm on a fairly early Windows Insider build... I'll update my Windows build to a later build soon and see if it helps at all and report back here.

On another note, my WSL install location is unchanged on my C-drive however I changed my build location to a separate SSD through the /mnt/driveletter/ directory. As most of my problems are random missing files in the build directory (that don't actually seem to be missing) I'm wondering, could using a separate drive in the /mnt directory cause some instabilities in WSL?

Lol, mnt is most definitely the issue here. Check my warnings on my OP
The only option you have if you don't want WSL on the same drive as Windows is to check their GitHub for moving WSL to other drives (I think someone else posted the name of the file in question in a previous post in this thread).
 
Last edited:
  • Like
Reactions: SaberShip

SaberShip

Senior Member
May 15, 2017
54
62
Lol, mnt is most definitely the issue here. Check my warnings on my OP
The only option you have if you don't want WSL on the same drive as Windows is to check their GitHub for moving WSL to other drives (I think someone else posted the name of the file in question in a previous post in this thread).

Thanks! Silly me I should have read the entire OP (I think I managed to read every line but that one xD) I feel stupid now. :silly:
Thanks again for your help I'll try moving my WSL to the other drive later today.
 

WinterR

Senior Member
May 11, 2014
229
142
20
Novi Pazar
Thank you very much for the guide, I successfully built RR for my device.
Unfortunately it took over 6 hours to complete! On Ubuntu OS on the same PC it takes a little less than 2 hours. Is this normal?
 
Last edited:

Uldiniad

Senior Member
Mar 17, 2016
343
266
Thank you very much for the guide, I successfully built RR for my device.
Unfortunately it took over 6 hours to complete! On Ubuntu OS on the same PC it takes a little less than 2 hours. Is this normal?

It is normal. When you say 6 hours you mean with a clean out directory right? Because it should take only a couple minutes both on native and WSL if you're not building from scratch.
I recommend to anyone looking for speed comparisons between WSL and native to check: https://www.phoronix.com/scan.php?page=article&item=wsl-february-2018&num=1
 
  • Like
Reactions: lucasguapo23

WinterR

Senior Member
May 11, 2014
229
142
20
Novi Pazar
It is normal. When you say 6 hours you mean with a clean out directory right? Because it should take only a couple minutes both on native and WSL if you're not building from scratch.
I recommend to anyone looking for speed comparisons between WSL and native to check: https://www.phoronix.com/scan.php?page=article&item=wsl-february-2018&num=1

Yes, with clean out directory. I have also noticed repo sync also taking a longer time. I guess it's because of slower I/O performance.
 

Uldiniad

Senior Member
Mar 17, 2016
343
266
Sad to announce that I am constantly running into hangs under Redstone 4. I'm looking into the issues but I can't promise that builds will be working by the time Redstone 4 is released. Brunch is hanging because of dex2oat and disabling dex2oat with the dexpreopt option is also causing hangs now.

If you want to make builds that complete, I recommend staying on Fall Creator's Update (build 16299) and using WITH_DEXPREOPT=false as a workaroud for the dex2oat issue.

I'm now on the Skip Ahead branch of the Insider builds (currently 17639) and it seems like the with_dexpreopt workaround still works. I have not yet found a fix for the dex2oat hangs though.
 
  • Like
Reactions: Mcenzie

volcano619

Senior Member
Sep 9, 2013
128
13
Hyderabad
What should i do in this
<project name="TheMuppets/proprietary_vendor_your_device_brand" path="vendor/your_device_brand"
remote="github" />
<remove-project name="platform/prebuilts/misc" />
<remove-project name="LineageOS/android_prebuilts_build-tools" />
<project name="Uldiniad/android_prebuilts_misc" path="prebuilts/misc" remote="github" />
<project name="Uldiniad/android_prebuilts_build-tools" path="prebuilts/build-tools" remote="github" />

to set it up for Xiaomi Mi3,device name is cancro
 

Uldiniad

Senior Member
Mar 17, 2016
343
266
What should i do in this
<project name="TheMuppets/proprietary_vendor_your_device_brand" path="vendor/your_device_brand"
remote="github" />
<remove-project name="platform/prebuilts/misc" />
<remove-project name="LineageOS/android_prebuilts_build-tools" />
<project name="Uldiniad/android_prebuilts_misc" path="prebuilts/misc" remote="github" />
<project name="Uldiniad/android_prebuilts_build-tools" path="prebuilts/build-tools" remote="github" />

to set it up for Xiaomi Mi3,device name is cancro

your device brand is xiaomi as you pointed out yourself. replace it with that
 
  • Like
Reactions: volcano619

fdgd1998

Senior Member
Apr 13, 2016
1,262
372
Vélez-Málaga, Málaga, Spain.
EDIT: It seems I managed to solve it.

Hey guys! I am trying to build LOS 15.1 for my HTC 10 (codename pme) but during the building process I obtain the following. I have searched online for it but I can found clear info about that.

Code:
3 warnings generated.
[ 4% 4871/99436] Lex: applypatch <= bootable/recovery/edify/lexer.ll
FAILED: /media/user/Archivos/android/lineage/out/target/product/pme/obj/STATIC_LIBRARIES/libedify_intermediates/lexer.cpp
/bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -o/media/user/Archivos/android/lineage/out/target/product/pme/obj/STATIC_LIBRARIES/libedify_intermediates/lexer.cpp 
bootable/recovery/edify/lexer.ll"
flex-2.5.39: loadlocale.c:130: nl_intern_locale_data: Assertion `cnt < (sizeof (nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
[ 4% 4876/99436] target StaticLib: li...IES/libv8src_intermediates/libv8src.a)
ninja: build stopped: subcommand failed.
00:41:13 ninja failed with: exit status 1
#### failed to build some targets (15:10 (mm:ss)) ####

I would be really grateful if someone can help me out.
 
Last edited:

Uldiniad

Senior Member
Mar 17, 2016
343
266
Hey guys! I am trying to build LOS 15.1 for my HTC 10 (codename pme) but during the building process I obtain the following. I have searched online for it but I can found clear info about that.

Code:
3 warnings generated.
[ 4% 4871/99436] Lex: applypatch <= bootable/recovery/edify/lexer.ll
FAILED: /media/user/Archivos/android/lineage/out/target/product/pme/obj/STATIC_LIBRARIES/libedify_intermediates/lexer.cpp
/bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -o/media/user/Archivos/android/lineage/out/target/product/pme/obj/STATIC_LIBRARIES/libedify_intermediates/lexer.cpp 
bootable/recovery/edify/lexer.ll"
flex-2.5.39: loadlocale.c:130: nl_intern_locale_data: Assertion `cnt < (sizeof (nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
[ 4% 4876/99436] target StaticLib: li...IES/libv8src_intermediates/libv8src.a)
ninja: build stopped: subcommand failed.
00:41:13 ninja failed with: exit status 1
#### failed to build some targets (15:10 (mm:ss)) ####

I would be really grateful if someone can help me out.

sounds like a locale issue. try adding this to bashrc file
Code:
export LC_ALL=C
 
  • Like
Reactions: fdgd1998

Top Liked Posts

  • There are no posts matching your filters.
  • 114
    Requirements
    https://source.android.com/setup/build/requirements#hardware-requirements
    https://docs.microsoft.com/en-us/windows/wsl/install-win10#install-the-windows-subsystem-for-linux
    https://docs.microsoft.com/en-us/windows/wsl/install-win10#update-to-wsl-2

    You may want to expand the default virtual disk size:
    https://docs.microsoft.com/en-us/wi...-the-size-of-your-wsl-2-virtual-hardware-disk

    Setting up a Windows Subsystem for Linux (WSL 2.0) build environment
    1. Open Microsoft Store
    2. Search for and install the Ubuntu app
    3. Open the app and follow the first-time setup steps
    4. Update packages and install the following (if building lineage-17.1, please refer to their documentation for other versions):
      Code:
      sudo apt update && sudo apt full-upgrade -y && sudo apt install -y build-essential ccache libncurses5 libssl-dev m4 unzip zip
    5. Make a directory for the source code (and go to it):
      Code:
      mkdir -p ~/android/lineage && cd android/lineage
    6. Initialize the LineageOS source repository:
      Code:
      repo init -u https://github.com/LineageOS/android.git -b lineage-17.1
    7. Sync the sources:
      Code:
      repo sync
    8. (Optional; Recommended) https://wiki.lineageos.org/devices/klte/build#turn-on-caching-to-speed-up-build
    9. Run
      Code:
      source build/envsetup.sh
    10. Prepare the device-specific code:
      Code:
      breakfast [I]your device codename[/I]
    11. Add the following to .repo/local_manifests/roomservice.xml:
      Code:
      <project name="TheMuppets/proprietary_vendor_[I]your device brand[/I]" path="vendor/[I]your device brand[/I]" remote="github" />
    12. Sync the sources again:
      Code:
      repo sync
    13. Start the build:
      Code:
      brunch [I]your device codename[/I]

    For future builds, you need to repeat steps 13 -> 10 -> 14 at the root of the tree
    21
    Useful resources

    Running a Desktop Environment
    https://github.com/microsoft/WSL/issues/4106#issuecomment-636446405

    Using mnt (consider performance https://github.com/microsoft/WSL/issues/4197):
    1. Create /etc/wsl.conf
    2. Add
    Code:
    [automount] options = "metadata"
    3. Run
    Code:
    wsl --shutdown
    from PowerShell
    After restarting wsl, make sure
    Code:
    mount -l | grep metadata
    shows your drvfs mounts with the metadata tag added.

    WSL2 install location: https://github.com/MicrosoftDocs/WSL/issues/412#issuecomment-575923176
    12
    WSL 2.0 is OUT, build all the droids!

    Hi all,

    Microsoft just released the Windows 10 May 2020 update. But the bigger news is that it comes with WSL2. The TLDR of it is that Windows now has a Linux kernel bundled with it and that's game changing. And what that means for us is out of the box / seamless linux-like functionality for all teh things (goodbye Lineage hax patches for WSL1).

    I have updated OP https://forum.xda-developers.com/showpost.php?p=75579631&postcount=1 and the useful resources post https://forum.xda-developers.com/showpost.php?p=75579631&postcount=2 with the latest information I have so far. Note that with wsl2 using mnt is a readily available option and the wsl installation location can easily be changed as well :) Lots more flexibility

    Lastly, wanted to say thanks to all for your patience. I started this project while I was in the middle of university. I did this "for fun" with the goal of seeing if compiling Android on Windows (via WSL) would be remotely possible and if I personally would be able to pull that off. Apparently, I did :p. Part of this work (added with other work I did with Lineage) allowed me to get the Android job I currently have and I'm grateful for it.
    I know WSL 1 was a bit of a pain to work with and that headaches and frustration came from it. The good news, is those days are over. And the future is now.

    If you have questions that are not answered already in other posts, send them through. I will be randomly checking the thread. Although given that wsl2 doesn't need anywhere near as much maintenance as wsl1 I will probably be more hands off than I used to be (e.g. update the docs for newer versions of Android or Windows, etc.).

    Take care,
    Uldiniad
    11
    Pie (wsl flavour) is out of the oven

    Hey everyone,

    TL;DR
    It is now possible to build lineage-16.0 on wsl! Just follow the updated guide from start to finish (syncing 16.0 on top of 15.1 is not recommended) and enjoy.
    DO NOT COMPLAIN ABOUT ANY ERRORS THAT ARE NOT STRICTLY DUE TO THE BUILD ENVIRONMENT (WSL). Many devices are not ready to build yet!

    Also, as always, I recommend building on the latest version of Windows. October Update was released recently: https://www.microsoft.com/en-ca/software-download/windows10

    For those still insterested in building 15.1 (ignore the repopick step): https://web.archive.org/web/2018061...ng/guide-how-to-build-lineageos-15-1-t3750175 (as mentioned in my previous announcement, do not report any errors, I will ignore them, since I do not have the means to maintain more than one branch on wsl)

    Full version:
    It has been some time since the last update. I apologise for the crickets.
    I didn't want to write a post until I was able to guarantee I could build lineage-16.0 without issues on wsl. I downloaded the sources as soon as they were released but was unable to complete a full build for my device without cherry-picking lots of patches for it and decided against it since I wanted to reduce the scope of the errors to the build environment alone. I only recently thought of building a generic image instead (which would accomplish what I wanted). Thankfully, wsl had less problems this time cause Google were cool with updating their bison and flex prebuilts (thereby now making them 64-bit) and killed off ijar (hopefully forever). So only dex2oat needed a patch this time around :D
    The wsl-compile-lineage-16.0 patches are merged (https://review.lineageos.org/#/q/st...h:lineage-16.0+topic:wsl-compile-lineage-16.0). So no additional steps required there. Otherwise, make sure to install m4 since it spat out an error about it missing.

    Thank you for your support,

    Uldiniad

    P.S. Feel free to ask any questions related to this and check my previous announcements to know my goals and standards for this side-project (https://forum.xda-developers.com/showpost.php?p=77321912&postcount=261 for example)
    P.P.S. I am working on making an official wiki page on the LineageOS website which will be more convenient than this thread. I might consider leaving the thread open for feedback once it is open, but I might also consider having feedback reported via official means (JIRA probably).
    6
    Want a piece of Pie?

    Hey everyone, got some news to share.

    As you may have heard, the Pie is now out of the oven. Given that,
    1. At the moment building android on WSL is 100% experimental
    2. There seems to be little to no interest from Google and Microsoft to officially support wsl as an android build environment
    3. I'm working alone with limited time and knowledge of both the android build environment and the inner workings of wsl
    4. I plan on supporting the latest version of lineage available
    I am therefore starting research and work on lineage-16.0 and will be leaving lineage-15.1 as it currently stands.
    As windows updates come, wsl will change and may bring new unforeseen errors to the oreo build environment. Since I will not be maintaing that branch anymore, it may mean that the best option to keep building 15.1 is to not update to the latest build of windows if it causes errors. Given this situation I will be paying less attention to bug reports for 15.1 as time goes by and 16.x takes its place (especially since I do not have 15.1 synced anymore and will not be able to reproduce errors).

    For 16.x, it entails I will proceed to ram my head into the wsl wall until it gives up or I do.

    Hoping we'll all get a piece of the Pie,

    Uldiniad
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone