Vim configured with both --with-features=normal and --enable-libsodium ends up with libsodium linked in but the +sodium feature disabled

32 views
Skip to first unread message

Tony Mechelynck

unread,
May 8, 2023, 3:04:48 PM5/8/23
to Bram Moolenaar, Christian Brabandt, vim_dev
Steps to reproduce:
0. Make sure that the libsodium is installed on your system.
1. Open a fresh bash shell (for example in a nex konsole tab),
preferably in a shadow directory (in order not to mess with your usual
build). Make sure your Makefile is unchanged from the distributed
version.
2. Source the following script:
export CONF_OPT_GUI='--enable-gui=motif'
export CONF_OPT_MULTIBYTE='--enable-multibyte'
export CONF_OPT_AUTOSERVE='--enable-autoservername'
export CONF_OPT_SODIUM='--enable-libsodium'
export CONF_OPT_FEAT='--with-features=normal'
export CONF_ARGS2='--with-vim-name=vim-normal'
export CONF_OPT_COMPBY='"--with-compiledby=antoine.m...@gmail.com"'
3. make reconfig
4. make install
5. vim-normal --version

Expected result: +sodium in the list of features (i.e. I would have
expected --enable-libsodium to compile with +sodium even in a Normal
build).

Actual result: The list of features includes -sodium at its
alphabetical place, yet the Linking line includes -lsodium near the
end.

Additional info: As shown in the attached log, the only instances of
the string "sodium" in the configure log are when it checks for
--enable-libsodium (and finds it) and for the libsodium (and finds it
installed).

The attached files are:
* the sysout/syserr log from " (date; make -j4 reconfig || echo 'exit
status' $? ; date) 2>&1 " (without the quotes)
* auto/config.cache
* auto/config.h
* auto/config.mk
* auto/config.status
Maybe some of them are not needed to debug this problem, but better
too much than too little. After searching for "sodium" in all of them,
my only conclusion is that (contrary to my expectation) this feature
is enabled everywhere that I can see, but disabled somewhere in the
code due to FEAT_HUGE not being defined.

Best regards,
Tony.
normsodium.txt
config.h
config.status
config.cache
config.mk

Tony Mechelynck

unread,
May 8, 2023, 3:25:16 PM5/8/23
to Bram Moolenaar, Christian Brabandt, vim_dev
Oops, wrong attachments, retry.
normsodium.txt
config.h
config.cache
config.mk
config.status

Bram Moolenaar

unread,
May 8, 2023, 5:09:05 PM5/8/23
to vim...@googlegroups.com, Tony Mechelynck, Christian Brabandt

Tony wrote:

> Steps to reproduce:
> 0. Make sure that the libsodium is installed on your system.
> 1. Open a fresh bash shell (for example in a nex konsole tab),
> preferably in a shadow directory (in order not to mess with your usual
> build). Make sure your Makefile is unchanged from the distributed
> version.
> 2. Source the following script:
> export CONF_OPT_GUI='--enable-gui=motif'
> export CONF_OPT_MULTIBYTE='--enable-multibyte'
> export CONF_OPT_AUTOSERVE='--enable-autoservername'
> export CONF_OPT_SODIUM='--enable-libsodium'
> export CONF_OPT_FEAT='--with-features=normal'
> export CONF_ARGS2='--with-vim-name=vim-normal'
> export CONF_OPT_COMPBY='"--with-compiledby=antoine.m...@gmail.com"'
> 3. make reconfig
> 4. make install
> 5. vim-normal --version
>
> Expected result: +sodium in the list of features (i.e. I would have
> expected --enable-libsodium to compile with +sodium even in a Normal
> build).
>
> Actual result: The list of features includes -sodium at its
> alphabetical place, yet the Linking line includes -lsodium near the
> end.

This is indeed strange. The configure check for sodium defaults to only
checking when using "huge" features. That makes sense, it is something
advanced, not always needed. But in the src/feature.h file the
FEAT_HUGE macro is checked again. Thus when overriding the configure
check to check for sodium also with "normal" features, it gets excluded
there. I don't see any reason for that.

I'll make a patch to change this. Let me know if I missed a situation
where the existing logic did make sense.

--
hundred-and-one symptoms of being an internet addict:
24. You realize there is not a sound in the house and you have no idea where
your children are.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Tony Mechelynck

unread,
May 8, 2023, 6:35:27 PM5/8/23
to Bram Moolenaar, vim...@googlegroups.com, Christian Brabandt
On Mon, May 8, 2023 at 11:09 PM Bram Moolenaar <Br...@moolenaar.net> wrote:
[...]
> This is indeed strange. The configure check for sodium defaults to only
> checking when using "huge" features. That makes sense, it is something
> advanced, not always needed. But in the src/feature.h file the
> FEAT_HUGE macro is checked again. Thus when overriding the configure
> check to check for sodium also with "normal" features, it gets excluded
> there. I don't see any reason for that.
>
> I'll make a patch to change this. Let me know if I missed a situation
> where the existing logic did make sense.

After applying patch 1528, the procedure described earlier (with
--with-features=normal and also --enable-libsodium) does indeed build
a Normal Vim with +sodium compiled-in. Thanks!

Best regards,
Tony.
Reply all
Reply to author
Forward
0 new messages