28 August 2017

bootstrapping go

System: Slackware Linux (version 14.0)
CPUs: Intel(R) Atom(TM) CPU N270 @1.60GHz
Deps: go1.4-bootstrap-20170531.tar.gz,
go1.9.src.tar.gz

I haven't tested V. Batts Slackbuild (unmodified or modified) on the
Slackware Linux version for which it was written, namely 14.2; this
post uses version 14.0. For linux/386 cgo is enabled by default.

Go 1.4 was the last version where the toolchain was written in C.

This entry will compile 1.4 and then use that to bootstrap 1.9.

https://golang.org/doc/install/source
go1.4-bootstrap-20170531.tar.gz

Download and extract the above file into root's home directory,
rename the folder, then cd into go1.4/src and run make.bash.

bash-4.2# tar xvf go1.4-bootstrap-20170531.tar.gz

...

bash-4.2# mv go go1.4
bash-4.2# cd go1.4/src
bash-4.2# ./make.bash

...

Installed Go for linux/386 in /root/go1.4
Installed commands in /root/go1.4/bin
bash-4.2# exit

http://slackbuilds.org/repository/14.2/development/google-go-lang/
google-go-lang.tar.gz

Download and extract the above file into root's home directory,
and then edit the google-go-lang.SlackBuild file as follows.

- VERSION=${VERSION:-1.8.3}
+ VERSION=${VERSION:-1.9}

- export GOROOT_BOOTSTRAP="/usr" # gcc 5+ is go1.4 API, so we'll bootstrap with it
+ # export GOROOT_BOOTSTRAP="/usr" # gcc 5+ is go1.4 API, so we'll bootstrap with it

chmod 0755 $PKG/etc/profile.d/go.sh
+
+ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

https://golang.org/dl/
go1.9.src.tar.gz

Download the above file, then copy it into ~/google-go-lang
and build.

bash-4.2# cd google-go-lang
bash-4.2# ./google-go-lang.SlackBuild

...

Slackware package /tmp/google-go-lang-1.9-i586-1_SBo.tgz created.

bash-4.2#  cd ..
bash-4.2# rm -r go1.4
bash-4.2# rm -r google-go-lang
bash-4.2# rm -r /tmp/SBo
bash-4.2# installpkg /tmp/google-go-lang-1.9-i586-1_SBo.tgz
Verifying package google-go-lang-1.9-i586-1_SBo.tgz.
Installing package google-go-lang-1.9-i586-1_SBo.tgz:
PACKAGE DESCRIPTION:
# google-go-lang (Google's Go Language kit with gc tool chain)
#
# The Go programming language is an open source project to make
# programmers more productive. Go is expressive, concise, clean, and
# efficient. Its concurrency mechanisms make it easy to write programs
# that get the most out of multicore and networked machines, while its
# novel type system enables flexible and modular program construction.
#
Package google-go-lang-1.9-i586-1_SBo.tgz installed.

bash-4.2# exit

The makepkg script called by the Slackbuild will output a warning about
about issue6550.gz, this is expected, the file is used by gunzip_test.go.

Reboot and test your installation.

https://golang.org/doc/install/source#testing

Go 1.9 release notes.

CL 994044CL 4639077CL 4808043
Updated: 10-11-2017

I presume both of the .tar.gz (golang source) files used in the following are outdated

I'll probably write modified versions of the below utilising the net and tools repositories
downloaded as .zip files, and further an additional SlackBuild for the blog repository, .

gonet / https://github.com/golang/net
gotools / https://github.com/golang/tools

15 August 2017

9p

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

This post is not finished.

See the 9pvfs post for the Visual Studio setup, and
the vim-notebook post for the python3 installation.

Installation of T. Newsham's 9P client/server implementation in Python.

http://www.thenewsh.com/~newsham/plan9/
9p.tgz

https://github.com/nurmi-labs/py9p
py9p-master.zip

Presently I don't have Plan 9 installed on a machine, and am unable to test the upgrade to python3.

https://www.dlitz.net/software/pycrypto/

https://www.pycryptodome.org/en/latest/

NB: The instructions for a Vim80 64bit compile will produce an executable enabled for arabic, farsi,
and python3.

Currently available functional programming languages' 9P implementations.

http://nurmi-labs.blogspot.com/2017/01/patching-network-ninep.html

http://nurmi-labs.blogspot.com/p/9p-scheme.html

