Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 820356 - app-editors/vim: warning on a missing file when USE=minimal
Summary: app-editors/vim: warning on a missing file when USE=minimal
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-10-26 14:15 UTC by Dongsu Park
Modified: 2022-03-02 19:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dongsu Park 2021-10-26 14:15:56 UTC
app-editors/vim 8.2.3428-r1 prints out a warning on missing file, when it is built with USE="minimal" and `app-editors/vim-core` is not installed.

```
$ vim
E1187: Failed to source defaults.vim
Press ENTER or type command to continue
```

vim tries to load /usr/share/vim/defaults.vim , which does not exist.
After pressing Enter, vim works well. But it is annoying for most users.

Other distros have similar issues like https://bugzilla.redhat.com/show_bug.cgi?id=1969936 .
According to that, 8.2.2932 or newer has the issue with vim-minimal.
Unlike the comment https://bugzilla.redhat.com/show_bug.cgi?id=1969936#c6 , I think setting "let skip_defaults_vim = 1" in config does not work in Gentoo.

I think the most straightforward way to resolve this issue is to explicitly install /usr/share/vim/defaults.vim, as done in https://src.fedoraproject.org/rpms/vim/c/6a934f62de5b7be6af1d14174aa9049b9ea8d027?branch=rawhide .
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-26 15:04:04 UTC
Thanks for the report & background. I agree, it seems easiest to just install that file. I'll add that.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-26 15:07:36 UTC
Ugh, so.. vim-core installs /usr/share/vim/vim82/defaults.vim?
Comment 3 Dongsu Park 2021-11-29 16:27:21 UTC
Filed a PR to fix the issue. https://github.com/gentoo/gentoo/pull/23115
Comment 4 Larry the Git Cow gentoo-dev 2021-12-01 17:07:05 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc72192754c8a1ff9014fd739a2d07056b25ed1e

commit fc72192754c8a1ff9014fd739a2d07056b25ed1e
Author:     Dongsu Park <dpark@linux.microsoft.com>
AuthorDate: 2021-11-29 15:59:03 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-12-01 17:06:55 +0000

    app-editors/vim: remove warning due to missing defaults.vim
    
    vim >= 8.2.3428 prints out a warning on missing file, when
    it is built with USE="minimal" and `app-editors/vim-core` is not
    installed.
    
    ```
    $ vim
    E1187: Failed to source defaults.vim
    Press ENTER or type command to continue
    ```
    
    To remove warning, explicitly install /usr/share/vim/vim82/defaults.vim.
    
    Closes: https://bugs.gentoo.org/820356
    Signed-off-by: Dongsu Park <dpark@linux.microsoft.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 app-editors/vim/vim-8.2.0814-r100.ebuild | 6 ++++++
 app-editors/vim/vim-8.2.3428-r1.ebuild   | 6 ++++++
 app-editors/vim/vim-8.2.3567.ebuild      | 6 ++++++
 app-editors/vim/vim-8.2.3582.ebuild      | 6 ++++++
 app-editors/vim/vim-9999.ebuild          | 6 ++++++
 5 files changed, 30 insertions(+)
Comment 5 James Baldassari 2022-03-02 19:22:28 UTC
I'm now getting this same error about failing to source defaults.vim after installing app-editors/vim-8.2.4328.  I do _not_ have USE=minimal, and vim-core 8.2.4328 is installed as well.

The file /usr/share/vim/defaults.vim does not exist, and "equery b /usr/share/vim/defaults.vim" does not return anything.  "equery f app-editors/vim-core" does not list this file, so it appears that vim-core no longer installs it.

Should this issue be reopened?  I could create a new issue if that's better.
Comment 6 James Baldassari 2022-03-02 19:28:23 UTC
I rolled back to 8.2.3741, and I no longer get the error about missing defaults.  I was expecting to find that the file /usr/share/vim/defaults.vim had been restored, but it actually still does not exist even though the warning is gone.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-02 19:33:58 UTC
(In reply to James Baldassari from comment #5)
> I'm now getting this same error about failing to source defaults.vim after
> installing app-editors/vim-8.2.4328.  I do _not_ have USE=minimal, and
> vim-core 8.2.4328 is installed as well.
> 
> The file /usr/share/vim/defaults.vim does not exist, and "equery b
> /usr/share/vim/defaults.vim" does not return anything.  "equery f
> app-editors/vim-core" does not list this file, so it appears that vim-core
> no longer installs it.
> 
> Should this issue be reopened?  I could create a new issue if that's better.

Related to bug 834498.