`make test_environ` fails on macOS Monterey 12.3.1

16 views
Skip to first unread message

Dominique Pellé

unread,
Apr 24, 2022, 5:17:35 AM4/24/22
to vim_dev
Hi

I just got a macOS M1 laptop for work. First thing I did, was
was of course to compile the latest Vim from git (8.2.4815).
I noticed a test failure:

$ cd vim/src/testdir
$ make test_environ
rm -f test_environ.res test.log messages
VIMRUNTIME=../../runtime ../vim -f -u unix.vim -U NONE --noplugin
--not-a-term -S runtest.vim test_environ.vim --cmd 'au SwapExists *
let v:swapchoice = "e"' | LC_ALL=C LANG=C LANGUAGE=C awk '/Executing
Test_/{match($0, "Executing Test_[^\\)]*\\)"); print substr($0,
RSTART, RLENGTH) "\r"; fflush()}'
Executing Test_environ()
Executing Test_external_env()
Executing Test_getenv()
Executing Test_mac_locale()
Executing Test_setenv()
Executing Test_special_env()


From test_environ.vim:
Executed Test_environ() in 0.001717 seconds
Executed Test_external_env() in 0.092557 seconds
Executed Test_getenv() in 0.000727 seconds
Executed Test_mac_locale() in 0.135780 seconds
Executed Test_setenv() in 0.000656 seconds
Executed Test_special_env() in 0.000664 seconds
Executed 6 tests in 0.260058 seconds
1 FAILED:
Found errors in Test_mac_locale():
command line..script
/Users/dope/sb/vim/src/testdir/runtest.vim[459]..function
RunTheTest[44]..Test_mac_locale line 14: Default locale should have
UTF-8 encoding set, and LC_NUMERIC set to 'C': Pattern
'"\\([a-zA-Z_]\\+\\.UTF-8/\\)\\{3}C\\(/[a-zA-Z_]\\+\\.UTF-8\\)\\{2}"'
does not match 'Current language:
"en_US.UTF-8/UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8"\n'
make: *** [Makefile:66: test_environ] Error 1

The "locale" command outputs:

$ locale
LANG=""
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

Hmmm, I wonder why it does not use UTF-8 by
default!? Vim works fine with UTF-8 though at
first sight.

I tried this:
$ export LC_ALL=en_US.UTF-8

and it gives:
LANG=""
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

But the test still fails similarly.

I'm a macOS newbie, having only used macOS for
the last 2 days. So I'm still learning and might be missing
something obvious here. I've always used Linux before.

- OS: macOS Monterey 12.3.1.
- Vim: 8.2.4815 (latest from git)
- Terminal: iTerm2 3.4.15 (is there a better terminal
for Vim on macOS by the way?)

:version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 24 2022 11:05:27)
macOS version - arm64
Included patches: 1-4815
Compiled by dope@MAC-F456C43F5F
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_urxvt -tag_any_white
+arabic +find_in_path +mouse_xterm -tcl
+autocmd +float +multi_byte +termguicolors
+autochdir +folding +multi_lang +terminal
-autoservername -footer -mzscheme +terminfo
-balloon_eval +fork() +netbeans_intg +termresponse
+balloon_eval_term -gettext +num64 +textobjects
-browse -hangul_input +packages +textprop
++builtin_terms +iconv +path_extra +timers
+byte_offset +insert_expand -perl +title
+channel +ipv6 +persistent_undo -toolbar
+cindent +job +popupwin +user_commands
-clientserver +jumplist +postscript +vartabs
+clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +vim9script
+cmdline_hist +langmap -python +viminfo
+cmdline_info +libcall +python3 +virtualedit
+comments +linebreak +quickfix +visual
+conceal +lispindent +reltime +visualextra
+cryptv +listcmds +rightleft +vreplace
-cscope +localmap -ruby +wildignore
+cursorbind -lua +scrollbind +wildmenu
+cursorshape +menu +signs +windows
+dialog_con +mksession +smartindent +writebackup
+diff +modify_fname -sodium -X11
+digraphs +mouse -sound -xfontset
-dnd -mouseshape +spell -xim
-ebcdic +mouse_dec +startuptime -xpm
+emacs_tags -mouse_gpm +statusline -xsmp
+eval -mouse_jsbterm -sun_workshop -xterm_clipboard
+ex_extra +mouse_netterm +syntax -xterm_save
+extra_search +mouse_sgr +tag_binary
-farsi -mouse_sysmouse -tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O
2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -g -O0 -fsanitize=address -
fno-omit-frame-pointer -DEXITFREE -DABORT_ON_INTERNAL_ERROR
Linking: gcc -o vim -lm -lncurses -liconv -framework AppKit -L/opt/homebrew/opt/
python@3.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/config-3.9-dar
win -lpython3.9 -framework CoreFoundation -g -O0 -fsanitize=address -fno-omit-fr
ame-pointer

Regards
Dominique

Bram Moolenaar

unread,
Apr 24, 2022, 6:51:23 AM4/24/22
to vim...@googlegroups.com, Dominique Pellé
I wonder what this test is actually testing. And how it is relevant for
running Vim.

> The "locale" command outputs:

What matters is what the ":lang" command in Vim prints. It may be
different, because Vim adjusts some things on startup. This uses the
system function setlocale(what, NULL). On linux the output contains
semicolons, it appears Mac OS does something different (it's based on
BSD).

I haven't tried finding out where the test came from, I think it must
have been there for years.

--
Never overestimate a man's ability to underestimate a woman.

/// 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 ///

Christian Brabandt

unread,
Apr 25, 2022, 3:23:54 AM4/25/22
to vim...@googlegroups.com
It looks like the second item from the `:lang` command just contains
`UTF-8` instead of the expected `en_US.UTF-8` Not sure if this is
expected. Is this macvim or plain vim? You may want to check with @ychin
who contributed that test.

>
> I wonder what this test is actually testing. And how it is relevant for
> running Vim.
>
> > The "locale" command outputs:
>
> What matters is what the ":lang" command in Vim prints. It may be
> different, because Vim adjusts some things on startup. This uses the
> system function setlocale(what, NULL). On linux the output contains
> semicolons, it appears Mac OS does something different (it's based on
> BSD).

According to the test, it seems to expect / as delimiter.

>
> I haven't tried finding out where the test came from, I think it must
> have been there for years.

This comes from https://github.com/vim/vim/pull/7022

Perhaps we need to check with @ychin

Best,
Christian
--
"The human brain is like an enormous fish -- it is flat and slimy and
has gills through which it can see."
-- Monty Python
Reply all
Reply to author
Forward
0 new messages