{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/d1588981e0248aaa0174906c99df180e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"d1588981e0248aaa0174906c99df180e","url":"https://api.github.com/users/petdance","login":"petdance","id":41100},"assignee":null,"updated_at":"2011-11-14T06:13:48Z","labels":[{"name":"Pri-normal","color":"6770F0","url":"https://api.github.com/repos/petdance/scratch/labels/Pri-normal"},{"name":"Sev-medium","color":"473A34","url":"https://api.github.com/repos/petdance/scratch/labels/Sev-medium"},{"name":"todo","color":"B36A99","url":"https://api.github.com/repos/petdance/scratch/labels/todo"}],"comments":0,"closed_at":null,"url":"https://api.github.com/repos/petdance/scratch/issues/869","body":"Thanks to the Windows DLL Hell L<http://en.wikipedia.org/wiki/DLL_hell>\nand the impossibility of file hardlinks, windows dll names are hopefully \r\nversioned, so either the loadlib function or the various pir's needs \r\nmore logic for maintainance convenience.\r\n\r\nKeep the lib_paths and share_ext search, add more name munging for \r\nspecial platforms.\r\n\r\nEither\r\n1) add the version to each loadlib call, and stem the version from\r\nPOSIX versions within get_path().\r\n\r\nloadlib lib, 'libSDL-1.2.so.0'\r\n\r\n=> try: libSDL-1.2.so.0, libSDL-1.2.so\r\n\r\nstemmed: libSDL.so\r\non WIN32: SDL-1.2.dll, SDL.dll\r\non cygwin: cygSDL-1.2.dll, cygSDL.dll\r\n\r\nMaybe also detect the \"-1.2.so.0\" and convert it to \"-1.2.0.dll\"\r\n\r\n2) add an optional version argument to loadlib. (preferred)\r\n\r\nloadlib lib, 'SDL', '1.2.0'\r\n\r\n=> Try: first always prefix with \"lib\"\r\nlibSDL-1.2.0.so, libSDL-1.2.so.0, libSDL-1.2.so, libSDL.so\r\nother rules stay as they are. (lib_paths + share_ext)\r\non WIN32: no lib prefix and try versions.\r\nSDL-1-2-0.dll, SDL-1-2.dll, SDL-1.2.0.dll, SDL-1.2.dll, SDL.dll\r\non cygwin: cyg prefix and try versions with '.' and '-'.\r\ncygSDL-1.2.dll, cygSDL-1.2.0.dll, cygSDL-1-2-0.dll, cygSDL-1-2.dll\r\n\r\nAll the pir's for the latest packaged libraries are fixed with RT#51328.\r\n\r\nRT#51328 also applies the addional lib => cyg dll logic, but does not \r\nhelp with versioned dll's, as for ncurses and SDL most prominently.\r\n\r\nExamples what we want to avoid:\r\n\r\nloadlib $P1, 'libform'\r\n+if $P1 goto has_lib\r\n+loadlib $P1, 'cygform-8'\r\n+has_lib:\r\n\r\nloadlib $P1, 'libncurses'\r\n+if $P1 goto has_lib1\r\n+loadlib $P1, 'cygncurses-8'\r\n+has_lib1:\r\n\r\n# third try\r\nloadlib libsdl, 'libSDL-1.2.so.0'\r\n\r\n+ loadlib libsdl, 'cygSDL-1-2-0'\r\n+ $I0 = typeof libsdl\r\n+ if $I0 != .Undef goto OK\r\n\r\nloadlib image_lib, 'libSDL_image-1.2.so.0'\r\n$I0 = typeof image_lib\r\nif $I0 != .Undef goto OK_HINT2\r\n\r\n+ loadlib image_lib, 'cygSDL_image-1-2-0'\r\n+ $I0 = typeof image_lib\r\n+ if $I0 != .Undef goto OK\r\n+\r\n\r\nSee also other ffi's, such as cffi, how they do deal or not with this \r\nproblem. Years ago I wrote an overview at \r\nhttp://autocad.xarch.at/lisp/ffis.html\r\n-- \r\nReini Urban\r\nhttp://phpwiki.org/ http://murbreak.at/\r\nhttp://helsinki.at/ http://spacemovie.mur.at/\r\n\r\nOriginally http://trac.parrot.org/parrot/ticket/1155 by @rurban","html_url":"https://github.com/petdance/scratch/issues/869","title":"dynext - dll versioning","number":869,"id":2227188,"created_at":"2011-11-14T06:13:48Z"},"action":"opened"}