<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 20, 2020 at 11:33 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 20/04/2020 19:58, Joel Sherrill wrote:<br>
<br>
><br>
><br>
> On Mon, Apr 20, 2020 at 12:20 PM Sebastian Huber <br>
> <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a> <br>
> <mailto:<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>>> wrote:<br>
><br>
> On 20/04/2020 19:04, Vijay Kumar Banerjee wrote:<br>
><br>
> > On Sun, Apr 19, 2020 at 8:16 PM Sebastian Huber<br>
> > <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
> <mailto:<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>><br>
> > <mailto:<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
> <mailto:<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>>>> wrote:<br>
> ><br>
> > On 19/04/2020 15:38, Gedare Bloom wrote:<br>
> ><br>
> >> On Sun, Apr 19, 2020 at 3:52 AM Vijay Kumar<br>
> Banerjee<<a href="mailto:vijay@rtems.org" target="_blank">vijay@rtems.org</a> <mailto:<a href="mailto:vijay@rtems.org" target="_blank">vijay@rtems.org</a>>> <br>
> <mailto:<a href="mailto:vijay@rtems.org" target="_blank">vijay@rtems.org</a> <mailto:<a href="mailto:vijay@rtems.org" target="_blank">vijay@rtems.org</a>>> wrote:<br>
> >>> Hi,<br>
> >>><br>
> >>> While trying to build the examples with a fresh pull from<br>
> upstream,<br>
> >>> I got the following build error from gccdeps:<br>
> >>><br>
> >>> ```<br>
> >>> Build failed<br>
> >>> Traceback (most recent call last):<br>
> >>> File<br>
> "//home/lunatic/development/rtems-examples//.waf-2.0.19-1f3c580272b15a03d2566843c5fe872a/waflib/Task.py",<br>
> line 190, in process<br>
> >>> self.post_run()<br>
> >>> File<br>
> "/home/lunatic/development/rtems-examples/rtems_waf/gccdeps.py",<br>
> line 144, in post_run<br>
> >>> raise ValueError('could not find %r for %r' % (x, self))<br>
> >>> ValueError: could not find ['filesystem', 'fat_ramdisk',<br>
> 'fs-root-tar.h'] for<br>
> >> It's doing an error check to find the build dependency<br>
> fs-root-tar.h,<br>
> >> which gets generated in the build directory by bin2c. This<br>
> has always<br>
> >> been tricky to handle in waf. I don't grok the way Chris<br>
> reworked the<br>
> >> rootfs support in the example so I don't immediately see<br>
> the root<br>
> >> (hah) problem or how to try to fix it.<br>
> ><br>
> ><br>
> > Hi,<br>
> ><br>
> > I figured out that the tar is generating properly but the error<br>
> check<br>
> > is failing<br>
> > because it's looking for the fs-root-tar.h file in the source file<br>
> > directory but the<br>
> > header file is being generated in the build directory.<br>
> ><br>
> > Just manually copying the header file to the source directory<br>
> makes it<br>
> > happy<br>
> > and the build works fine. Do we want to generate the header file in<br>
> > the source<br>
> > directory as well and maybe add it in gitignore?<br>
> ><br>
> > The other approach can be to tell gccdeps to check for the files in<br>
> > the build<br>
> > directory instead. I did it with a workaround like the<br>
> following, and<br>
> > it works fine:<br>
> > ```<br>
> > diff --git a/gccdeps.py b/gccdeps.py<br>
> > index bfabe72..61d9bfd 100644<br>
> > --- a/gccdeps.py<br>
> > +++ b/gccdeps.py<br>
> > @@ -141,7 +141,10 @@ def post_run(self):<br>
> > node = path_to_node(path, x, cached_nodes)<br>
> ><br>
> > if not node:<br>
> > - raise ValueError('could not find %r for<br>
> %r' %<br>
> > (x, self))<br>
> > + x =<br>
> > os.path.relpath(str(bld.bldnode)).split('/') + x<br>
> > + node = path_to_node(path, x, cached_nodes)<br>
> > + if not node:<br>
> > + raise ValueError('could not find %r for<br>
> > %r' % (x, self))<br>
> > if id(node) == id(self.inputs[0]):<br>
> > # ignore the source file, it is already<br>
> in the<br>
> > dependencies<br>
> > # this way, successful config tests may be<br>
> > retrieved from the cache<br>
> > ```<br>
> ><br>
> > If it doesn't look too hackish, then I'll post a patch. This<br>
> shouldn't<br>
> > break anything else<br>
> > and I'll surely add comments there about the use case of taking<br>
> this<br>
> > approach.<br>
> ><br>
> > Does it look right?<br>
> I encountered the same error while writing the new build system. I<br>
> think<br>
> this issue can be fixed with a proper dependency chain in waf.<br>
> Patching<br>
> the generic gccdeps.py is not the way to go if you ask me.<br>
><br>
><br>
> You could alternatively copy the rootfs base files to the build <br>
> directory and<br>
> do the tar from there. Source directory stays clean.<br>
We don't have to reinvent the wheel. We could copy the wscript of the <br>
new build system to the examples and add a couple of specification <br>
items. Building test programs is really not that much different to <br>
building applications.<br></blockquote><div>Just to make sure I understood correctly: Do you suggest that we replace</div><div>the rtems_waf in examples with the wscript similar to the new build system?</div><div>The tar and the *-tar.c file is generating properly using the rtems_waf.rootfs</div><div>the issue here is that the gccdeps isn't searching for the *-tar.h file in the build</div><div>build directory where it's being created, instead it's looking for it in the source</div><div>directory. Since the *-tar.c file is also being built from the build/ directory, will</div><div>it not be possible to build the init.c from the build directory as well? This won't</div><div>require any modification to the gccdeps and probably just some tweaking in the</div><div>wsript of the filesystems examples.</div></div></div>