[GUIDE] How to build Android on Windows

Search This thread

Uldiniad

Senior Member
Mar 17, 2016
346
269
Have you succeeded in building using wsl2? I end up with clang errors. I am running the 1901.1 build.


error: prebuilts/clang/host/linux-x86/Android.bp:17:1: unrecognized module type "llvm_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:24:1: unrecognized module type "llvm_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:32:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:42:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:52:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:62:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:72:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:82:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:92:1: unrecognized module type "libclang_rt_llndk_library"
error: prebuilts/clang/host/linux-x86/Android.bp:102:1: unrecognized module type "libclang_rt_llndk_library"
error: prebuilts/clang/host/linux-x86/Android.bp:112:1: unrecognized module type "libclang_rt_llndk_library"
error: prebuilts/clang/host/linux-x86/Android.bp:122:1: unrecognized module type "libclang_rt_llndk_library"
error: prebuilts/clang/host/linux-x86/Android.bp:132:1: unrecognized module type "libclang_rt_llndk_library"
error: prebuilts/clang/host/linux-x86/Android.bp:142:1: unrecognized module type "libclang_rt_llndk_library"
error: prebuilts/clang/host/linux-x86/Android.bp:152:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:166:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:180:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:194:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:208:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:222:1: unrecognized module type "libclang_rt_prebuilt_library_shared"
error: prebuilts/clang/host/linux-x86/Android.bp:236:1: unrecognized module type "libclang_rt_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:250:1: unrecognized module type "libclang_rt_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:264:1: unrecognized module type "libclang_rt_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:278:1: unrecognized module type "libclang_rt_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:292:1: unrecognized module type "libclang_rt_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:306:1: unrecognized module type "libclang_rt_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:320:1: unrecognized module type "libclang_rt_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:331:1: unrecognized module type "libclang_rt_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:342:1: unrecognized module type "libclang_rt_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:353:1: unrecognized module type "libclang_rt_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:364:1: unrecognized module type "libclang_rt_prebuilt_library_static"
error: prebuilts/clang/host/linux-x86/Android.bp:375:1: unrecognized module type "libclang_rt_prebuilt_library_static"
ninja: build stopped: subcommand failed.
13:57:02 soong bootstrap failed with: exit status 1
build/make/core/main.mk:21: recipe for target 'run_soong_ui' failed

I haven't tried yet with 2.0. have run out of disk space. I am waiting to upgrade my computer before tinkering with it again, but as I have said before it should work out of the box. are you sure you installed all the required packages? some have reported that they were able to successfully compile on wsl 2. make sure to sync the latest changes too since sometimes Lineage don't have some patches merged and errors like this happen
 

99degree

Member
Apr 4, 2017
40
7
Code:
root@LAPTOP-U14A2O0E:~/android/lineage# source build/envsetup.sh
root@LAPTOP-U14A2O0E:~/android/lineage# breakfast marlin
[W][2019-11-18T13:46:28+0800][144] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:28+0800][144] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
Looking for dependencies in device/google/marlin
Looking for dependencies in kernel/google/marlin
kernel/google/marlin has no additional dependencies.
[W][2019-11-18T13:46:29+0800][226] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:29+0800][226] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
LINEAGE_VERSION=17.0-20191118-UNOFFICIAL-marlin
TARGET_PRODUCT=lineage_marlin
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=kryo
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=kryo
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.19.79-microsoft-standard-x86_64-Ubuntu-18.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QP1A.191105.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/google/marlin vendor/google/camera hardware/google/pixel
============================================
root@LAPTOP-U14A2O0E:~/android/lineage# brunch marlin
[W][2019-11-18T13:46:48+0800][329] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:48+0800][329] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
Looking for dependencies in device/google/marlin
Looking for dependencies in kernel/google/marlin
kernel/google/marlin has no additional dependencies.
[W][2019-11-18T13:46:49+0800][411] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:49+0800][411] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
LINEAGE_VERSION=17.0-20191118-UNOFFICIAL-marlin
TARGET_PRODUCT=lineage_marlin
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=kryo
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=kryo
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.19.79-microsoft-standard-x86_64-Ubuntu-18.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QP1A.191105.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/google/marlin vendor/google/camera hardware/google/pixel
============================================
[W][2019-11-18T13:46:53+0800][506] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:53+0800][506] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
LINEAGE_VERSION=17.0-20191118-UNOFFICIAL-marlin
TARGET_PRODUCT=lineage_marlin
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=kryo
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=kryo
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.19.79-microsoft-standard-x86_64-Ubuntu-18.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QP1A.191105.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/google/marlin vendor/google/camera hardware/google/pixel
============================================
[W][2019-11-18T13:46:54+0800][600] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:54+0800][600] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
[100% 1/1] out/soong/.minibootstrap/minibp out/soong/.bootstrap/build.ninja
FAILED: out/soong/.bootstrap/build.ninja
out/soong/.minibootstrap/minibp -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/.bootstrap/build.ninja.d -globFile out/soong/.minibootstrap/build-globs.ninja -o out/soong/.bootstrap/build.ninja Android.bp
error removing abandoned files: log entry has too few fields: "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
FAILED: [W][2019-11-18T13:46:54+0800][604] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:54+0800][604] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
13:46:54 soong minibootstrap failed with: exit status 1

