Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile Android Open Source Project with Bash On Windows #1771

Closed
PikaChokeMe opened this issue Mar 12, 2017 · 20 comments
Closed

Can't compile Android Open Source Project with Bash On Windows #1771

PikaChokeMe opened this issue Mar 12, 2017 · 20 comments

Comments

@PikaChokeMe
Copy link

When trying to follow the AOSP build instructions for Sony devices under the "Build AOSP Nougat 7.1" section here https://developer.sonymobile.com/open-devices/aosp-build-instructions/how-to-build-aosp-nougat-for-unlocked-xperia-devices/#build-aosp-nougat-7-1
almost immediately after running make I am given

Running kati to generate build-aosp_e6853.ninja...
make: *** [out/build-aosp_e6853.ninja] Segmentation fault (core dumped)

I've stored what I believe to be the dump file output here https://gist.github.com/anonymous/18492035989c5761d596f1c39b26fffd, but it really doesn't seem like it contains anything useful.

I am on Windows Home, Version 1607 (OS Build 14393.693) and I can confirm that on a linux virtual machine the Android Open Source Project produces flash-able android system images without error.

I really wish I had more info about this problem, but I do not. I am however open to people's suggestions on how to collect and provide more information about the problem with instructions.

@therealkenc
Copy link
Collaborator

therealkenc commented Mar 12, 2017

strace -ff make 2> build.strace. Omit the -j <n>. Just looking at the build instructions though, g++-multilib and zlib1g-dev:i386 are probably going to bite you. If that turns out to be the problem (as with #1687) the User Voice is here.

@jakegt1
Copy link

jakegt1 commented Mar 15, 2017

Compiling with Java has issues on 14393, unsure whether this works on 14986 or later, but it's quite unlikely that anything that's compiling Java is going to work on 14393.

@MrObvious
Copy link

Why would 32 bit binaries be an "enhancement"? This would be necessary to compile Android ROMs, which is a workflow typically requiring Ubuntu. Isn't that part of the Bash project?

@aseering
Copy link
Contributor

I'm not on the WSL team personally (I'm just another user), but I bet it's an "enhancement" because it's a major and mostly standalone piece of functionality that many applications and frameworks don't require. And it's probably a real pain to implement :-)

WSL is effectively, as far as I can tell, reimplementing a kernel with the CONFIG_IA32_EMULATION kernel compile-time config flag disabled. This is a perfectly valid configuration for a Linux kernel, it substantially simplifies the kernel, and it works quite well with a large fraction of existing software and workflows. But it doesn't work with everything and it's not what Ubuntu does.

The Linux kernel has a lot of features. Some are used very frequently, some very rarely; some are easy to implement, others are much more work. I expect it will be many years, if ever, before the WSL team has finished providing an exact bug-for-bug-compatible reimplementation of all interfaces to the Linux kernel. So if your definition of a bug is any incompatibility, then basically everything in this ticket-tracker is a bug :-) If everything is a bug, then it's not really useful to say whether something is a bug or not, because the answer is "yes, it is a bug" :-) So the WSL team sometimes uses terms other than "bug" to convey information about where something currently resides in their priority queue.

@therealkenc
Copy link
Collaborator

therealkenc commented Mar 17, 2017

+1 for "... CONFIG_IA32_EMULATION kernel compile-time config flag disabled" explanation. Android development is the very epitome of a "Linux-first development use case scenario". At least as much as, say, CUDA, which is on the backlog.

That said, the upstream build requirements for Android are all open source, and there is nothing stopping people from contributing to Google and help bring the toolchain into the 21st century. So unlike say CUDA, this is completely solvable without Microsoft's help. And probably should be.

@kxzxxx
Copy link

kxzxxx commented Apr 8, 2017

I have success build LineageOS from WSL.
https://github.com/kxzxxx/android_build
Then, use flex, bison, python 64bit instead
But sometimes jack will hang. Just kill it then make again

@acrilique
Copy link

@kxzxxx mmm, I have LineageOS official code, how can I change from it to yours?
Also, how did you manage to use 64-bit flex, bison and python?
Thx

@kxzxxx
Copy link

kxzxxx commented May 5, 2017

@Maxee112 https://github.com/kxzxxx/android_prebuilts_misc
flex bison from here

@acrilique
Copy link

acrilique commented May 5, 2017

@kxzxxx If you are confortable with that, and if there isn't one, I'll create a post on XDA with all the details on how to build Lineageos in WSL via your repositories, it's gonna help a lot of people.

@kxzxxx
Copy link

kxzxxx commented May 7, 2017

@Maxee112 Do it as you wish.

@acrilique
Copy link

@kxzxxx changed lineageos/android_build and aosp prebuilts/misc on my local manifest by kxzxxx/android_build and kxzxxx/android_prebuilts_misc and i still get an error with flex and bison. Do I need to add something to ~/.bashrc?

@kxzxxx
Copy link

kxzxxx commented May 7, 2017

@Maxee112 I upload prebuilts flex bison in android_build. android_prebuilts_misc is not needed anymore

@acrilique
Copy link

@kxzxxx then just delete that line from manifest.xml or leave it as it was before making changes?

@kxzxxx
Copy link

kxzxxx commented May 7, 2017

@Maxee112 use lineageos default android_prebuilts_misc

@acrilique
Copy link

@kxzxxx Still get the same errors

@huckleberrypie
Copy link

What about TWRP? Has anyone successfully compiled one using WSL?

@onomatopellan
Copy link

@huckleberrypie On the "Build android from source on windows 10" thread in xda-developers forum there are people that confirm TWRP can be compiled on WSL. Just make sure the entire toolchain uses 64bit binaries.

@WSLUser
Copy link

WSLUser commented Jan 29, 2018

I have a major question, has anyone used any Android apps successfully after building the LineageOS or TWRP? How about Google Play?

@Uldiniad
Copy link

For those interested in building LineageOS 15.1 on Windows: https://forum.xda-developers.com/android/software-hacking/guide-how-to-build-lineageos-15-1-t3750175/post75579340#post75579340

@therealkenc
Copy link
Collaborator

therealkenc commented Feb 15, 2018

Thanks Uldiniad. It would still be nice to have a repro for the hang in #2948 on the books because I'm sure it is a valid issue not confined to LineageOS. The OP here was dupe #390 with User Voice here; so, like #1687 I'll mark it as such. I encourage everyone to up-vote 32-bit support (even if it goes against OCD inclinations) because it is important for Big Sky reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests