01 June 2017

vim-notebook

System: Microsoft Windows 10 Home Edition
CPUs: Intel(R) Celeron(R) CPU N3060 @1.60GHz
64-bit Operating System, x64-based processor
Deps: vs_community__1560150700.1495339730.exe,
Setup-Subversion-1.8.17.msi, Python-3.6.1.tar.xz,
vim-master.zip, vim-notebook-master.zip

I'll probably rewrite the python section using version 3.6.2, test_distutils
still fails with that release, but with the 3.6.2 code modifications, test_re
and test_subprocess now pass. Some, not all, of the test_distutils errors
are due to  _msvccompiler.py searching for a non-existent (for VS2017)
Registry key, containing data essentially with the %VCINSTALLDIR%
value , which in former VC releases was the location for vcvarsall.bat.

T. Baruchel's vim-notebook currently only supports Unix-like OSes, which might
include the Win2K-Win8.0 Interix POSIX.1 compliant subsystem, with its mkfifo
utility.

If I have the time I'll look at 2 go implementations of Windows named pipes.

This post currently only provides information on VS2017 compile of Python-3.6.1 and vim80.

Since version 1.2.0 the plugin is compatible with T. Pope's vim-markdown.

https://www.visualstudio.com/downloads/
vs_community__1560150700.1495339730.exe

See the 9pvfs post for the Visual Studio setup.

https://sourceforge.net/projects/win32svn/
Setup-Subversion-1.8.17.msi

Run the above installer as an administrator.

https://www.python.org/downloads/release/python-361/
Python-3.6.1.tar.xz

Try Igor Pavlov's 7-Zip (64-bit x64) for extraction.

https://github.com/nurmi-labs/Python-3.6.1
Python-3.6.1-master.zip

From the extracted Python-3.6.1.tar.xz file remove the PC\bdist_wininst and PCbuild
directories, and replace them with those from the unpacked Python-3.6.1-master.zip
file. Then open a Windows Command Prompt as an administrator, CD to PCbuild
and run the get_externals.bat file. It appears that the tcl-core-8.6.6.0 and tk-8.6.6.0
rules.vc files haven't been upgraded since VS2013, so it's premature to add code
(for v141) into tcl.vcxproj, tcltk.props, tix.vcxproj, and tk.vcxproj.

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>CD \Python-3.6.1\PCbuild

C:\Python-3.6.1\PCbuild>get_externals.bat

...

C:\Python-3.6.1\PCbuild>EXIT

Open in VS the Project/Solution.. file pcbuild.sln, and when the project has been initialized,
change the menu's list boxes settings from Debug to Release and from Win32 to x64, then
Build the Solution.

Open in VS the Project/Solution.. file pcbuild.sln. When the offer to upgrade tcl, tix and tk,
appears just close that window, these files will register in the Solution Explorer as (Visual
Studio 2015) files, but absent having the Windows SDK 8.1 and the Platform toolset v140,
will compile with the current VS2017 Windows SDK 10.0.15063.0 and Platform toolset v141.

The tcl and tk rules.vc files don't allocate for the _MSC_VER macro's minor version number,
so for example, VS2013 should build those externals in Release_AMD64_VC12 rather than
in Release_AMD64_VC12.0. I think the latter would be a preferable approach to be pursued
regarding an eventual tcl and tk rules.vc file upgrade.

MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015)
MSVC++ 14.1 _MSC_VER == 1910 (Visual Studio 2017)

When the project has been initialized, change the menu's list boxes settings from Debug to
Release and from Win32 to x64, then Build the Solution.

Close the IDE and open a Windows Command Prompt as an administrator.

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>CD \

C:\>TYPE move.bat
@ECHO OFF

