On 2016-01-18 09:27, Roman Haefeli wrote:
Thanks for the fix(es). [declare -stdlib] works again for me.
Unlike specified in the help, -lib now searches both, relative to the patch _and_ standard paths, while -stdlib only searches standard paths and is in accordance to the documentation. Is that intended?
i think so. i cannot think of a reason why it should be different.
Well, "-path" works differently (only relative to the calling patch). If indeed "-lib" additionally searches "standard" paths it would seem more sensible to make it act like "-path" - that gives the user the most control.
so if i create a patch that depends on a library (e.g. "zexy"), and i want people to be able to use it straight away i would: - compile zexy for my platform (w32) - put it into a zexy/ directory besides my patch. - use [declare -lib zexy]
now zmoelnig would like to use my patch, but they are linux freaks. so they install the "pd-zexy" package, which installs zexy into /usr/lib/pd/extra. but they still cannot use the patch, since the library is not found.
so i really would need to add a - [declare -lib zexy -stdlib zexy]
but this is wrong again, since now woelnig, who is a dickheaded w32 user who has installed zexy systemwide in %AppData%\Pd\zexy will have the wrong zexy loaded: - "-lib zexy" will be called first, loading the embedded copy of zexy - "-stdlib zexy" will be called second, loading the system installed copy of zexy, which will overwrite all the zexy-provided classes from the embedded copy (and output a lot of warnings along the lines of
warning: class 'z~' overwritten; old one renamed 'z~_aliased'
so i *really* need to add a - [declare -stdlib zexy -lib zexy]
to be sure to use the local copy of zexy and fall back to a system installed copy.
i'm pretty sure i cannot see the obvious though. so if you have some use-cases (where it would make sense to not search stdpath; how to make use of that additional "control",...) i would be thankful...
Quite possibly I'm misunderstanding something though. The whole path/lib thing has become too complicated for me...
ouch. i guess i shall do some documentation then.
At least, we seem to have a similar understanding. Also, I believe to know that "-lib" used to _not_ search standard paths, but _only_ relative to the calling patch.
are you sure?
i just tested with Pd-0.46-7 (as shipped with Debian; please note that Debian does some slight modification to the stdpath).
$ cat foo.pd #N canvas 416 252 450 300 10; #X declare -lib zexy; #X obj 151 152 declare -lib zexy;
$ pd -noprefs -verbose
then i create a new patch, and instantiate the [foo] object. according to the verbose-printout, zexy is loaded from /usr/lib/pd/extra/zexy, which afaik is the std-search path.
tried /tmp/zmoelnig/zexy.l_ia64 and failed tried ./zexy.l_ia64 and failed tried /Net/iem/Benutzer/zmoelnig/pd-externals/zexy.l_ia64 and failed tried /usr/local/lib/pd-externals/zexy.l_ia64 and failed tried /usr/lib/puredata/extra/zexy.l_ia64 and failed tried /usr/lib/pd/extra/zexy.l_ia64 and failed tried /tmp/zmoelnig/zexy.pd_linux and failed tried ./zexy.pd_linux and failed tried /Net/iem/Benutzer/zmoelnig/pd-externals/zexy.pd_linux and failed tried /usr/local/lib/pd-externals/zexy.pd_linux and failed tried /usr/lib/puredata/extra/zexy.pd_linux and failed tried /usr/lib/pd/extra/zexy.pd_linux and failed tried /tmp/zmoelnig/zexy/zexy.l_ia64 and failed tried ./zexy/zexy.l_ia64 and failed tried /Net/iem/Benutzer/zmoelnig/pd-externals/zexy/zexy.l_ia64 and failed tried /usr/local/lib/pd-externals/zexy/zexy.l_ia64 and failed tried /usr/lib/puredata/extra/zexy/zexy.l_ia64 and failed tried /usr/lib/pd/extra/zexy/zexy.l_ia64 and failed tried /tmp/zmoelnig/zexy/zexy.pd_linux and failed tried ./zexy/zexy.pd_linux and failed tried /Net/iem/Benutzer/zmoelnig/pd-externals/zexy/zexy.pd_linux and
failed
tried /usr/local/lib/pd-externals/zexy/zexy.pd_linux and failed tried /usr/lib/puredata/extra/zexy/zexy.pd_linux and failed tried /usr/lib/pd/extra/zexy/zexy.pd_linux and succeeded
one thing that comes to my mind though: could it be that the stdpaths are actually searched but without prepending "extra", and thus failing to find libraries?
I'm undecided whether the new behavior is advantage, but it is different from before.
afaict, the mainly difference is that it now searches each path for all the different extensions (rather than searching for each extension in all the paths). this *is* different behaviour (and i do think that it is an advantage).
mfgasdr IOhannes