Roland Puntaier wrote:

> > What do you suggest we do when RTLD_GLOBAL is needed?  Disallow building
> > with two versions of Python?  Or restrict use at runtime, as it is now?
> > We could add an option to switch using RTLD_GLOBAL on/off, but it's
> > really ugly.  I would rather tell users to build two versions of Vim,
> > one with Python 2 and one with Python 3.
> 
> So without RTLD_GLOBAL we have found that certain python C extension 
> modules that were not linked to libpython cannot be loaded.
> This is less a problem than a crash. 

Certainly.

>         It can also be tackled by recompiling that extension module or the 
> system package. For termios, I suppose recompiling python with 
> --enable-shared should work.
>         My assumption is that certain distros distribute python without 
> --enable-shared and the libpython gets into the system by other packages.
> 
> On the other hand a crash is not acceptable and thus RTLD_GLOBAL when both 
> python version are enable is not acceptable.
> To find out during configuration is expensive and the outcome is only that 
> enabling both can lead to one, possibly both version with reduced 
> functionality.
> Such a message could be issued at configuration time, but without the 
> expense to actually verify, whether there will be reduced functionality.
> To disable one python version either at configuration time or runtime is 
> against the intention of the user to have both enabled. 
> Maybe the user can live with the reduced python functionality. If not, 
> there are options:
>         1) reconfigure vim for one python version only
>         2) recompile and properly link the problematic library, or python 
> as a whole in case of its standard libraries.

This is how it works now.  When building with one of the interfaces
RTLD_GLOBAL is used an everything should work.  When building with both
RTLD_GLOBAL is not used and Vim won't crash but some imports may fail.

The need for indluding both interfaces mainly comes from Linux
distributors, who would like to have one version of Vim package that
works for all users.  For these it might actually be better to use
RTLD_GLOBAL and disallow using both ":python" and ":py3" in one session.
In fact, only one of the two libraries may be installed.

A configure check would help to decide whether everything works without
RTLD_GLOBAL global.  If it does, then the current solution is best.  If
it doesn't it might be better to switch to the other solution: do use
RTLD_GLOBAL but disallow using both python commands.

-- 
On the other hand, you have different fingers.
                                      -- Steven Wright

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui