public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Questions about the build process
@ 2018-06-30  6:46 Michael Zimmermann
  2018-07-02  9:11 ` Gao, Liming
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Zimmermann @ 2018-06-30  6:46 UTC (permalink / raw)
  To: edk2-devel-01, Yonghong Zhu, Liming Gao

Out of curiosity I took a closer look at how the build system works
internall(especially the Makefile generation and parallel builds) and
I got some questions which I hope you can answer:

Why are we using make at all?
As far as I can see we're not using any special make functionality and
most dependency calculation is done in the python build tool anyway.
So why don't we just run the build commands ourselves from within the
build tool?

Why is every module being build separately / Why don't we generate one
makefile which does everything ?
To give an opposite view on the previous question, why don't we
generate makefiles which contain the whole internal dependency graph
so the build tool can then call a top level 'make' and not worry about
anything. We wouldn't even have to implement any kind of parallel
build support(which we currently have a lot of code for) because make
would do that for us.

If scrambled log output during parallel builds is a concern, then we
could switch to the "ninja" build system which would probably be way
more suited for edk2's usecase because it's a pretty fast low level
language which also gives you proper logs when building in parallel.
ninja is available for linux, mac and windows.

Thanks
Michael


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Questions about the build process
  2018-06-30  6:46 Questions about the build process Michael Zimmermann
@ 2018-07-02  9:11 ` Gao, Liming
  2018-07-02 11:15   ` Michael Zimmermann
  0 siblings, 1 reply; 3+ messages in thread
From: Gao, Liming @ 2018-07-02  9:11 UTC (permalink / raw)
  To: Michael Zimmermann, edk2-devel-01, Zhu, Yonghong

Michael:
  There is one bugzilia https://bugzilla.tianocore.org/show_bug.cgi?id=972 on top level makefile generation. Its purpose is to let the make utility figure out how to multi-thread the build and see whether there is the build performance improvement.
  
  Edk2 BaseTools generates AutoGen and Makefile for every module, then build module one by one. Every module has its own compiler flag, its included path, its AutoGen.h and AutoGen.c. So, the module level makefile is generated. 

  I don't use ninja before. Edk2 build has supported multiple thread build to trig Make in parallel. Does ninja improve build performance? 

Thanks
Liming
>-----Original Message-----
>From: Michael Zimmermann [mailto:sigmaepsilon92@gmail.com]
>Sent: Saturday, June 30, 2018 2:47 PM
>To: edk2-devel-01 <edk2-devel@lists.01.org>; Zhu, Yonghong
><yonghong.zhu@intel.com>; Gao, Liming <liming.gao@intel.com>
>Subject: [edk2] Questions about the build process
>
>Out of curiosity I took a closer look at how the build system works
>internall(especially the Makefile generation and parallel builds) and
>I got some questions which I hope you can answer:
>
>Why are we using make at all?
>As far as I can see we're not using any special make functionality and
>most dependency calculation is done in the python build tool anyway.
>So why don't we just run the build commands ourselves from within the
>build tool?
>
>Why is every module being build separately / Why don't we generate one
>makefile which does everything ?
>To give an opposite view on the previous question, why don't we
>generate makefiles which contain the whole internal dependency graph
>so the build tool can then call a top level 'make' and not worry about
>anything. We wouldn't even have to implement any kind of parallel
>build support(which we currently have a lot of code for) because make
>would do that for us.
>
>If scrambled log output during parallel builds is a concern, then we
>could switch to the "ninja" build system which would probably be way
>more suited for edk2's usecase because it's a pretty fast low level
>language which also gives you proper logs when building in parallel.
>ninja is available for linux, mac and windows.
>
>Thanks
>Michael

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Questions about the build process
  2018-07-02  9:11 ` Gao, Liming
@ 2018-07-02 11:15   ` Michael Zimmermann
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Zimmermann @ 2018-07-02 11:15 UTC (permalink / raw)
  To: Gao, Liming; +Cc: edk2-devel-01, Yonghong Zhu

Thanks for linking that issue. I'd really like to see that getting solved.

As for ninja: Yes it usually reduces build time a lot because unlike make
it uses a very simple and fast to parse language and handles threads
completely by its own(you don't have to tell it how many jobs to use).

Additionally it suppresses all build output and shows a nice progress bar.
If a subtask fails it'll print just the log of the failed subtask.

Thanks
Michael

On Mon, Jul 2, 2018, 11:11 AM Gao, Liming <liming.gao@intel.com> wrote:

> Michael:
>   There is one bugzilia https://bugzilla.tianocore.org/show_bug.cgi?id=972
> on top level makefile generation. Its purpose is to let the make utility
> figure out how to multi-thread the build and see whether there is the build
> performance improvement.
>
>   Edk2 BaseTools generates AutoGen and Makefile for every module, then
> build module one by one. Every module has its own compiler flag, its
> included path, its AutoGen.h and AutoGen.c. So, the module level makefile
> is generated.
>
>   I don't use ninja before. Edk2 build has supported multiple thread build
> to trig Make in parallel. Does ninja improve build performance?
>
> Thanks
> Liming
> >-----Original Message-----
> >From: Michael Zimmermann [mailto:sigmaepsilon92@gmail.com]
> >Sent: Saturday, June 30, 2018 2:47 PM
> >To: edk2-devel-01 <edk2-devel@lists.01.org>; Zhu, Yonghong
> ><yonghong.zhu@intel.com>; Gao, Liming <liming.gao@intel.com>
> >Subject: [edk2] Questions about the build process
> >
> >Out of curiosity I took a closer look at how the build system works
> >internall(especially the Makefile generation and parallel builds) and
> >I got some questions which I hope you can answer:
> >
> >Why are we using make at all?
> >As far as I can see we're not using any special make functionality and
> >most dependency calculation is done in the python build tool anyway.
> >So why don't we just run the build commands ourselves from within the
> >build tool?
> >
> >Why is every module being build separately / Why don't we generate one
> >makefile which does everything ?
> >To give an opposite view on the previous question, why don't we
> >generate makefiles which contain the whole internal dependency graph
> >so the build tool can then call a top level 'make' and not worry about
> >anything. We wouldn't even have to implement any kind of parallel
> >build support(which we currently have a lot of code for) because make
> >would do that for us.
> >
> >If scrambled log output during parallel builds is a concern, then we
> >could switch to the "ninja" build system which would probably be way
> >more suited for edk2's usecase because it's a pretty fast low level
> >language which also gives you proper logs when building in parallel.
> >ninja is available for linux, mac and windows.
> >
> >Thanks
> >Michael
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-02 11:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-30  6:46 Questions about the build process Michael Zimmermann
2018-07-02  9:11 ` Gao, Liming
2018-07-02 11:15   ` Michael Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox