[Xorp-hackers] Problems with Mkdir

Bruce Simpson bms at incunabulum.net
Fri Dec 4 09:47:25 PST 2009


Ben Greear wrote:
> On 12/04/2009 09:09 AM, Bruce Simpson wrote:
>> Ben Greear wrote:
>>> On 12/04/2009 06:28 AM, Bruce Simpson wrote:
>>>> ...and promptly backed out again, the cure is worse than the disease.
>>>> :-(
>>> Well, try compiling it on Linux. The problem happened every time for me
>>> (first build attempt works, the rest fail until 'obj' is blown away.
>>>
>>> Did you try my code as I posted, ie w/out the 'fixups' ?
>>
>> I did not -- mkdirs() looked like a mis-spelling of makedirs(), so this
>> code wouldn't have run anyway.
>
> You're right about mkdirs.  I changed it to makedirs and it gets
> farther on Fedora 8 (with your previous patch applied).
>
> Now it's complaining about something else:
>
> Checking for C library pcap... yes
> Checking for C function pcap_sendpacket()... yes
> Checking for C library curses... yes
> Detected libraries: boost_regex rt resolv crypto dl pcap curses
> Symlink("/home/greearb/git/xorp.ct/obj/x86_64-unknown-linux-gnu/lib", 
> as "/home/greearb/git/xorp.ct/obj/x86_64-unknown-linux-gnu/lib/xorp/lib")
> RuntimeError: Unexpected arguments:
>   File "/home/greearb/git/xorp.ct/SConstruct", line 644:
>     env.Dir('$xorp_sbindir').abspath))
>   File "/home/greearb/git/xorp.ct/relpath.py", line 13:
>     raise RuntimeError("Unexpected arguments")

OK, this is good, we know that the monkey-patching works, however the 
replacement implementation of relpath() is too naive.

relpath() is being used here to evaluate RPATHs upfront before they get 
passed down to the SConstructs.
It is exploiting the fact that if the absolute path of the binary is 
deeper than the lib path, os.path.relpath() (in Python 2.6) will return 
a path of the form ../../lib.

Try this one, it's a bit smarter.

Still researching Mkdir() issue.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: relpath2.diff
Url: http://mailman.ICSI.Berkeley.EDU/pipermail/xorp-hackers/attachments/20091204/94b6dbd6/attachment-0001.ksh 


More information about the Xorp-hackers mailing list