http://chicken.kitten-technologies.co.uk/cache/4/9p/0.9/
[depends on A. Shinn's integer sets (isets)]

10 August 2017

cURL

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,
curl-7.55.0.zip

Installation of curl-7.55.0.

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

See the 9pvfs post for the Visual Studio setup,
and OpenSSL installation.

https://curl.haxx.se/download.html
curl-7.55.0.zip

Open an x64_x86 Cross Tools Command Prompt as an administrator.

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

C:\Windows\System32>CD \curl-7.55.0\winbuild

C:\curl-7.55.0\winbuild>nmake.exe /f Makefile.vc mode=dll WITH_DEVEL=c:\progra~2\openssl WITH_SSL=dll ENABLE_WINSSL=no MACHINE=x86

...

C:\curl-7.55.0\winbuild>MOVE ..\builds\libcurl-vc-x86-release-dll-ssl-dll-ipv6-sspi c:\progra~2\curl
        1 dir(s) moved.

C:\curl-7.55.0\winbuild>EXIT

Add "C:\Program Files (x86)\curl" to your System Environment Variable PATH.

08 August 2017

Eris

System: Slackware Linux (version 14.0)
CPUs: Intel(R) Atom(TM) CPU N270 @1.60GHz
Deps: eris-master.zip, ucspi-tcp-0.88.tar.gz

Installation of N. Pickett's eris-4.4.

http://slackbuilds.org/repository/14.2/network/ucspi-tcp/

bash-4.2# installpkg ucspi-tcp-0.88-486-1_SBo.tgz

...

bash-4.2# exit

https://github.com/nealey/eris
eris-master.zip

bash-4.2#  cd eris
bash-4.2# make
awk -F : 'NR==1 {printf("const char *FNORD = \"eris/%s\";\n", $1);}' CHANGES > version.h
cc -Wall -Werror   -c -o eris.o eris.c
cc -Wall -Werror   -c -o strings.o strings.c
cc -Wall -Werror   -c -o mime.o mime.c
cc -Wall -Werror   -c -o timerfc.o timerfc.c
cc   eris.o strings.o mime.o timerfc.o   -o eris
bash-4.2#

bash-4.2# ./test.sh
HTTPD: ./eris 
CGI:   ./eris -c 
IDX:   ./eris -d 
Basic tests          .............
Options              .
Tomfoolery           .....
If-Modified-Since    ........
Directory indexing   ...
CGI                  .............
Timeouts             .
CONNECT handler      .
fnord bugs           .......
52 of 52 tests passed (0 failed).
bash-4.2# exit

07 August 2017

K95

System: Microsoft Windows XP Home Edition
CPUs: Intel(R) Atom(TM) CPU N270 @1.60GHz

Installing the Individual components for VS2017 as follows
adds a (910 MB) %VCToolsInstallDir%atlmfc directory, and
for that reason I first have pursued building C-Kermit (K95)
on a VS2008 Express installation.

MFC and ATL support (x86 and x64)
Visual C++ ATL support

TODO: see whether afxres.h can be replaced with winresrc.h in cknker.rc

I had a look today at D.R. Goodwin's work on K95.

https://github.com/davidrg/ckwin
ckwin-master.zip

I only built the Console application, and, as one can see from the output XYZMODEM,
SSH, Kerberos, SRP and SSL, have been disabled.

As I was on XP I could safely comment out the following lines in kermit\k95\cknker.rc.

// #define APSTUDIO_READONLY_SYMBOLS
// #include "afxres.h"
// #undef APSTUDIO_READONLY_SYMBOLS

Setting environment for using Microsoft Visual Studio 2008 x86 tools.

C:\Programmer\Microsoft Visual Studio 9.0\VC>CD \ckwin

C:\ckwin>TYPE setenv.bat
@ECHO OFF
SET ROOT=C:\ckwin
SET INCLUDE=%INCLUDE%%ROOT%\kermit\k95;

C:\ckwin>setenv.bat

C:\ckwin>CD kermit\k95

C:\ckwin\kermit\k95>mknt.bat

...

C:\ckwin\kermit\k95>DIR *.exe
 Disken i drev C har ikke noget navn.
 Diskens serienummer er C804-10A1

 Indhold af C:\ckwin\kermit\k95

07-08-2017  01:58         3.543.040 cknker.exe
07-08-2017  01:55            65.024 ckwart.exe
07-08-2017  01:59             8.704 ctl3dins.exe
07-08-2017  01:59            20.992 iksd.exe
07-08-2017  01:59            23.552 iksdsvc.exe
07-08-2017  01:58            10.752 k95d.exe
07-08-2017  01:58             6.144 rlogin.exe
07-08-2017  01:58             6.144 telnet.exe
07-08-2017  01:58            18.432 textps.exe
               9 fil(er)        3.702.784 byte
               0 mappe(r)  63.133.499.392 byte ledig

C:\ckwin\kermit\k95>

Some example output from cknker.exe.

[C:\ckwin\kermit\k95\] C-Kermit> SHOW FEATURES
C-Kermit  OPEN SOURCE:, Aug  7 2017
Microsoft Windows Operating Systems for 32-bit Intel CPUs.

Major optional features included:
 Large files and large integers (64 bits)
 Network support (type SHOW NET for further info)
 Telnet Kermit Option
 Telnet Authentication Option
 Telnet Encryption Option
 Telnet DES Encryption
 Telnet CAST Encryption
 X Windows forwarding
 Telnet Remote Com Port Control Option
 SOCKS 4
 Built-in FTP client
 Built-in HTTP client
 Hardware flow control
 Latin-1 (West European) character-set translation
 Latin-2 (East European) character-set translation
 Cyrillic (Russian, Ukrainian, etc) character-set translation
 Greek character-set translation
 Hebrew character-set translation
 Japanese character-set translation
 Unicode character-set translation
 Unicode support for ISO-2022 Terminal Emulation
 REDIRECT command
 RESEND command
 Fullscreen file transfer display
 Control-character unprefixing
 Streaming
 Autodownload
 Mouse support
 Internet Kermit Service with user login support

Major optional features not included:
 No built-in XYZMODEM protocols
 No Secure Shell (SSH)
 No Kerberos(TM) authentication
 No SRP(TM) (Secure Remote Password) authentication
 No Secure Sockets Layer (SSL) protocol
 No Transport Layer Security (TLS) protocol

Host info:
 Machine:    intel-6
 Model:      (unknown)
 OS:         Windows 2000/XP
 OS Release: 5.01
 OS Version: (2600) Service Pack 3

Compiled Aug  7 2017 01:56:24, options:
 __STDC__ ARRAYREFLEN=1024 BIGBUFOK BROWSER CK_ANSIC CK_ANSILIBS CK_APC
 CK_AUTODL CK_CURSES CK_ENVIRONMENT CK_FAST CK_FORWARD_X CK_LOGIN CK_MKDIR
 CK_NAWS CK_PCT_BAR CK_RECALL CK_RTSCTS CK_SOCKS CK_SPEED CK_TAPI CK_TIMERS
 CK_TMPDIR CK_TTGWSIZ CK_TTYFD CKFLOAT=double CKHTTP CKLEARN CKMAXOPEN=20
 CKMAXPATH=255 CKREALPATH CKREGEX CKROOT CKSYSLOG CKTUNING CMDBL=32763
 CMDDEP=64 DCMDBUF DEVNAMLEN=255 DYNAMIC FD_SETSIZE=64 FNFLOAT FOPEN_MAX=20
 FORDEPTH=32 GFTIMER h_addr HADDRLIST HWPARITY IFDEBUG IKS_OPTION IKSDB
 IKSDCONF INBUFSIZE=32768 INPBUFSIZ=4096 LINBUFSIZ=32773 MAC_MAX=16384
 MACLEVEL=128 MAXDDIR=32 MAXDNUMS=4095 MAXGETPATH=128 MAXTAKE=54
 MAXWLD=unlimited MDMHUP MSENDMAX=1024 NETCMD NETCONN NETDLL NETFILE NEWFTP
 NO_DNS_SRV NO_PARAM_H NPIPE NT OBUFSIZE=32768 OS2 OS2MOUSE OS2ORUNIX OS2ORVMS
 PARSENSE PATTERNS PIPESEND RENAME RLOGCODE SELECT SIG_V SO_DONTROUTE
 SO_KEEPALIVE SO_LINGER SO_OOBINLINE SO_RCVBUF SO_SNDBUF SOL_SOCKET STREAMING
 SYSUTIMEH TCP_NODELAY TCPSOCKET TIMEH TLOG TN_COMPORT TNCODE UIDBUFLEN=256
 UNPREFIXZERO USE_MEMCPY VNAML=4096 WHATAMI z_maxchan=2 Z_MAXCHAN=2 ZXREWIND

 byte order: little endian

 sizeofs: int=4 long=4 CK_OFF_T=8 size_t=4 short=2 char=1 char*=4 float=4
 double=8

 floating-point: precision=16 rounding=1

[C:\ckwin\kermit\k95\] C-Kermit>

 K95 Command Screen | Help: Alt-H | Terminal: CONNECT or Alt-X

04 August 2017

regexp

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

This post will look at compiling R. Cox's libregexp9, a port
of Plan 9's Unicode-capable regular expression library.

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

See the 9pvfs post for the Visual Studio setup

https://swtch.com/plan9port/unix/
mk-with-libs.tgz

Replace memccpy with _memccpy, write with _write, and unistd.h with io.h, in the libfmt,
libregexp and libutf, subdirectories. You can also add _CRT_SECURE_NO_WARNINGS
to your preprocessor definitions so as to suppress certain warnings.

The files from libfmt as test.c, test2.c and test3.c, and from libregexp as test.c and test2.c
were removed before attempting the compile. I can't say at this point of time whether their
removal was the cause of any of the below warnings being output. The mk executable uses
sys/wait.h which likewise to unistd.h is unavailable on visual studio. I can't say at this point
of time if a substitute for the required (for mk) sys/wait.h functions would be able to be found
among the visual studio provided header files.

See also https://github.com/nurmi-labs/9pm

TODO: read 9pm's u.h

1>------ Build started: Project: libutf, Configuration: Release Win32 ------
1>rune.c
1>rune.c(132): warning C4244: '=': conversion from 'long' to 'char', possible loss of data
1>rune.c(141): warning C4244: '=': conversion from 'long' to 'char', possible loss of data
1>rune.c(153): warning C4244: '=': conversion from 'long' to 'char', possible loss of data
1>rune.c(163): warning C4244: '=': conversion from 'long' to 'char', possible loss of data
1>runestrcat.c
1>runestrchr.c
1>runestrcmp.c
1>runestrcpy.c
1>runestrdup.c
1>runestrecpy.c
1>runestrlen.c
1>runestrncat.c
1>runestrncmp.c
1>runestrncpy.c
1>runestrrchr.c
1>runestrstr.c
1>runetype.c
1>utfecpy.c
1>utflen.c
1>utfnlen.c
1>utfrrune.c
1>utfrune.c
1>utfutf.c
1>Generating Code...
1>libutf.vcxproj -> C:\mk\libutf\Release\libutf.lib
1>Done building project "libutf.vcxproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

1>------ Build started: Project: libfmt, Configuration: Release Win32 ------
1>charstod.c
1>dofmt.c
1>dorfmt.c
1>errfmt.c
1>fltfmt.c
1>fmt.c
1>fmtfd.c
1>fmtfdflush.c
1>fmtlocale.c
1>fmtlock.c
1>fmtnull.c
1>fmtprint.c
1>fmtquote.c
1>fmtrune.c
1>fmtstr.c
1>fmtvprint.c
1>fprint.c
1>nan64.c
1>pow10.c
1>print.c
1>Generating Code...
1>Compiling...
1>runefmtstr.c
1>runeseprint.c
1>runesmprint.c
1>runesnprint.c
1>runesprint.c
1>runevseprint.c
1>runevsmprint.c
1>runevsnprint.c
1>seprint.c
1>smprint.c
1>snprint.c
1>sprint.c
1>sprint.c(24): warning C4146: unary minus operator applied to unsigned type, result still unsigned
1>strtod.c
1>vfprint.c
1>vseprint.c
1>vsmprint.c
1>vsnprint.c
1>Generating Code...
1>libfmt.vcxproj -> C:\mk\libfmt\Release\libfmt.lib
1>Done building project "libfmt.vcxproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

1>------ Build started: Project: libregexp, Configuration: Release Win32 ------
1>regaux.c
1>regcomp.c
1>regerror.c
1>regexec.c
1>regsub.c
1>rregexec.c
1>rregsub.c
1>Generating Code...
1>libregexp.vcxproj -> C:\mk\libregexp\Release\libregexp.lib
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Endeavouring to compile libbio produced the following warnings.

1>------ Build started: Project: libbio, Configuration: Release Win32 ------
1>bbuffered.c
1>bcat.c
1>bcat.c(28): warning C4013: 'Bfmtinit' undefined; assuming extern returning int
1>bcat.c(30): warning C4013: 'Bfmtflush' undefined; assuming extern returning int
1>bcat.c(45): warning C4013: 'exit' undefined; assuming extern returning int
1>bfildes.c
1>bflush.c
1>bgetc.c
1>bgetd.c
1>bgetrune.c
1>binit.c
1>boffset.c
1>bprint.c
1>bputc.c
1>bputrune.c
1>brdline.c
1>brdstr.c
1>bread.c
1>bseek.c
1>bseek.c(34): warning C4244: '+=': conversion from 'vlong' to 'int', possible loss of data
1>bseek.c(48): warning C4244: 'function': conversion from 'vlong' to 'long', possible loss of data
1>bseek.c(55): warning C4244: 'function': conversion from '__int64' to 'long', possible loss of data
1>bvprint.c
1>bwrite.c
1>Generating Code...
1>libbio.vcxproj -> C:\mk\libbio\Release\libbio.lib
1>Done building project "libbio.vcxproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

NB: A test compile of an extracted mk-with-libs.tgz on
a GNU/Linux machine doesn't output these warnings.

See also: http://nurmi-labs.blogspot.com/2015/10/regexp.html