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

Make compile time faster #1

Closed
guysoft opened this issue Oct 9, 2017 · 9 comments
Closed

Make compile time faster #1

guysoft opened this issue Oct 9, 2017 · 9 comments

Comments

@guysoft
Copy link
Owner

guysoft commented Oct 9, 2017

Compile time can easily reach up to 12 hours. The way to do this would be to build the kernel in the vm, and only then chroot with qemu. But CustomPiOSs architecture would not allow that.

@robiwano
Copy link

robiwano commented Feb 7, 2018

But this is compiling on a Raspberry Pi, right ? Hmm... it would be so nice to be able to cross compile :)

@guysoft
Copy link
Owner Author

guysoft commented Feb 7, 2018

Its compiling using qemu, as stated in the CustomPiOS README. You dont need a raspberrypi.
Its still slow because its compiling using emulation, but you can use a stronger virtual machine.

@robiwano
Copy link

robiwano commented Feb 7, 2018

I see. But is there a reason why the cross-compilation tools aren't used instead ?

@guysoft
Copy link
Owner Author

guysoft commented Feb 7, 2018

Yes, because cross-compiling means you have to have a separate toolchain. Lets say you want to build this on windows, mac, linux32 bit. linux with different versions of GCC, you will have to support all of that. This way the toolchain is what is on the Raspberrypi.
CustomPiOS does much more than just compiling, it ships a distribution.

The cost of a single compile toolchain is that the compilation can take a long time.
The gain is:

  1. You can stack the resulting base-image, like I am doing now in ZynthianOS.
  2. Its easy for people using different machines to contribute.
  3. Its deterministic

You could technically build a separate system to compile kernels and maintain it against RealtimePi, and have RealtimePi use the kernels from there. But good luck with that. I have no time for it or support all system configurations.

What I can suggest is have a local environment to compile and test kernels, and use RealtimePi when you want a deterministic compilation environment that you can ship those kernels.

I hope its a good answer to "why?".

@robiwano
Copy link

robiwano commented Feb 7, 2018

It indeed is. Thanks.

@robiwano
Copy link

robiwano commented Feb 7, 2018

Ah, damn. For others to know: It is not possible to build on WSL (Win 10), because of the lack of the "loop" module (and probably other issues as well), so I'll be resorting to a VM to do this.

@guysoft
Copy link
Owner Author

guysoft commented Mar 8, 2018

@robiwano See guysoft/CustomPiOS#22 , I am really close to getting the build running on windows. I in fact got it to build, just need to formalize it.

@guysoft
Copy link
Owner Author

guysoft commented Jan 24, 2019

Docker build should now let you build on windows. It should also help compile time because its one virtualization less. Still cross-compile via qemu is slower than native tools. But I am not sure if there is a way around it other than supplying a completely separate toolchain.

@guysoft
Copy link
Owner Author

guysoft commented Dec 12, 2019

Ok, this seems to be solved, or have a workaround. The docker image now supported building on arm32v7. Which is how the nightly builds are built. The compile time went down from ~16 hours to only 2! So I am closing this unless someone wants to talk about amd64 o different arches specifically.

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

2 participants