[PD-dev] [ pure-data-Patches-1917574 ] fix absolute path support for [declare] and #X declare

SourceForge.net noreply at sourceforge.net
Thu Sep 2 21:36:37 CEST 2010


Patches item #1917574, was opened at 2008-03-17 21:01
Message generated for change (Comment added) made by eighthave
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=1917574&group_id=55736

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: puredata
Group: None
>Status: Open
Resolution: None
>Priority: 7
Private: No
Submitted By: marius schebella (mariusschebella)
Assigned to: Miller Puckette (millerpuckette)
Summary: fix absolute path support for [declare] and #X declare

Initial Comment:
I am not sure if declare is working the way it is supposed to on OSX
the object I am trying to create is [OSCroute].
I can create [oscx/OSCroute], but what I want to accomplish is to avoid the oscx prefix, so I tried
[declare -stdpath extra/oscx]
[declare -stdpath oscx]
[declare -path extra/oscx]
[declare -path oscx]
[declare -stdlib extra/oscx]
[declare -stdlib oscx]
[declare -lib extra/oscx]
[declare -lib oscx]
I even tried [declare -stdpath extra/oscx] in combination with import oscx. and I get a console printout saying [import] loaded library: oscx,
but OSCroute
... couldn't create 
don't know how to track down the error, or if I am maybe doing something wrong.
pd-extended-0.40.3-20080222.

----------------------------------------------------------------------

>Comment By: Hans-Christoph Steiner (eighthave)
Date: 2010-09-02 15:36

Message:
Ok, I replaced the code using realpath() to now use the Pd function
sys_isabsolutepath().  The issue related to relative paths still remains,
this patch fixes that.

----------------------------------------------------------------------

Comment By: IOhannes m zmlnig (zmoelnig)
Date: 2010-08-21 12:51

Message:
is this stil an issue with 0.43?

----------------------------------------------------------------------

Comment By: Hans-Christoph Steiner (eighthave)
Date: 2008-05-22 15:26

Message:
Logged In: YES 
user_id=27104
Originator: NO

(repost of my pd-dev post)

The realpath() is definitely related.  If you start Pd using a relative
path, like I do when doing dev work (e.g. make && ../bin/pd), then
sys_libdir will be a relative path.  That means it is impossible to make
absolute paths using sys_libdir, which is what I need to do to make
[import] work, or loading libdirs with [declare -lib] and the libdir
loader.

I can't see any problems that realpath() might cause.


----------------------------------------------------------------------

Comment By: Miller Puckette (millerpuckette)
Date: 2008-05-22 13:21

Message:
Logged In: YES 
user_id=313747
Originator: NO

