Bug 235142 - editors/vim: Default to python3
Summary: editors/vim: Default to python3
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Adam Weinberger
Depends on:
Reported: 2019-01-23 00:10 UTC by John W. O'Brien
Modified: 2019-06-01 14:41 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (adamw)

editors/vim: Default to python3 (728 bytes, text/plain)
2019-01-23 00:10 UTC, John W. O'Brien
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John W. O'Brien 2019-01-23 00:10:19 UTC
Created attachment 201347 [details]
editors/vim: Default to python3


*    Include PYTHON3 in OPTIONS_DEFAULT instead of PYTHON2


portlint: OK
poudriere: OK -- testport on 11.2 amd64
Comment 1 Adam Weinberger freebsd_committer 2019-01-23 00:19:35 UTC
Is there a reason to switch to python3 now? In my mind, it makes more sense to switch once PYTHON_DEFAULT becomes 3.x (which is currently being worked on). Until then, I think that vim should probably use the same default that the ports tree does.
Comment 2 John W. O'Brien 2019-01-23 01:10:30 UTC
(In reply to Adam Weinberger from comment #1)

editors/vim doesn't inherit a python version through DEFAULT_VERSIONS from the ports machinery. Why, then, should it be constrained to remain synchronized with whatever the ports default is (or whatever the user selects as the global default)? If you want to use the same default the ports tree does, which seems sensible, then do that. Would you like me to draft a patch to make that change instead?
Comment 3 Adam Weinberger freebsd_committer 2019-01-23 03:25:10 UTC
(In reply to John W. O'Brien from comment #2)
I agree that PYTHON3 should be the default, just like I think python3.6 should be the PYTHON_DEFAULT. Luckily, the latter change is coming soon. There have been multiple exp-runs and prep-work is being done to facilitate the switch. I'll switch the Vim default at that time.

The problem with changing the default now is that it only really affects pkg users. DEFAULT_VERSIONS only applies to people building from source, in which case they can make config and set PYTHON3 themselves. OPTIONS_DEFAULT is supposed to be deterministic, so I wouldn't want to change it based on DEFAULT_VERSIONS. Hopefully the point will become moot soon when the PYTHON_DEFAULT switch happens.
Comment 4 John W. O'Brien 2019-02-01 03:49:17 UTC
(In reply to Adam Weinberger from comment #3)

I get why, given that editors/vim doesn't inherit from DEFAULT_VERSIONS, you don't want to be out of step with the stock default. I still think that said "given" is a problem, impinging on POLA violation territory---in my environment, editors/vim is the *only* port that still depended on python2 after I set python=3.6. I also recognize that vim doesn't fall into any of the common python dependency cases, insofar as it treats python2 and python2 as equal and independent, just like perl and ruby.

What I'm looking for at this point is a way to use DEFAULT_VERSIONS to affect the default OPTIONS for editors/vim, such that python=2.x gets PYTHON2 and python=3.x gets PYTHON3, unless OPTIONS are explicitly set to override. I'm not sure that the ports machinery admits this or something like this, but I do think that this case is a valid need.

For the sake of argument and illustration, why not steadfastly stick to PYTHON3 when the port builder has expressed no general preference, instead of steadfastly sticking to PYTHON2 when the port builder has clearly expressed a general preference?
Comment 5 commit-hook freebsd_committer 2019-06-01 14:36:41 UTC
A commit references this bug:

Author: adamw
Date: Sat Jun  1 14:35:56 UTC 2019
New revision: 503239
URL: https://svnweb.freebsd.org/changeset/ports/503239

  Update to Vim to patchlevel 1439, change default python, improve vimrc

  Some big changes in this update:

  * Patchlevel 1439
  * Default python is now 3.x instead of 2.x [1]
  * Expose DEFAULT_VIMRC option (on by default) to vim-tiny

  Also, many changes to the default vimrc. Any changes necessarily risk
  contention, but then I remembered that I actually maintain editors/vim,
  so here we are. The idea here is that Vim, by default, behaves like Vi,
  and people who install the Vim port do so because they DON'T just want
  Vi. I've enabled features that are basic quality-of-life settings for
  me, and that I hope will be ideal for most end-users.

  Important changes in the default vimrc:
  * Don't install gvimrc at all. gvim should load $ETCDIR/vimrc anyway. I
    can't test gvim locally, so someone please let me know if I broke it.
  * Turn on autoindent
  * Disable console bells entirely. Console bells are terrible.
  * Enable incsearch: highlights search results as you type them
  * ^L clears search highlights while redrawing the screen
  * Assume fast terminal by default
  * Explain every setting in comments

  Many of these settings are modeled after the defaults in NeoVim, which
  really got it right. I want our default vimrc to be usable and ideal,
  so please let me know if anything doesn't work for you, or if you have
  other settings you'd like to see changed in the default.

  In particular, please let me know if I broke gvim by removing the gvimrc!

  PR:		235142 [1]
  Submitted by:	John W. O'Brien [1]

Comment 6 Adam Weinberger freebsd_committer 2019-06-01 14:41:54 UTC
I've committed the switch to PYTHON3 as default. It should have been committed in last month's update, but I completely forgot. Sorry about that extra delay here. Thanks for the bug report and patch, John.