Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

LV2
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Syllable Forum Index -> Bugs - Fixed
View previous topic :: View next topic  
Author Message
daste



Joined: 26 Nov 2007
Posts: 53

PostPosted: Tue May 11, 2010 2:57 pm    Post subject: LV2 Reply with quote

Hi all,

back to porting stuff, this time it is LV2core time, but I'm having problems. Recipe first (LV2core-3.0.recipe):

authors Stefano D'Angelo
status contributed

headline Core LV2 specification
description
LV2 is a standard for plugins and matching host applications, primarily targeted at audio processing and generation.

LV2 is a successor to LADSPA, created to address the limitations of LADSPA which many applications have outgrown. Compared to LADSPA, all plugin data is moved from the code to a separate data file, and the code has been made as generic as possible. As a result, LV2 can be independently extended (retaining compatibility wherever possible), and virtually any feasible plugin features can be implemented in an LV2 plugin.

More information about LV2 can be found at <http://lv2plug.in>.
licenses LGPL BSD
home lv2plug.in
locations http://lv2plug.in/spec
packages lv2core-3.0

build-needs
Python

configure ./waf configure --prefix=/resources/LV2core --lv2dir=/system/extensions/lv2

make ./waf build

install ./waf install

documentation AUTHORS COPYING ChangeLog INSTALL README

Now, this "builds" fine (except for a harmless "make clean" fail at the beginning), but when installing waf fails saying:

Cannot create folder /resources/LV2core/include/

It seems like the following Python code in waf doesn't work on Syllable:

def check_dir(dir):
try:
os.stat(dir)
except OSError:
try:
os.makedirs(dir)
except OSError:
fatal("Cannot create folder "+dir)

(using python-2.5.1)

I tried to build Python-2.6.4, but the configuration fails saying that getaddrinfo() is buggy (and to use --disable-ipv6).

What should I do?
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Tue May 11, 2010 5:07 pm    Post subject: Reply with quote

Cool, thanks! I hope to get to your recipes soon.

But eek! What's waf? It's seriously subverting the regular build procedures.

Did you build Python with Builder? On Syllable 0.6.6? I ported Python 2.6.4 and 3.1.1 half a year ago and I'm fairly sure it was working.

Did waf create /resources/LV2core/ ? If not, just add an "install-tree" by itself to the recipe.
Back to top
View user's profile Send private message Visit poster's website
daste



Joined: 26 Nov 2007
Posts: 53

PostPosted: Tue May 11, 2010 5:49 pm    Post subject: Reply with quote

"But eek! What's waf? It's seriously subverting the regular build procedures."

http://code.google.com/p/waf/ - I personally don't like it, but for some mysterious reason many audio-related things use it.

"Did you build Python with Builder? On Syllable 0.6.6? I ported Python 2.6.4 and 3.1.1 half a year ago and I'm fairly sure it was working."

Yes, on Syllable 0.6.6 by doing:

build Python-2.6.4

"Did waf create /resources/LV2core/ ? If not, just add an "install-tree" by itself to the recipe."

Yes, that was created.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Thu May 13, 2010 4:36 pm    Post subject: Reply with quote

When I ported Python 2.6.4 I was working on Syllable 0.6.5. I'm on 0.6.6 now, and building Python now indeed produces the error you got. So it seems to be a regression from Syllable 0.6.5 to 0.6.6, most probably due to the GLibC upgrade from 2.4 to 2.7.

I disabled IPv6 in the Python recipes. 2.6.4 Then produces another build failure, but 2.5.1 still works, after modernising the recipe. Could you update your Builder tree and build a new python-2.5.1 to see if that helps?

I'm moving this to Bugs.
Back to top
View user's profile Send private message Visit poster's website
daste



Joined: 26 Nov 2007
Posts: 53

PostPosted: Fri May 14, 2010 7:56 am    Post subject: Reply with quote

"Could you update your Builder tree and build a new python-2.5.1 to see if that helps?"

Tried that, same problem.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Fri May 14, 2010 12:58 pm    Post subject: Reply with quote

That's a pity. I'm afraid you'll have to trace this at a deeper level to debug it. Waf is a complete build system written in Python, so it's likely that it needs to be ported to Syllable before it works correctly. It's also possible that there's a bug in our Python port, or even deeper, in GLibC for example.

You seem to have an isolated part of Python where things go wrong, with very basic file functions, so that should be fairly easy to use as an example to test further.
Back to top
View user's profile Send private message Visit poster's website
daste



Joined: 26 Nov 2007
Posts: 53

PostPosted: Sat May 15, 2010 11:48 pm    Post subject: Reply with quote

"That's a pity. I'm afraid you'll have to trace this at a deeper level to debug it. Waf is a complete build system written in Python, so it's likely that it needs to be ported to Syllable before it works correctly. It's also possible that there's a bug in our Python port, or even deeper, in GLibC for example.

You seem to have an isolated part of Python where things go wrong, with very basic file functions, so that should be fairly easy to use as an example to test further."