CD \Python-3.6.1
MKDIR C:\python
PUSHD C:\python
MKDIR DLLs Doc libs Scripts Tools
POPD
PUSHD PCbuild\amd64
MOVE python.exe C:\python
MOVE python3.dll C:\python
MOVE python36.dll C:\python
MOVE pythonw.exe C:\python
MOVE *.pyd C:\python\DLLs
MOVE sqlite3.dll C:\python\DLLs
MOVE tcl86t.dll C:\python\DLLs
MOVE tk86t.dll C:\python\DLLs
MOVE python3.lib C:\python\libs
MOVE python36.lib C:\python\libs
MOVE _tkinter.lib C:\python\libs
MOVE py.exe %windir%
MOVE pyshellext.dll %windir%\pyshellext.amd64.dll
MOVE pyw.exe %windir%
POPD
DEL Lib\distutils\command\*.pdb
MOVE Lib C:\python
MOVE Include C:\python\include
PUSHD Tools
MOVE demo C:\python\Tools
MOVE i18n C:\python\Tools
MOVE parser C:\python\Tools
MOVE pynche C:\python\Tools
MOVE scripts C:\python\Tools
POPD
MOVE LICENSE C:\python
MOVE externals\tcltk64\lib C:\python\tcl
CD PC
MOVE pyconfig.h C:\python\include
CD icons
MOVE py.ico C:\python\DLLs
MOVE pyc.ico C:\python\DLLs
MOVE pyd.ico C:\python\DLLs
CD \
C:\>move.bat

...

C:\>CD \Windows

C:\Windows>%systemroot%\System32\regsvr32.exe pyshellext.amd64.dll

C:\Windows>


C:\Windows>reg.exe query HKEY_CLASSES_ROOT\CLSID\{BEA218D2-6950-497B-9434-61683EC065FE}\InProcServer32

HKEY_CLASSES_ROOT\CLSID\{BEA218D2-6950-497B-9434-61683EC065FE}\InProcServer32
    (Default)    REG_SZ    C:\WINDOWS\pyshellext.amd64.dll
    ThreadingModel    REG_SZ    Apartment


C:\Windows>reg.exe query HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{BEA218D2-6950-497B-9434-61683EC065FE}\InProcServer32

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{BEA218D2-6950-497B-9434-61683EC065FE}\InProcServer32
    (Default)    REG_SZ    C:\WINDOWS\pyshellext.amd64.dll
    ThreadingModel    REG_SZ    Apartment


C:\Windows>EXIT

NB: As the executables were compiled on a machine where vcruntime140.dll was
available, one doesn't need to locate another copy of that file in C:\python.

Add "C:\python\" and "C:\python\Scripts\" to your System Environment Variable PATH.

https://bootstrap.pypa.io/
get-pip.py

Download a copy of the above script and open a Windows Command Prompt as an administrator,

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>CD %HOMEPATH%\Downloads

C:\Users\Eric\Downloads>python.exe get-pip.py
Collecting pip
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 409kB/s
Collecting setuptools
  Downloading setuptools-36.0.1-py2.py3-none-any.whl (476kB)
    100% |████████████████████████████████| 481kB 819kB/s
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |████████████████████████████████| 71kB 1.5MB/s
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-9.0.1 setuptools-36.0.1 wheel-0.29.0

C:\Users\Eric\Downloads>DIR \python\Scripts
 Volume in drive C is Windows
 Volume Serial Number is F6FE-4B0A

 Directory of C:\python\Scripts

07/05/2017  02:20 AM    <DIR>          .
07/05/2017  02:20 AM    <DIR>          ..
07/05/2017  02:20 AM            98,151 easy_install-3.6.exe
07/05/2017  02:20 AM            98,151 easy_install.exe
07/05/2017  02:20 AM            98,123 pip.exe
07/05/2017  02:20 AM            98,123 pip3.6.exe
07/05/2017  02:20 AM            98,123 pip3.exe
07/05/2017  02:20 AM            98,130 wheel.exe
               6 File(s)        588,801 bytes
               2 Dir(s)   2,910,883,840 bytes free

C:\Users\Eric\Downloads>

NB: The file wheel.exe is not installed via running python-3.6.1-amd64.exe.

