yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] PGHammer:
If you are using Docker and the latest version of Ubuntu, you need Docker for Ubuntu 19.04 - not 19.10. It will still work; however, it must be pulled specifically from the Docker repositories via its GPG key. Do a search on Installing Docker for Ubuntu 19.04; that is how I solved my own Docker woes. (I have a similar suspiscion with Ubuntu 19.10; software that is not available/ready for 19.10 yet).

---------- Post added at 05:12 PM ---------- Previous post was at 04:52 PM ----------

WSL 2 is out; I am, in fact, using it.

The issue may be a dependency - not a "flaw" in 19.xx or even in WSL 2. (For Docker, for example, it is not available for 19.10; you must use Docker for 19.04 instead, and it has to be pulled via its GPG key - it will install, despite this particular oddity.)

Further, WSL 2 does not use Hyper-V at all; it does, however, require SLAT (paravirtualization) - as does VirtualBox 6 and later. While Hyper-V itself requires SLAT, there are products that use paravirtualization that don't work under Hyper-V (most Android emulators - including the one in Android Studio - fail if Hyper-V is active). Please; don't confuse Hyper-V and paravirtualization - they aren't the same thing.

Unless you NEED Hyper-V for other reasons (and - as I just pointed out, WSL 2 isn't one of them), turn it off (you don't need it for either paravirtulization or SLAT - which ARE the same thing) in Control Panel

---------- Post added at 05:44 PM ---------- Previous post was at 05:12 PM ----------

For WSL 2, make sure that Hyper-V is turned off; it doesn't need it. What it DOES need is SLAT (hardware virtualization support, AKA paravirtualization). You can have SLAT without Hyper-V; in fact. HAXM requires SLAT/paravirtualization to work; however, it fails if Hyper-V is active (I tripped over this because I gamed on Android emulators before getting my feet wet in ROM building - and they all failed if Hyper-V was active). VirtualBox 6 also requires paravirtualization/SLAT support - and fails if Hyper-V is active; unless you need Hyper-V for other reasons, turn it off.

SLAT/paravirtualization is not only not a new feature, it's been available rather far down the processor chain. On the Intel side, while it started with the Core CPUs, it migrated down to the Pentium-G over a decade ago; the most infamous such as the PentiumG 3258 (AKA G3258); I use this CPU as the "core" of my current desktop. AMD (with AMD-V) stated the migration even earlier, with Athlon II, Sempron, and Turion. While Hyper-V requires paravirtualization support, it is not the same thing, as you can use paravirtualization support without it - as VirtualBox 6 (and WSL 2) happily demonstrate - this IS a change, as before these two products, Hyper-V was the only way to leverage SLAT.
[Android Software/Hacking General [Developers Only]] Uldiniad:
thanks for all the info :) I'll make sure to link to your post when I update the OP. wsl 2 is out but only on insider previews. I'm waiting for it to be released on regular update channels with update 20H1 since I don't like using insider previews on my personal machine.
[Android Software/Hacking General [Developers Only]] Ippfcox:
Hi, did you have solved this problem? I got absolutely the same error. please help!

---------- Post added at 03:17 PM ---------- Previous post was at 03:16 PM ----------

Hi, did you have solved this problem? I got absolutely the same error. please help!
[Android Software/Hacking General [Developers Only]] Uldiniad:
did you read the warnings in my guide? Do NOT use mnt, it will likely result in failures.

it is telling you that it's permission denied. it doesn't have read and/or write permissions to that folder.
[Android Software/Hacking General [Developers Only]] Uldiniad:
https://xdaforums.com/showpost.php?p=80287033&postcount=519
[Android Software/Hacking General [Developers Only]] trunapushpa:
I only have around 120gb free in C drive, any suggestions for what I can use rather than mnt.

Dont want to dual boot just for building LineageOS

Edit: Probably installing wsl on another drive should work. Will try that.
[Android Software/Hacking General [Developers Only]] NowifeBetterlife:
Lineage 17 compiles fine using wsl2 on 19041 build. It compiles pretty fast too compared to wsl1.
[Android Software/Hacking General [Developers Only]] vladilog:
Workaround: On Windows, change permissions to the base folder (D:\lineageos\android\lineage in your case) and make it writable for "Everyone".

I was able to repo sync successfully on my D drive. Not sure if other issues will arrive when building as OP clearly advises not to use /mnt.
[Android Software/Hacking General [Developers Only]] trunapushpa:
Oh nice one. btw I moved the WSL installation to D drive.
[Android Software/Hacking General [Developers Only]] Mata99:
I'm trying to build lineage os 17.1 for oneplus3, but I have this errors, how can I fix?