#### failed to build some targets (5 seconds) ####

root@LAPTOP-U14A2O0E:~/android/lineage#

Any suggestion, sir?
 

ArcherTanu

Senior Member
Jan 5, 2015
138
108
Kolkata
error.jpg
Code:
 im getting this...when trying to build with wsl 1.0 win win 1909
 

Uldiniad

Senior Member
Mar 17, 2016
346
269
Code:
root@LAPTOP-U14A2O0E:~/android/lineage# source build/envsetup.sh
root@LAPTOP-U14A2O0E:~/android/lineage# breakfast marlin
[W][2019-11-18T13:46:28+0800][144] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:28+0800][144] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
Looking for dependencies in device/google/marlin
Looking for dependencies in kernel/google/marlin
kernel/google/marlin has no additional dependencies.
[W][2019-11-18T13:46:29+0800][226] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:29+0800][226] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
LINEAGE_VERSION=17.0-20191118-UNOFFICIAL-marlin
TARGET_PRODUCT=lineage_marlin
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=kryo
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=kryo
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.19.79-microsoft-standard-x86_64-Ubuntu-18.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QP1A.191105.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/google/marlin vendor/google/camera hardware/google/pixel
============================================
root@LAPTOP-U14A2O0E:~/android/lineage# brunch marlin
[W][2019-11-18T13:46:48+0800][329] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:48+0800][329] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
Looking for dependencies in device/google/marlin
Looking for dependencies in kernel/google/marlin
kernel/google/marlin has no additional dependencies.
[W][2019-11-18T13:46:49+0800][411] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:49+0800][411] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
LINEAGE_VERSION=17.0-20191118-UNOFFICIAL-marlin
TARGET_PRODUCT=lineage_marlin
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=kryo
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=kryo
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.19.79-microsoft-standard-x86_64-Ubuntu-18.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QP1A.191105.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/google/marlin vendor/google/camera hardware/google/pixel
============================================
[W][2019-11-18T13:46:53+0800][506] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:53+0800][506] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
LINEAGE_VERSION=17.0-20191118-UNOFFICIAL-marlin
TARGET_PRODUCT=lineage_marlin
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=kryo
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=kryo
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.19.79-microsoft-standard-x86_64-Ubuntu-18.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QP1A.191105.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/google/marlin vendor/google/camera hardware/google/pixel
============================================
[W][2019-11-18T13:46:54+0800][600] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:54+0800][600] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
[100% 1/1] out/soong/.minibootstrap/minibp out/soong/.bootstrap/build.ninja
FAILED: out/soong/.bootstrap/build.ninja
out/soong/.minibootstrap/minibp -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/.bootstrap/build.ninja.d -globFile out/soong/.minibootstrap/build-globs.ninja -o out/soong/.bootstrap/build.ninja Android.bp
error removing abandoned files: log entry has too few fields: "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
FAILED: [W][2019-11-18T13:46:54+0800][604] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-18T13:46:54+0800][604] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
13:46:54 soong minibootstrap failed with: exit status 1

#### failed to build some targets (5 seconds) ####

root@LAPTOP-U14A2O0E:~/android/lineage#

Any suggestion, sir?

your environment seems odd. I haven't seen cmdline::logparams lines before nor microsoft standard in HOST_OS_EXTRA. is this wsl 2.0?
 

99degree

Member
Apr 4, 2017
40
7
your environment seems odd. I haven't seen cmdline::logparams lines before nor microsoft standard in HOST_OS_EXTRA. is this wsl 2.0?

yes, it is. Win 10 -- v19030.1 fast ring. and not sure if build system need a custom device branch or something. So I did with crosshatch below, it seemed a lot worse. Or I missing something.

BTW, within my limited knowledge, it looked like the new build system binary runs with nsjail(docker like container env), but the wsl2 kernel does not support some nsjail(docker) feature. if this is true, then it likely missing CONFIG_USER_NS in kernel build. thus not able to do virtual root other than UID/EUID=0. it seemed nsjail --disable_clone_newcgroup can help a bit, but not sure. detail https://github.com/google/nsjail/issues/111