https://www.python.org/downloads/release/python-361/
python361.chm

Download the above "Windows help file", right click on the .chm file, and from the appearing
context menu click "Properties", then enter a mark ☑ in the box next to the word Unblock
and click the "Apply" button, close the "python361 Properties" window, and relocate the file.

C:\Users\Eric\Downloads>MOVE python361.chm \python\Doc
        1 file(s) moved.

C:\Users\Eric\Downloads>EXIT

There are two batch scripts located in the sidebar to add Registry keys,
if you don't want to install the .chm file then don't run help.bat.

NB: The pre-compiled download of python-3.6.1 contains tcl86tg.lib and
tk86tg.lib, that is, static debug libraries, this post omits their compilation.

To start IDLE from the Windows console (or Shortcut's Target) here's the command.

C:\python\pythonw.exe "C:\python\Lib\idlelib\idle.pyw"

Running 'rt.bat -x64' resulted in the following 3 failed tests.

C:\Python-3.6.1\PCbuild>rt.bat -x64

0:08:23 [106/405] test_distutils

C:\Python-3.6.1\build\test_python_7980>exit 1

C:\Python-3.6.1\build\test_python_7980>exit 0
Warning -- files was modified by test_distutils
test test_distutils failed -- multiple errors occurred; run in verbose mode for details
0:08:30 [107/405/1] test_docxmlrpc -- test_distutils failed

...

0:21:03 [270/405/1] test_re
test test_re failed -- Traceback (most recent call last):
  File "C:\Python-3.6.1\lib\test\test_re.py", line 1425, in test_locale_flag
    self.assertTrue(pat.match(bletter))
AssertionError: None is not true

0:21:08 [271/405/2] test_readline -- test_re failed

...

0:23:41 [318/405/2] test_subprocess
    a DOS box should flash briefly ...
test test_subprocess failed -- Traceback (most recent call last):
  File "C:\Python-3.6.1\lib\test\test_subprocess.py", line 358, in test_cwd_with_pathlike
    self._assert_cwd(temp_dir, sys.executable, cwd=_PathLikeObj())
  File "C:\Python-3.6.1\lib\test\test_subprocess.py", line 336, in _assert_cwd
    **kwargs)
  File "C:\Python-3.6.1\lib\subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "C:\Python-3.6.1\lib\subprocess.py", line 990, in _execute_child
    startupinfo)
TypeError: CreateProcess() argument 8 must be str or None, not _PathLikeObj

0:24:13 [319/405/3] test_sunau -- test_subprocess failed in 32 sec

...

C:\Python-3.6.1\PCbuild>

An Email has been sent 04-07-17 to report@bugs.python.org with the test suite output attached.

test_locale_flag (from test_re.py) was changed in 3.6.2

- enc = locale.getpreferredencoding(False)
+ _, enc = locale.getlocale(locale.LC_CTYPE)

_assert_cwd and test_cwd_with_pathlike (from test_subprocess.py) remained unaltered in 3.6.2

the cited __init__ (from subprocess.py) remained umaltered in 3.6.2

and _execute_child (from subprocess.py) was changed in 3.6.2

- cwd,
+ os.fspath(cwd) if cwd is not None else None,

https://github.com/vim/vim
vim-master.zip

https://github.com/nurmi-labs/ms-sdk
Win32.mak

To compile the PE32+ gvim/vim you'll need a copy of Win32.Mak.

Place this along a parallel directory tree to that of %WindowsSdkDir%.

Open an x64 Native Tools Command Prompt as an administrator.

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26430.15
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\Windows\System32>CD \

C:\>TYPE vim.bat
@ECHO OFF
CD vim-master\src

SET SDK_INCLUDE_DIR=C:\Program Files (x86)\Windows Kits\6.1\Include