matteo@DESKTOP-3M5FC5O:~/android/lineage$ brunch oneplus3
10:11:24 Build sandboxing disabled due to nsjail error.
Looking for dependencies in device/oneplus/oneplus3
Looking for dependencies in device/oppo/common
device/oppo/common has no additional dependencies.
Looking for dependencies in kernel/oneplus/msm8996
kernel/oneplus/msm8996 has no additional dependencies.
10:11:33 Build sandboxing disabled due to nsjail error.

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
LINEAGE_VERSION=17.1-20200319-UNOFFICIAL-oneplus3
TARGET_PRODUCT=lineage_oneplus3
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.4.0-18362-Microsoft-x86_64-Ubuntu-18.04.4-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QQ2A.200305.003
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=vendor/oneplus/oneplus3 device/oneplus/oneplus3 vendor/nxp/opensource/pn5xx hardware/qcom-caf/msm8996
============================================
10:11:49 Build sandboxing disabled due to nsjail error.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
LINEAGE_VERSION=17.1-20200319-UNOFFICIAL-oneplus3
TARGET_PRODUCT=lineage_oneplus3
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.4.0-18362-Microsoft-x86_64-Ubuntu-18.04.4-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QQ2A.200305.003
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=vendor/oneplus/oneplus3 device/oneplus/oneplus3 vendor/nxp/opensource/pn5xx hardware/qcom-caf/msm8996
============================================
10:11:53 soong minibootstrap failed with: exit status 1
FAILED: ninja: ./build/blueprint/bootstrap/build.ninja:11: loading 'out/soong/.minibootstrap/build-globs.ninja': Exec format error
subninja ${myGlobs}
^ near here

#### failed to build some targets (19 seconds) ####
[Android Software/Hacking General [Developers Only]] akashk07:
Compilation/building on WSL2?

Hey bro,

What about WSL2?

Have you tried building lineage OS via WSL2?

Also, isn't it fine if we have only 8 gb of RAM?
[Android Software/Hacking General [Developers Only]] Technical:
Did anybody find a solution for this error? Searching like crazy in the internet and (yet) nothing. Thanks.
[Android Software/Hacking General [Developers Only]] LeddaZ:
It's a WSL 1 issue, upgrade to WSL 2: https://docs.microsoft.com/en-us/windows/wsl/wsl2-install
[Android Software/Hacking General [Developers Only]] Technical:
I did this on the weekend, but didn't have time to test it yet.
[Android Software/Hacking General [Developers Only]] kevind06:
Hi masemoel,

Do you succeed to build lineage fo the h815 ?
[Android Software/Hacking General [Developers Only]] Uldiniad:
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
[Android Software/Hacking General [Developers Only]] Technical:
The "problem" to build ROMs on WSL2 is that - besides using fuse to make the file system caps sensitive, which is easy - apparently some ROMs use files with names that contain forbidden characters in Windows (like : and ?). A workaround is to use btrfs file system with Windows.

Anyway, thanks for your hard work.
[Android Software/Hacking General [Developers Only]] Hinfty:
Thanks for the great and simple guide. Helped me a lot to get everything running.

But I can only get to 98% when building and then run into a lack of memory error:

"Exception in thread "main" java.lang.OutOfMemoryError: Java heap space"

I've increased the swap to 32GB (step by step), as I'm only running on 8GB of mem.

I've also tried to increase heap through this (step by step):

export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx30GB"

But I'm not sure it's the right command for Lineage 17.1 building.

Can someone assist, please?

Device: Oneplus2

Version: Lineageos 17.1

WSL2, running on separate disk at 200Gb virtual disk size, +30Gb free on Win
[Android Software/Hacking General [Developers Only]] th3_gunn3r:
Thanks sir.
[Android Software/Hacking General [Developers Only]] kallum7:
Has anyone attempted this for the OnePlus one or for lineage os 17
[Android Software/Hacking General [Developers Only]] NowifeBetterlife:
Oops. Didn't read about the swap part.

I had the same issue, but increasing swap fixed the issue for my device.
[Android Software/Hacking General [Developers Only]] erad1:
I have installed wsl2 but have a problem when syncing a rom build repo.