Code:
root@LAPTOP-U14A2O0E:~/android/lineage# breakfast crosshatch
[W][2019-11-26T17:13:59+0800][10370] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-26T17:13:59+0800][10370] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
build/make/core/product_config.mk:223: error: Can not locate config makefile for product "lineage_crosshatch".
17:13:59 dumpvars failed with: exit status 1
Device crosshatch not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Found repository: android_device_google_crosshatch
Default revision: lineage-17.0
Checking branch info
Checking if device/google/crosshatch is fetched from android_device_google_crosshatch
Adding dependency: LineageOS/android_device_google_crosshatch -> device/google/crosshatch
Using default branch for android_device_google_crosshatch
Syncing repository to retrieve project.

... A new repo command ( 1.26) is available.
... You should upgrade soon:

    cp /root/android/lineage/.repo/repo/repo /root/bin/repo

remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Enumerating objects: 1082, done.
remote: Counting objects: 100% (1082/1082), done.
^Cerror: Cannot fetch LineageOS/android_device_google_crosshatch from https://github.com/LineageOS/android_device_google_crosshatch
Fetching projects: 100% (1/1) LineageOS/android_device_google_crosshatchaborted by user
Repository synced!
Looking for dependencies in device/google/crosshatch
device/google/crosshatch has no additional dependencies.
Done
[W][2019-11-26T17:14:14+0800][10460] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-26T17:14:14+0800][10460] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
build/make/core/product_config.mk:223: error: Can not locate config makefile for product "lineage_crosshatch".
17:14:14 dumpvars failed with: exit status 1
[W][2019-11-26T17:14:20+0800][10519] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-26T17:14:20+0800][10519] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
build/make/core/product_config.mk:223: error: Can not locate config makefile for product "lineage_crosshatch".
17:14:20 dumpvars failed with: exit status 1

** Don't have a product spec for: 'lineage_crosshatch'
** Do you have the right repo manifest?

root@LAPTOP-U14A2O0E:~/android/lineage#
 
Last edited:

Uldiniad

Senior Member
Mar 17, 2016
346
269
yes, it is. Win 10 -- v19030.1 fast ring. and not sure if build system need a custom device branch or something. So I did with crosshatch below, it seemed a lot worse. Or I missing something.

BTW, within my limited knowledge, it looked like the new build system binary runs with nsjail(docker like container env), but the wsl2 kernel does not support some nsjail(docker) feature. if this is true, then it likely missing CONFIG_USER_NS in kernel build. thus not able to do virtual root other than UID/EUID=0. it seemed nsjail --disable_clone_newcgroup can help a bit, but not sure. detail https://github.com/google/nsjail/issues/111

Code:
root@LAPTOP-U14A2O0E:~/android/lineage# breakfast crosshatch
[W][2019-11-26T17:13:59+0800][10370] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-26T17:13:59+0800][10370] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
build/make/core/product_config.mk:223: error: Can not locate config makefile for product "lineage_crosshatch".
17:13:59 dumpvars failed with: exit status 1
Device crosshatch not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Found repository: android_device_google_crosshatch
Default revision: lineage-17.0
Checking branch info
Checking if device/google/crosshatch is fetched from android_device_google_crosshatch
Adding dependency: LineageOS/android_device_google_crosshatch -> device/google/crosshatch
Using default branch for android_device_google_crosshatch
Syncing repository to retrieve project.

... A new repo command ( 1.26) is available.
... You should upgrade soon:

    cp /root/android/lineage/.repo/repo/repo /root/bin/repo

remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Enumerating objects: 1082, done.
remote: Counting objects: 100% (1082/1082), done.
^Cerror: Cannot fetch LineageOS/android_device_google_crosshatch from https://github.com/LineageOS/android_device_google_crosshatch
Fetching projects: 100% (1/1) LineageOS/android_device_google_crosshatchaborted by user
Repository synced!
Looking for dependencies in device/google/crosshatch
device/google/crosshatch has no additional dependencies.
Done
[W][2019-11-26T17:14:14+0800][10460] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-26T17:14:14+0800][10460] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
build/make/core/product_config.mk:223: error: Can not locate config makefile for product "lineage_crosshatch".
17:14:14 dumpvars failed with: exit status 1
[W][2019-11-26T17:14:20+0800][10519] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files
[W][2019-11-26T17:14:20+0800][10519] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files
build/make/core/product_config.mk:223: error: Can not locate config makefile for product "lineage_crosshatch".
17:14:20 dumpvars failed with: exit status 1

** Don't have a product spec for: 'lineage_crosshatch'
** Do you have the right repo manifest?

root@LAPTOP-U14A2O0E:~/android/lineage#

the nsjconf stuff seems to be talking about root. could it be that it says that because you're running as root user and not a normal user? I've never seen this when I run lunch and such.
the actual errors that matter are Can not locate config makefile for product "lineage_crosshatch". that's because of missing dependencies. might need muppets for example
 