nmake.exe -f Make_mvc.mak APPVER=6.0 CPU=AMD64 CSCOPE=no GUI=yes^
MBYTE=yes NETBEANS=no PYTHON3=C:\python DYNAMIC_PYTHON3=yes^
PYTHON3_VER=36 WINVER=0x0600 SUBSYSTEM_VER=6.00

SET VIM=%HOMEDRIVE%\vim

MKDIR %VIM%\vimfiles
DEL ..\runtime\*.cdr
DEL ..\runtime\*.desktop
DEL ..\runtime\*.eps
DEL ..\runtime\*.gif
DEL ..\runtime\*.info
DEL ..\runtime\*.pdf
DEL ..\runtime\*.png
DEL ..\runtime\*.xpm
DEL ..\runtime\termcap
DEL ..\runtime\icons\*.info
DEL ..\runtime\icons\README.txt
RMDIR ..\runtime\icons
MOVE ..\runtime %VIM%\vim80
MOVE *.exe %VIM%\vim80
MOVE GvimExt\*.dll %VIM%\vim80
MOVE tee\*.exe %VIM%\vim80
MOVE xxd\*.exe %VIM%\vim80
CD %VIM%\vimfiles
MKDIR colors compiler doc ftdetect ftplugin indent keymap plugin syntax
C:\>vim.bat

...

C:\vim-master\src>

Add "C:\vim\vim80" to your System Environment Variable PATH.

If you want a console vim.exe start with a freshly extracted vim-master.zip and use
the same command line arguments for the compile as above omitting GUI=yes and
the carets (^), which are for line continuation in batch (.bat) files.

NB: One can't run an 'nmake.exe clean' due to a missing auto\config.h file.

https://sourceforge.net/projects/ctags/files/ctags/5.8/
ctags-5.8.tar.gz

Open an x64_x86 Cross Tools Command Prompt as an administrator.

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26430.15
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64_x86'

C:\Windows\System32>CD \ctags-5.8

C:\ctags-5.8>nmake.exe -f mk_mvc.mak

...

C:\ctags-5.8>MOVE ctags.exe %HOMEDRIVE%\vim\vim80
        1 file(s) moved.

C:\ctags-5.8>EXIT

Some warnings output by the vim compile, for dynamic python3.

if_python3.c
if_python3.c(179): warning C4005: 'PySlice_GetIndicesEx': macro redefinition
c:\python\include\sliceobject.h(52): note: see previous definition of 'PySlice_GetIndicesEx'

https://github.com/baruchel/vim-notebook
vim-notebook-master.zip

Unpack the above download and move notebook.vim.

C:\Users\Eric\Downloads>MOVE vim-notebook-master\plugin\notebook.vim \vim\vimfiles\plugin
        1 file(s) moved.

C:\Users\Eric\Downloads>EXIT

https://github.com/golang/sys
sys-master.zip

https://github.com/Microsoft/go-winio
go-winio-master.zip

C:\Users\Eric\Downloads>MOVE sys-master sys
        1 file(s) moved.

C:\Users\Eric\Downloads>MKDIR %HOMEDRIVE%\go\src\golang.org\x

C:\Users\Eric\Downloads>MOVE sys %HOMEDRIVE%\go\src\golang.org\x

C:\Users\Eric\Downloads>MOVE go-winio-master go-winio
        1 file(s) moved.

C:\Users\Eric\Downloads>MKDIR %HOMEDRIVE%\go\src\github.com\Microsoft

C:\Users\Eric\Downloads>MOVE go-winio %HOMEDRIVE%\go\src\github.com\Microsoft

C:\Users\Eric\Downloads>CD %HOMEDRIVE%\go\src\golang.org\x\sys\windows

C:\go\src\golang.org\x\sys\windows>go.exe install

C:\go\src\golang.org\x\sys\windows>CD %HOMEDRIVE%\go\src\github.com\Microsoft\go-winio

C:\go\src\github.com\Microsoft\go-winio>go.exe install

C:\go\src\github.com\Microsoft\go-winio>EXIT

https://github.com/natefinch/npipe
npipe-2.zip