It crashes and the distro (ubuntu 18 and 20) just closes after syncing about 85%. I've tried running on a separate disk with 400gb available and have 180gb space available on Windows so it's confusing as to why. I have also tried un/re-installing wsl2 but no change, never gets past syncing a repo.
[Android Software/Hacking General [Developers Only]] Nouty:
I solved this problem by following all the settings in this tutorial. (https://www.christitus.com/wsl2)

Video: https://www.youtube.com/watch?v=VUW2pIjDpEk
[Android Software/Hacking General [Developers Only]] Ritvikx1998:
Hey! Were you able to solve this?
[Android Software/Hacking General [Developers Only]] Uldiniad:
That error is specific to your device, I can't help much with that.

I'd recommend you start with this:

make clobber

breakfast oneplus3 && make bacon WITH_DEXPREOPT=false

If it doesn't help. you'd have to search on google about the error and check on forums of people making unofficial builds for oneplus3 on lineage-15.1 branch and possibly post there. Alternatively, you can go on LineageOS chat room on IRC https://webchat.freenode.net/?channels=lineageos-dev and ask about the error there.
[Android Software/Hacking General [Developers Only]] Uldiniad:
Once again, clang is saying it can't find libc++.so, wanna check again that it hasn't disappeared?

When I run builds it isn't crashing like this since I put back libc++.so in the prebuilts/misc repo.

Otherwise, for some reason for your build you'll have to put libc++.so in whatever folder clang is expecting it and that should solve the issue you're seeing
[Android Software/Hacking General [Developers Only]] Uldiniad:
what build number of windows where you on? I was on 16299 (Fall Creator's Update)
[Android Software/Hacking General [Developers Only]] Mcenzie:
I'm Insider on 17618. Maybe this is the probleme.

Today I make Ubuntu and los 15.1 new.
[Android Software/Hacking General [Developers Only]] balajiasmartguy:
Can someone help me build oreo aosp from google source in a detailed manned with the mentioned tutorial?

BTM i am a newbie in building rom.

Thanks In Advance!
[Android Software/Hacking General [Developers Only]] Uldiniad:
I've never built aosp because I don't like aosp. So I can't help much and won't make a guide for aosp.

What I can do is give you some advice. Everyone's been a noob, and as I've said in previous posts, in modding communities, you're generally on your own. Lots of googling, lots of mistakes (and learning from them) and some scattered help from people on places like this, IRC, etc.

The only thing I can help with is the 64-bit files you'll need for making builds. So I recommend you fork the repos that I forked (you can check my GitHub to see which ones I forked) from aosp and lineage and make sure you fork them from aosp only. Once you have your forked repos from aosp, cherrypick my commits to your branch (you'll also need to modify ijar like in the commit I repopick). Then sync the aosp source code and put your repos in your roomservice.xml.

That's all, now time to go on your quest.

Don't let the dragons bite
[Android Software/Hacking General [Developers Only]] Uldiniad:
I can confirm I have the same issues you have when I am on builds after 16299. So I'll be looking to fix that for newer builds (especially since redstone 4 is coming next month)
[Android Software/Hacking General [Developers Only]] Mcenzie:
OK let me know that.
[Android Software/Hacking General [Developers Only]] Uldiniad:
It looks like it is now solved for 17123 too (not sure at what point after 16299 it broke). I've replaced the previous bison, flex and libc++.so in prebuilts/misc today and reuploaded them to GitHub. The error appears rarely and relaunching the build seems to fix it (at least, it works for me).
[Android Software/Hacking General [Developers Only]] Mcenzie:
So now i'm on 17623. When I sync whitout sudo commands i become this :

Fetching projects: 14% (89/634) error: cannot open /home/mcenzie/android/lineage/.repo/projects/prebuilts/lineage-sdk.git/FETCH_HEAD: Permission denied

error: Cannot fetch platform/prebuilts/misc

error: Cannot fetch LineageOS/android_prebuilts_lineage-sdk

error: Exited sync due to fetch errors

With sudo it finished. Is that normaly?!

Next...

source build/envsetup.sh && repopick 208102

mcenzie@DESKTOP-6H0IEPU:~/android/lineage$ source build/envsetup.sh && repopick 208102

including device/generic/car/vendorsetup.sh

including device/generic/mini-emulator-arm64/vendorsetup.sh

including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh

including device/generic/mini-emulator-x86_64/vendorsetup.sh

including device/generic/mini-emulator-x86/vendorsetup.sh

including device/generic/uml/vendorsetup.sh

including vendor/lineage/vendorsetup.sh

including sdk/bash_completion/adb.bash

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']

error: cannot open .git/FETCH_HEAD: Permission denied

Traceback (most recent call last):

File "/home/mcenzie/android/lineage/vendor/lineage/build/tools/repopick.py", line 401, in <module>

if result != 0 and os.stat(FETCH_HEAD).st_size != 0:

OSError: [Errno 2] No such file or directory: 'build/make/.git/FETCH_HEAD'

with sudo :

mcenzie@DESKTOP-6H0IEPU:~/android/lineage$ sudo source build/envsetup.sh && repopick 208102

sudo: source: command not found

There is a way to get full access to all files whithout sudo commands?
[Android Software/Hacking General [Developers Only]] Uldiniad:
just change the permission to the files/folders with chmod (can google it). I personally chmod -R 777 --verbose at /android/lineage
[Android Software/Hacking General [Developers Only]] Mcenzie:
Ok thansk again.

It doesn´t work again.

With and without make bacon WITH_DEXPREOPT=false

[ 99% 1446/1447] glob bionic/libc/kernel/uapi/linux/**/*.h

[ 2% 2769/98369] build /home/mcenzie/android/lineage/out/target/produc...lus3/obj/ETC/nonplat_mac_permissions.xml_intermediates/nonplat_keys.tm

FAILED: /home/mcenzie/android/lineage/out/target/product/oneplus3/obj/ETC/nonplat_mac_permissions.xml_intermediates/nonplat_keys.tmp

/bin/bash -c "m4 -s device/qcom/sepolicy/ssg/keys.conf system/sepolicy/reqd_mask/keys.conf > /home/mcenzie/android/lineage/out/target/product/oneplus3/obj/ETC/nonplat_mac_permissions.xml_intermediates/nonplat_keys.tmp"

/bin/bash: m4: command not found

[ 2% 2778/98369] APK certs list: /home/mcenzie/android/lineage/out/tar...CKAGING/apkcerts_intermediates/lineage_oneplus3-apkcerts-81305b7998.tx

ninja: build stopped: subcommand failed.

16:51:01 ninja failed with: exit status 1

#### failed to build some targets (07:28 (mm:ss)) ####
[Android Software/Hacking General [Developers Only]] Uldiniad:
it is saying that m4 command is not found. maybe try apt-get install m4, see if that helps?
[Android Software/Hacking General [Developers Only]] alincl:
Unable to locate...

I followed the instructions, but after the first command i got this output:

Can you help, please?
[Android Software/Hacking General [Developers Only]] alincl:
I ran the command as root already, so no sudo required.

The fix I found is another one: ht tps://unix.stackexchange .com/questions/140119/every-package-has-no-installation-candidate

Basically, edit /etc/apt/sources.list to add more repos.

Then, I ran into other problems:

1. the xml code at step 8 isn't complete; it returns a parsing error message - for me this one worked:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="TheMuppets/Asus_Z00A" path="Asus/Z00A" 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" />
</manifest>

2. at steps 12 and 13 I'm not sure what <your device codename> should look like (in my case, I guess Asus_Z00A?)

3. my Ubuntu is installed on Windows 10 C: partition (not that I had a choice) and I guess the 44 GB free space left might not be enough (?)... so, bummer...
[Android Software/Hacking General [Developers Only]] Uldiniad:
on step 8 I said that you must add the following lines to the roomservice.xml if it exists and that otherwise you must make one. so step 8 is not incomplete.

44GB will most likely not be enough. I recommend a 256GB SSD with windows 64-bit and the least applications possible on it

I don't know what your device's codename is for lineage, you'll have to check their wiki or github
[Android Software/Hacking General [Developers Only]] Uldiniad:
the patch you linked is a patch made by kxzxxx (GitHub). I cherrypicked it to lineage-15.1. I put it as part of the steps (the repopick step). So your build environment already has that patch (which is necessary and is a WSL issue not a lineage issue) if you're following the instructions every time. Meaning repeating the repo sync, then the source build envsetup, the repopick and finally the brunch. I got some libc++.so errors but generally when launching brunch again it keeps going without throwing the error again
[Android Software/Hacking General [Developers Only]] Uldiniad:
Redstone 4 builds currently hanging

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.
[Android Software/Hacking General [Developers Only]] Hinfty:
This issue, yes.

I can't confirm this builds completely, because I had unrelated HDD problems,

but definitely check out the answers here:

https://stackoverflow.com/questions/60468693/java-outofmemoryerror-when-building-aosp-10
[Android Software/Hacking General [Developers Only]] thundercracker:
I'm guessing this messes up OTA of the official LOS releases, right?
[Android Software/Hacking General [Developers Only]] Uldiniad:
wsl was introduced in windows 10
[Android Software/Hacking General [Developers Only]] Uldiniad:
making your own unofficial builds is not compatible with running the official builds
[Android Software/Hacking General [Developers Only]] masemoel:
Yes. It was my hardware fault; I had to disable SSE 4.2 features.

Are you trying to build as well? (sorry I read you a bit late)
[Android Software/Hacking General [Developers Only]] M4Master96:
Building LineageOS 15.1 for oneplus2

hey [MENTION=7350242]Uldiniad[/MENTION] Thanks for this tutorial. I was facing "You are attempting to build with an unsupported JDK. Only an OpenJDK based JDK is supported". The issue was due to multiple java installations.

Executed:

$JAVA_HOME/bin/javac -version

Which showed that java was still pointing to oracle installation.

Ubuntu WSL was pointing JAVA_HOME to java-8-oracle even after making changes in /etc/environment and changing update-alternatives for java and javac.

As a solution, added

JAVA_HOME="/usr/lib/jvm/jdk1.8.0_212/"

in

.profile

and then executed 'source ~/.profile' and that solved the issue.