durgaprasadu

New member
Nov 6, 2019
4
0
Raspberry pi 3 build failing

Hi Thanks for providing the source.
When iam using lunch or breakfast command not able to find raspberry pi 3 device code name.
If explicitly providing name of raspberry board build is failing.
 

rituj_b

Recognized Developer
Nov 26, 2012
1,040
1,602
Jaipur
I need some help, I followed the instructions to the T, however I receive this error:

MSI:~/android/lineage$ brunch enchilada
22:39:45 Build sandboxing disabled due to nsjail error. This may become fatal in the future.
22:39:45 Please let us know why nsjail doesn't work in your environment at:
22:39:45 https://groups.google.com/forum/#!forum/android-building
22:39:45 https://issuetracker.google.com/issues/new?component=381517
Looking for dependencies in device/oneplus/enchilada
Looking for dependencies in device/oneplus/sdm845-common
Looking for dependencies in kernel/oneplus/sdm845
kernel/oneplus/sdm845 has no additional dependencies.
Looking for dependencies in packages/resources/devicesettings
packages/resources/devicesettings has no additional dependencies.
22:39:52 Build sandboxing disabled due to nsjail error. This may become fatal in the future.
22:39:52 Please let us know why nsjail doesn't work in your environment at:
22:39:52 https://groups.google.com/forum/#!forum/android-building
22:39:52 https://issuetracker.google.com/issues/new?component=381517

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
LINEAGE_VERSION=17.0-20190919-UNOFFICIAL-enchilada
TARGET_PRODUCT=lineage_enchilada
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.4.0-18356-Microsoft-x86_64-Ubuntu-18.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QP1A.190711.020
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES= device/oneplus/sdm845-common hardware/qcom/audio-caf/sdm845 hardware/qcom/display-caf/sdm845 hardware/qcom/media-caf/sdm845
============================================
22:40:40 Build sandboxing disabled due to nsjail error. This may become fatal in the future.
22:40:40 Please let us know why nsjail doesn't work in your environment at:
22:40:40 https://groups.google.com/forum/#!forum/android-building
22:40:40 https://issuetracker.google.com/issues/new?component=381517
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
LINEAGE_VERSION=17.0-20190919-UNOFFICIAL-enchilada
TARGET_PRODUCT=lineage_enchilada
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.4.0-18356-Microsoft-x86_64-Ubuntu-18.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QP1A.190711.020
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES= device/oneplus/sdm845-common hardware/qcom/audio-caf/sdm845 hardware/qcom/display-caf/sdm845 hardware/qcom/media-caf/sdm845
============================================
FAILED: ninja: ./build/blueprint/bootstrap/build.ninja:11: loading 'out/soong/.minibootstrap/build-globs.ninja': Exec format error
subninja ${myGlobs}
^ near here
22:40:42 soong minibootstrap failed with: exit status 1

#### failed to build some targets (48 seconds) ####


Any advice or ideas?
I am getting the exact same error, I even PM'ed you, please reply.
 

-Androider-

Member
Nov 22, 2019
23
9
I am getting the exact same error, I even PM'ed you, please reply.

I'm getting this error too and therefore can't finish my LOS 17 build. Seems to be a common issue, if you want to build Android 10 (LOS 17) with wsl 1.0.

I assume I/we have to wait for wsl 2.0 to get released publicly or join the windows insider program ( which I don't want to do). I hope it finally works with wsl 2.0 in april/may. Disappointing I know, but there semms to be no other solution.
 

Uldiniad

Senior Member
Mar 17, 2016
346
269
I'm getting this error too and therefore can't finish my LOS 17 build. Seems to be a common issue, if you want to build Android 10 (LOS 17) with wsl 1.0.

I assume I/we have to wait for wsl 2.0 to get released publicly or join the windows insider program ( which I don't want to do). I hope it finally works with wsl 2.0 in april/may. Disappointing I know, but there semms to be no other solution.

you are correct. those are the available options. I've already announced I was not going to spend the effort supporting android 10 (lineage 17) on wsl 1.0
 

AlwaysLucky

Senior Member
Oct 2, 2014
388
228
Just wanted to say thanks! Great tutorial and saved me some headaches with the 64-bit bison and flex. And you still are supporting this tutorial which is exactly what XDA needs more of.

I can also confirm that you can easily access the linux subsystem file system on WSL 2 by simply navigating to \\wsl$ in Windows itself. Very convenient.

Going to try my first unofficial compile later this week and I'll bug you if I get errors I can't figure out :p
 

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    Useful resources




    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://xdaforums.com/showpost.php?p=75579631&postcount=1 and the useful resources post https://xdaforums.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://xdaforums.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