I'll try to see what I can do if it doesn't take me too much time, otherwise I will just make the recipe install the output files in the right places.
Back to top
View user's profile Send private message
daste



Joined: 26 Nov 2007
Posts: 53

PostPosted: Sun May 16, 2010 4:44 am    Post subject: Reply with quote

Ok, it seems like a very stupid bug: when the string passed to os.makedirs contains a trailing slash (like in this case "/resources/LV2core/include/"), all directories up to the last one in the path are created, while the last one is not created and the exception is raised.
Back to top
View user's profile Send private message
daste



Joined: 26 Nov 2007
Posts: 53

PostPosted: Sun May 16, 2010 4:53 am    Post subject: Reply with quote

Some further insight: mkdir("a/") works on Linux, but it doesn't work on Syllable - as always, the POSIX standard seems to be quite vague about this case. Pragmatically speaking, I think this can be solved in the Syllable implementation, right?
Back to top
View user's profile Send private message
Morph
The Knights of Syllable


Joined: 18 Oct 2007
Posts: 316
Location: Australia

PostPosted: Sun May 16, 2010 5:44 am    Post subject: Reply with quote

Nice investigation. Looks like the problem might be in the kernel function lookup_parent_inode() ( http://syllable.cvs.sourceforge.net/viewvc/syllable/syllable/system/sys/kernel/kernel/vfs/vfs.c?revision=1.26&view=markup&sortby=date#l_478 ), which is called from do_mkdir(). lookup_parent_inode() doesn't handle the case that the path ends with '/'. Some other syscalls probably have the same problem, for instance rmdir. We can probably safely change lookup_parent_inode() to properly work with trailing /'s.
Back to top
View user's profile Send private message Visit poster's website
chamel



Joined: 01 May 2010
Posts: 18

PostPosted: Sun May 16, 2010 7:31 am    Post subject: Reply with quote

[code]524 for ( i = 0, nLen = 0; ( c = pzPath[i] ); ++i )
525 {
526 if ( '/' == c )
527 {
528 if ( 0 != nLen || ( 1 == nLen && c == '.' ) )
529 {
530 nError = cfs_locate_inode( psParent, pzCurName, nLen, &psInode, true );
531
532 if ( 0 == nError )
533 {
534 nError = follow_sym_link( &psParent, &psInode, NULL );
535 if ( nError < 0 )
536 {
537 put_inode( psInode );
538 }
539 }
540 put_inode( psParent );
541
542 if ( nError < 0 )
543 {
544 psInode = NULL;
545 break;
546 }
547
548 nLen = 0;
549 psParent = psInode;
550 }
551 else
552 {
553 psInode = psParent;
554 }
555 pzCurName = &pzPath[i + 1];
556 }
557 else
558 {
559 nLen++;
560 }
561 }[/code]
++++++++++++++
Must be like this:
++++++++++++++
[code]
524 for ( i = 0, nLen = 0; ( c = pzPath[i] ); ++i )
{
if ( '/' == c )
{
if ( 0 != nLen )
/* I have removed compare ( 1 == nLen && c == '.' ) as it is useless as nLen here is always not zero and c will always be '/' which make no sence to use it*/
{
nError = cfs_locate_inode( psParent, pzCurName, nLen, &psInode, true );

if ( 0 == nError )
{
nError = follow_sym_link( &psParent, &psInode, NULL );
if ( nError < 0 )
{
put_inode( psInode );
}
}
put_inode( psParent );

if ( nError < 0 )
{
psInode = NULL;
break;
}
if ( pzPath[i + 1] !=0 )
/* looking forward to see if after "/" is another element, if not we leave our values as they are*/
{
nLen = 0;
psParent = psInode;
pzCurName = &pzPath[i + 1];
}
}
else
{
psInode = psParent;
pzCurName = &pzPath[i + 1];
}
}
else
{
nLen++;
}
}[/code]
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Sun May 16, 2010 11:08 am    Post subject: Reply with quote

Tss, I would have expected this to be a problem ten years ago. Great work, guys! Chamel, could you put that in unified diff form (diff -u) so it's easier to review and apply?
Back to top
View user's profile Send private message Visit poster's website
chamel



Joined: 01 May 2010
Posts: 18

PostPosted: Sun May 16, 2010 11:55 am    Post subject: Reply with quote

http://www.mediafire.com/file/yzjdjicrgdb/vfs.c.patch
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Sun May 16, 2010 12:49 pm    Post subject: Reply with quote

http://pastebin.com/ is a lot friendlier, but thanks for the patch! It looks OK to me at first sight. What do you think, Anthony?
Back to top
View user's profile Send private message Visit poster's website
Morph
The Knights of Syllable


Joined: 18 Oct 2007
Posts: 316
Location: Australia

PostPosted: Sun May 16, 2010 4:43 pm    Post subject: Reply with quote

Yep, looks good to me. I noticed that redundant ( 1 == nLen && c == '.' ) check too Smile Thanks for the patch.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Bugs - Fixed All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group