Bug 1773723 - rvim error during startup with vim-syntastic
Summary: rvim error during startup with vim-syntastic
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: vim-syntastic
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pavel Raiskup
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-18 19:29 UTC by Markus Linnala
Modified: 2019-11-29 02:46 UTC (History)
1 user (show)

Fixed In Version: vim-syntastic-3.10.0-3.fc31 vim-syntastic-3.10.0-3.fc30
Clone Of:
Environment:
Last Closed: 2019-11-19 20:34:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Markus Linnala 2019-11-18 19:29:39 UTC
Description of problem:

Running: 'rvim' produces error at startup if vim-syntastic is enabled.


Version-Release number of selected component (if applicable):

vim-common-8.1.2234-1.fc31.x86_64
vim-enhanced-8.1.2234-1.fc31.x86_64
vim-filesystem-8.1.2234-1.fc31.noarch
vim-minimal-8.1.2234-1.fc31.x86_64
vim-syntastic-3.10.0-1.fc31.noarch
vim-syntastic-sh-3.10.0-1.fc31.noarch

How reproducible:

Steps to Reproduce:
1. Install packages

sudo dnf install -y vim-enhanced vim-filesystem vim-syntastic-sh vim-syntastic vim-common vim-minimal

2. Run rvim

rvim


Actual results:

Vim prints following lines:

syntastic: error: exception running system('uname'): Vim(let):E145: Shell commands and some functionality not allowed in rvim
Error detected while processing function syntastic#util#system:
line   19:
E121: Undefined variable: g:_SYNTASTIC_DEBUG_CHECKERS
E116: Invalid arguments for function syntastic#log#debug
Press ENTER or type command to continue

Expected results:

Vim starts in restricted mode

Additional info:

I tried to disable all my local vim configs so this should be easily reproducible.

I want to use 'rvim' as SYSTEMD_EDITOR to disable suspend C-z when editing systemd unit files.

Problem is when you first remove 'nano' and then try to use systemd to edit unit file.

sudo systemd edit foo.service

And if you now press C-z you jump out of vim, but without any way to go back without killing vim process. Using rvim prevents this.

Comment 1 Markus Linnala 2019-11-18 19:30:15 UTC
systemd-243-4.gitef67743.fc31.x86_64

Comment 2 Pavel Raiskup 2019-11-19 20:03:30 UTC
Thanks for the report.  Why do you think this is bug in vim-syntastic, and
not rvim?

Comment 3 Pavel Raiskup 2019-11-19 20:07:24 UTC
Ah, I see.  rvim stands for restricted vim.  Still vim-enhanced package.

Comment 4 Markus Linnala 2019-11-19 20:09:00 UTC
Mostly because when I run rvim without vim-syntastic installed it works just fine.

Comment 5 Markus Linnala 2019-11-19 20:09:53 UTC
From the manual vim(1):

   rvim rview rgvim rgview
         Like the above, but with restrictions.  It will not be possible to start shell commands, or suspend Vim.  Can also be done with the "-Z" argument.

Comment 6 Markus Linnala 2019-11-19 20:27:13 UTC
I guess error comes from /usr/share/vim/vimfiles/plugin/syntastic.vim line 59.

Maybe just change lines 55-68:

    55  if s:_running_windows
    56      let g:_SYNTASTIC_UNAME = 'Windows'
    57  elseif executable('uname')
    58      try
    59          let g:_SYNTASTIC_UNAME = split(syntastic#util#system('uname'), "\n")[0]
    60      catch /\m^Vim\%((\a\+)\)\=:E484/
    61          call syntastic#log#error("can't run external programs (misconfigured shell options?)")
    62          finish
    63      catch /\m^Vim\%((\a\+)\)\=:E684/
    64          let g:_SYNTASTIC_UNAME = 'Unknown'
    65      endtry
    66  else
    67      let g:_SYNTASTIC_UNAME = 'Unknown'
    68  endif

to:

let g:_SYNTASTIC_UNAME = 'Linux'

As far as I can see all Fedora is 'Linux' and so are all other Red Hat variants. And so there is no need to run uname at startup at all.

Comment 7 Pavel Raiskup 2019-11-19 20:34:05 UTC
I filled an upstream ticket, please continue the discussion there:
https://github.com/vim-syntastic/syntastic/issues/2288

I'm afraid I won't have enough time to solve this.  So if you find some
reasonable solution, please open PR against:
https://src.fedoraproject.org/rpms/vim-syntastic

Comment 8 Pavel Raiskup 2019-11-19 20:35:41 UTC
(In reply to Markus Linnala from comment #6)
> As far as I can see all Fedora is 'Linux' and so are all other Red Hat
> variants. And so there is no need to run uname at startup at all.

That sounds like reasonable downstream-patch.  Can you please open a PR
with patch (and test that it actually helps)?

Comment 9 Markus Linnala 2019-11-20 16:00:41 UTC
I've ported upstream patch:

https://github.com/vim-syntastic/syntastic/commit/39b35b23b952d620b8ec7cabb13110f586663837

And built package and now result is:

sudo systemctl edit grafana-server.service 
syntastic: error: can't run in rvim
Press ENTER or type command to continue


According to comments here:

https://github.com/vim-syntastic/syntastic/issues/2288

and current situation of syntastic being autoloaded I think this would be acceptable operations. I'm not going to change autoload situation.

I'll shortly publish PR to:

https://src.fedoraproject.org/rpms/vim-syntastic

Comment 11 Fedora Update System 2019-11-20 18:19:37 UTC
FEDORA-2019-6705f27e76 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-6705f27e76

Comment 12 Fedora Update System 2019-11-20 18:19:56 UTC
FEDORA-2019-e0092ab76e has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-e0092ab76e

Comment 13 Fedora Update System 2019-11-20 18:20:06 UTC
FEDORA-2019-f3abc065f3 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-f3abc065f3

Comment 14 Fedora Update System 2019-11-21 02:27:30 UTC
vim-syntastic-3.10.0-3.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-f3abc065f3

Comment 15 Fedora Update System 2019-11-21 04:18:13 UTC
vim-syntastic-3.10.0-3.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-e0092ab76e

Comment 16 Fedora Update System 2019-11-21 04:22:17 UTC
vim-syntastic-3.10.0-3.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-6705f27e76

Comment 17 Markus Linnala 2019-11-22 13:58:48 UTC
I updated in F31 and it does what I expect.

$ rpm -q vim-syntastic
vim-syntastic-3.10.0-3.fc31.noarch
$ sudo systemctl edit grafana-server.service 
syntastic: error: can't run in rvim
Press ENTER or type command to continue

Comment 18 Fedora Update System 2019-11-29 00:53:56 UTC
vim-syntastic-3.10.0-3.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2019-11-29 02:46:25 UTC
vim-syntastic-3.10.0-3.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.