<div dir="ltr">I have been successful in building the rtems-libbsd using 'python3 ./waf'. Although, I had to do some weird changes to some of the files in the libbsd package. (These changes were done as there were several build errors even after the 'python ./waf' command )<div><br></div><div>1. In the ../freebsd/sys/netinet/in_mcast.c and ../../freebsd/sys/netpfil/pf/if_pfsync.c files I had to change the IP_MIN_MEMBERSHIPS with IP_MAX_MEMBERSHIPS .</div><div><br></div><div>2. In the ../../freebsd/sys/netinet6/in6_mcast.c and .../freebsd/sys/netinet/ip_carp.c files I had to change IPV6_MIN_MEMBERSHIPS, to IPV6_MAX_MEMBERSHIPS,</div><div><br></div><div>3. In the ../testsuite/syscalls01/test_main.c I changed the IPPROTO_SEP to IPPROTO_EGP .</div><div><br></div><div>Now, I suspect that these changes will come back to bite me as I proceed further as I have simply overwritten them based on build error messages. It would be helpful if the community can provide its views on my changes and whether this is a bug or something that I am doing wrong.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 31, 2019 at 6:28 PM Christian Mauderer <<a href="mailto:list@c-mauderer.de">list@c-mauderer.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 31/12/2019 12:41, Utkarsh Rai wrote:<br>
> My host system has an x-86_64 architecture with ubuntu-18.04 running on<br>
> top of it, I have a python2 installed.<br>
> Interestingly enough, when I clean up the libbsd directory and try to<br>
> build as a super-user, I have two observations:-<br>
<br>
Please note that building as super user is generally not a good idea for<br>
any sane build environment. Although I have to say that in this case it<br>
provided an interesting error output ...<br>
<br>
> 1. The build fails with the following error message:-<br>
> [1/4] Creating<br>
> ///h/o/m/e///u/r/1/0///s/a/n/d/b/o/x///r/t/e/m/s/-/l/i/b/b/s/d///b/u/i/l/d///a/r/m/-/r/t/e/m/s/5/-/b/e/a/g/l/e/b/o/n/e/b/l/a/c/k/-/d/e/f/a/u/l/t/build-include/rtems/bsd/modules.h<br>
<br>
... here. That looks like some join went horrible wrong. I assume that<br>
there is some location in the build system where an array of paths<br>
should be joined but only one is given. Looks like a bug.<br>
<br>
> [2/4] Compiling rtemsbsd/rtems/generate_kvm_symbols<br>
> [3/4] Compiling testsuite/include/rtems/bsd/test/<a href="http://network-config.h.in" rel="noreferrer" target="_blank">network-config.h.in</a><br>
> <<a href="http://network-config.h.in" rel="noreferrer" target="_blank">http://network-config.h.in</a>><br>
> /bin/sh: 1:<br>
> .//home/ur10/sandbox/rtems-libbsd/rtemsbsd/rtems/generate_kvm_symbols:<br>
<br>
The ./ in front is a bit odd here. Looks like an absolute path which<br>
(for some reason) has been forced to be local...<br>
<br>
> not found<br>
> <br>
> Now I have checked, and the file in question is present at its location.<br>
> <br>
> 2. The traceback of the last calls is something like this:-<br>
> File<br>
> "/home/ur10/sandbox/rtems-libbsd/.waf-2.0.13-4c5a17779813574907c253ab5418388d/waflib/Build.py",<br>
> line 100, in execute_build<br>
> self.compile()<br>
> File<br>
> "/home/ur10/sandbox/rtems-libbsd/.waf-2.0.13-4c5a17779813574907c253ab5418388d/waflib/Build.py",<br>
> line 174, in compile<br>
> self.store()<br>
> File<br>
> "/home/ur10/sandbox/rtems-libbsd/.waf-2.0.13-4c5a17779813574907c253ab5418388d/waflib/Build.py",<br>
> line 153, in store<br>
> Utils.writef(db+'.tmp',x,m='wb')<br>
> File<br>
> "/home/ur10/sandbox/rtems-libbsd/.waf-2.0.13-4c5a17779813574907c253ab5418388d/waflib/Utils.py",<br>
> line 155, in writef<br>
> with open(fname,m)as f:<br>
> IOError: [Errno 2] No such file or directory:<br>
> u'/home/ur10/sandbox/rtems-libbsd/build/arm-rtems5-beagleboneblack-default/.wafpickle-linux2-34017264-20.tmp'<br>
> <br>
> If I am correct, this is a python exception for invalid file handling.<br>
> Since I have already removed the 'build' directory, I suppose the call<br>
> should be 'w+' or 'wb+' but this does not seem to be the case. (I am<br>
> going out on a limb with this assumption, I may be wrong !)<br>
<br>
You are right that it's a python exception. Most likely it's a follow up<br>
bug due to the wrong paths further up.<br>
<br>
> <br>
> It would be very helpful if you could provide your views on the problem<br>
> and as to how I should proceed to resolve this.<br>
> <br>
<br>
The solution is to find the bug in the path handling from further above.<br>
As a workaround could you try to use python3? Some string handling is<br>
different there so it might work or give a better error message. Just use<br>
<br>
python3 ./waf ...<br>
<br>
instead of only "waf" in every waf command line.<br>
<br>
> <br>
> On Mon, Dec 30, 2019 at 7:19 PM Christian Mauderer <<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a><br>
> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>>> wrote:<br>
> <br>
> On 28/12/2019 18:43, Utkarsh Rai wrote:<br>
> > Hi,<br>
> > While building the rtems-libbsd as described here<br>
> ><br>
> <<a href="https://devel.rtems.org/browser/rtems-libbsd/README.waf?rev=b83012a9f9f1551d9d223c3126d0f43aba79db62" rel="noreferrer" target="_blank">https://devel.rtems.org/browser/rtems-libbsd/README.waf?rev=b83012a9f9f1551d9d223c3126d0f43aba79db62</a>> I<br>
> > was able to successfully configure the waf file as:-<br>
> > waf configure<br>
> > --prefix="/home/ur10/sandbox/rtems/5"<br>
> > --rtems-bsps=arm/beagleboneblack<br>
> > --buildset=buildset/default.ini <br>
> > But the build fails on the "waf" instruction with the error - "Could<br>
> > not create the directory ///h".<br>
> > My path for the build is PATH="~/sandbox/rtems/bin:$PATH", with the<br>
> > tools and the rtems-libbsd in the sandbox directory. <br>
> > It would be very kind of you if someone could point out as to what<br>
> is it<br>
> > that I am doing wrong.<br>
> > Thank You, Regards.<br>
> <br>
> Hello Utkarsh Rai,<br>
> <br>
> I now have seen that bug about two or three times on the list. But I've<br>
> never been able to reproduce it. What host system are you using? Do you<br>
> have a python2 or a python3 as default python?<br>
> <br>
> Sometimes it works to clean up the libbsd directory. Remove the "build"<br>
> directory and the ".waf2..." or ".waf3..." directory. Also remove any<br>
> "__pycache__" directories.<br>
> <br>
> >From your call it seems that you use waf from your host system. Can you<br>
> try to use the waf version delivered with libbsd instead (using "./waf<br>
> configure ...")?<br>
> <br>
> Best regards<br>
> <br>
> Christian<br>
> <br>
</blockquote></div>