I patched 0.42 with th epart of it that dealt with declare... there's
something else in the patch that invokes a "realpath" function I don't
know about (and I assume won't compile as is) so I ignored that bit.

I think I should also update 0.41 since this is a fairly important bug fix
and also a safe-looking one.

----------------------------------------------------------------------

Comment By: Hans-Christoph Steiner (eighthave)
Date: 2008-05-21 14:19

Message:
Logged In: YES 
user_id=27104
Originator: NO

This patch should add support for absolute paths in [declare] and the #X
declare lines in the .pd files.  Here's the related commit for
Pd-extended:

http://pure-data.svn.sourceforge.net/viewvc/pure-data?view=rev&revision=9862
File Added: fix_absolute_paths_for_declare-0.41.4.patch

----------------------------------------------------------------------

Comment By: marius schebella (mariusschebella)
Date: 2008-05-06 12:45

Message:
Logged In: YES 
user_id=1856112
Originator: YES

that's how -stdpath works on os x. it does not work for absolute paths,
and seems to be relative to some directory outside of /Applications. I
tried all relations with less ../ and from inside /Applications.
declare -stdpath
../../../../../../../../Applications/Pd-0.40.3-extended-20080428.app/Contents/Resources/extra/boids
maybe this helps.
m.

----------------------------------------------------------------------

Comment By: marius schebella (mariusschebella)
Date: 2008-05-04 13:35

Message:
Logged In: YES 
user_id=1856112
Originator: YES

I just realized that I made some mistakes in the past and that declare
actually is working better than I thought. here is what I forgot:
1) declare only takes effect when you open the patch. stupid, I think I
read it, but... Some alleged "bugs" were caused by the assumption that it
is enough to create a declare object and paths will be set...
2) no absolute paths! absolute paths work for -lib, but not for
-path/-stdpath. at least on OS X it is not possible to set absolute paths
(or at least I don't know how), all paths have to be relative to Pd
(-stdpath) or to the patch (-path).

----------------------------------------------------------------------

Comment By: Roman Haefeli (reduzent)
Date: 2008-03-20 09:38

Message:
Logged In: YES 
user_id=1895440
Originator: NO

oops...

from some quick fix from before i accidently still had a symbolic link
from /home/roman/extra pointing to /usr/local/lib/pd/extra/, that is why it
found [bar] in that funny place:

/home/roman/extra/foo/bar.pd

tried again without the symlink:
--------------------------------

tried /home/roman/declare_test.pd and succeeded
tried /home/roman/../extra/foo/bar.l_i386 and failed
tried /home/roman/bar.l_i386 and failed
tried /usr/local/lib/pd/extra/bar.l_i386 and failed
tried /home/roman/../extra/foo/bar.pd_linux and failed
tried /home/roman/bar.pd_linux and failed
tried /usr/local/lib/pd/extra/bar.pd_linux and failed
tried /home/roman/../extra/foo/bar/bar.l_i386 and failed
tried /home/roman/bar/bar.l_i386 and failed
tried /usr/local/lib/pd/extra/bar/bar.l_i386 and failed
tried /home/roman/../extra/foo/bar/bar.pd_linux and failed
tried /home/roman/bar/bar.pd_linux and failed
tried /usr/local/lib/pd/extra/bar/bar.pd_linux and failed
tried /home/roman/../extra/foo/bar.pd and failed
tried /home/roman/bar.pd and failed
tried /usr/local/lib/pd/extra/bar.pd and failed
tried /home/roman/../extra/foo/bar.pat and failed
tried /home/roman/bar.pat and failed
tried /usr/local/lib/pd/extra/bar.pat and failed

----------------------------------------------------------------------

Comment By: Roman Haefeli (reduzent)
Date: 2008-03-20 07:49

Message:
Logged In: YES 
user_id=1895440
Originator: NO

i just did the same test again on my box, ubuntu dapper i686:

tried /home/roman/declare_test.pd and succeeded
tried /home/roman/extra/foo/bar.l_i386 and failed
tried /home/roman/bar.l_i386 and failed
tried /usr/local/lib/pd/extra/bar.l_i386 and failed
tried /home/roman/extra/foo/bar.pd_linux and failed
tried /home/roman/bar.pd_linux and failed
tried /usr/local/lib/pd/extra/bar.pd_linux and failed
tried /home/roman/extra/foo/bar/bar.l_i386 and failed
tried /home/roman/bar/bar.l_i386 and failed
tried /usr/local/lib/pd/extra/bar/bar.l_i386 and failed
tried /home/roman/extra/foo/bar/bar.pd_linux and failed
tried /home/roman/bar/bar.pd_linux and failed
tried /usr/local/lib/pd/extra/bar/bar.pd_linux and failed
tried /home/roman/extra/foo/bar.pd and succeeded


which means:
- there is a difference between linux ppc and linux intel
- currently linux intel is the _only_ platform where [declare] works as
documented.



----------------------------------------------------------------------

Comment By: Roman Haefeli (reduzent)
Date: 2008-03-20 07:20

Message:
Logged In: YES 
user_id=1895440
Originator: NO

could we give this issue a higher priority? the longer [declare] is not
working correctly, the more confusion it will cause. also it currently
cannot be used to create portable patches, that work on every platform with
every pd-distro, which i find would be the strong point in using
[declare].

 

----------------------------------------------------------------------

Comment By: Roman Haefeli (reduzent)
Date: 2008-03-20 07:11

Message:
Logged In: YES 
user_id=1895440
Originator: NO

the same test on a ubuntu ppc machine with pd 0.41-4 compiled from source
and installed to the default location gave similar results:

output from pd-window:
----------------------

tried /home/olivia/declare_test.pd and succeeded
tried /home/olivia/extra/foo/bar.l_i386 and failed
tried /home/olivia/bar.l_i386 and failed
tried /usr/local/lib/pd/extra/bar.l_i386 and failed
tried /home/olivia/extra/foo/bar.pd_linux and failed
tried /home/olivia/bar.pd_linux and failed
tried /usr/local/lib/pd/extra/bar.pd_linux and failed
tried /home/olivia/extra/foo/bar/bar.l_i386 and failed
tried /home/olivia/bar/bar.l_i386 and failed
tried /usr/local/lib/pd/extra/bar/bar.l_i386 and failed
tried /home/olivia/extra/foo/bar/bar.pd_linux and failed
tried /home/olivia/bar/bar.pd_linux and failed
tried /usr/local/lib/pd/extra/bar/bar.pd_linux and failed
tried /home/olivia/extra/foo/bar.pd and failed
tried /home/olivia/bar.pd and failed
tried /usr/local/lib/pd/extra/bar.pd and failed
tried /home/olivia/extra/foo/bar.pat and failed
tried /home/olivia/bar.pat and failed
tried /usr/local/lib/pd/extra/bar.pat and failed
 bar
... couldn't create


instantiating [foo/bar] works fine, which means, that installation of
[bar] is correct and pd finds it in extra/foo.


----------------------------------------------------------------------

Comment By: Roman Haefeli (reduzent)
Date: 2008-03-20 06:48

Message:
Logged In: YES 
user_id=1895440
Originator: NO

while [declare -stdlib] seems to work, [declare -stdpath] doesn't work on
windows as well. i created a folder 'foo' into the extra directory and put
a file 'bar.pd' in there.

my test setup:
--------------

pd installation path:
D:\programme\pd-0.41\

pd executable:
D:\programme\pd-0.41\bin\pd.exe

test-abstraction:
D:\programme\pd-0.41\extra\foo\bar.pd

test-patch:
D:\home\declare_test.pd

test-patch contains:

[declare -stdpath extra/foo]

[bar]

pd start command:
D:\programme\pd-0.41\bin\pd.exe -verbose -open D:\home\declare_test.pd


output from pd-window:
----------------------

tried D:\\home\\declare_test.pd and succeeded
tried D:\\home\\..\\extra\\foo\\bar.m_i386 and failed
tried D:\\home\\bar.m_i386 and failed
tried D:\\programme\\pd-0.41\\extra\\bar.m_i386 and failed
tried D:\\home\\..\\extra\\foo\\bar.dll and failed
tried D:\\home\\bar.dll and failed
tried D:\\programme\\pd-0.41\\extra\\bar.dll and failed
tried D:\\home\\..\\extra\\foo\\bar\\bar.m_i386 and failed
tried D:\\home\\bar\\bar.m_i386 and failed
tried D:\\programme\\pd-0.41\\extra\\bar\\bar.m_i386 and failed
tried D:\\home\\..\\extra\\foo\\bar\\bar.dll and failed
tried D:\\home\\bar\\bar.dll and failed
tried D:\\programme\\pd-0.41\\extra\\bar\\bar.dll and failed
tried D:\\home\\..\\extra\\foo\\bar.pd and failed
tried D:\\home\\bar.pd and failed
tried D:\\programme\\pd-0.41\\extra\\bar.pd and failed
tried D:\\home\\..\\extra\\foo\\bar.pat and failed
tried D:\\home\\bar.pat and failed
tried D:\\programme\\pd-0.41\\extra\\bar.pat and failed
 bar
... couldn't create

it looks like [declare -stdpath] is adding the search path relative to the
patch instead of relative to pd.




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=1917574&group_id=55736



More information about the Pd-dev mailing list