Go

Go on z/OS

Go on z/OS

This group is a space for open discussions and sharing technical information, and also provides a connection to the wider Go open source community for anyone who is interested in Go on z/OS

 View Only
  • 1.  TUI applications

    Posted Mon April 01, 2024 02:22 PM

    So I figured it would be interesting to see if some TUI applications written in Go would work.  Here are the ones I tried, and the results:

    • Goful (https://github.com/anmitsu/goful): A TUI (it says GUI, but it's TUI) file manager.
      • Built with no issues!
      • The TUI itself works well.
      • Actvating external applications from within Goful assumes you are running a GUI, so that feature of the app doesn't work.
    • Godit (https://github.com/nsf/godit): "A very religious text editor" (TUI)
      • Has issues with the "termbox" modules.  Specifically, it requires some syscall interfaces which z/OS does not seem to have (syscall.O_ASYNC, syscall_IGNBRK and others)
    • Micro (https://github.com/zyedidia/micro):  "A modern and intuitive terminal-based text editor".
      • The z/OS make does not seem to work with the supplied Makefile.
      • I tried  just doing it "directly" (go install /cmd/micro) and get some issues with github.com/zyedidia/tcell/v2@v2.0.10/tscreen.go having "*tScreen does not implement Screen (missing method Beep)" as well as some undefined fields (perhaps because of the prior issue)
    • Murex (https://github.com/lmorg/murex): "A smarter shell".
      • "github.com/creack/pty@v1.1.21/ioctl_inner.go:15:21: undefined: syscall.Syscall"
      • "murex/utils/readline/cursor.go:12:15: undefined: GetSize" and others

    I tried using Wharf to port, but couldn't get that to work either.

    If someone knows more about how to port Go applications to z/OS, I'd love to have some of these installed.  I am especially interested in the Micro editor, as I've never really learned Vi(m), and really don't want to.



    ------------------------------
    Frank Swarbrick
    ------------------------------


  • 2.  RE: TUI applications

    Posted Mon April 01, 2024 06:17 PM

    Goful: Glad it worked for you!
    Godit: syscall.IGNBRK is supported in Go 1.22 (available now). Unfortunately O_ASYNC is not supported on z/OS at this time.

    Murex: syscall.Syscall is supported in Go 1.22 for some cases, including this one. I tried building it and found lots of files missing zos tags or versions. For instance utils/readline/raw_unix.go needs zos added to the build tags. Also I created the file utils/readline/raw_zos.go which was a copy of utils/readline/raw_linux.go but with zos in the build tag instead of linux. There are other such tagging issues which Wharf should be able to handle (and if it doesn't I'd really like to know specifics of where it fails so we can fix it). 

    Micro: haven't tried it yet

    I'll post again if more info becomes available.



    ------------------------------
    Bill O'Farrell
    Senior Technical Manger, Go on z/OS
    ------------------------------



  • 3.  RE: TUI applications

    Posted Mon April 01, 2024 06:23 PM

    Thanks, Bill, I'll see about getting Go 1.22 and give it another try.



    ------------------------------
    Frank Swarbrick
    ------------------------------



  • 4.  RE: TUI applications

    Posted Tue April 02, 2024 01:45 PM

    FYI -- to get all the syscalls supported in Go 1.22, you'll need PTFs installed for a couple of APARs:

    z/OS V2.5

    ·     OA62757

    ·     PH45182

    z/OS 3.1

    ·     OA62757

    ·     PH57159



    ------------------------------
    Bill O'Farrell
    Senior Technical Manger, Go on z/OS
    ------------------------------



  • 5.  RE: TUI applications

    Posted Tue April 02, 2024 01:54 PM

    Yeah, I saw that.  I've asked my sysprog if those have been applied (unlikely), and if not when they can be.  So can't do anything until then.  Ah well.  It's always something!



    ------------------------------
    Frank Swarbrick
    ------------------------------



  • 6.  RE: TUI applications

    Posted Thu April 04, 2024 02:23 PM

    So guess what, I got the "micro" editor application working!  I had to make a few manual changes, both to the micro project and some of its dependencies.  For example, in one directory there were two related files with different constraints.  Neither one, obviously contained the zos tag, so I guess both got bypassed.  Not sure how go chooses the proper file for a constraint that is not specified in one of the files.  Anyway, I added it and got it to compile.  And it works!  So far, I have not run into any issues using it.  So, this is quite wonderful.  Now I have a full screen terminal-based editor that I can actually use.  Great!



    ------------------------------
    Frank Swarbrick
    ------------------------------



  • 7.  RE: TUI applications

    Posted Thu April 04, 2024 04:44 PM

    Wow - that's great that you got Micro to work! We have opened a defect against Wharf for the tagging problem, and hopefully that can be fixed in short order.

    As for Godit, unfortunately I don't think Godit is going to work without O_ASYNC.

    Thanks for your update!



    ------------------------------
    Bill O'Farrell
    Senior Technical Manger, Go on z/OS
    ------------------------------



  • 8.  RE: TUI applications

    Posted Thu April 04, 2024 06:15 PM

    Godit was only a backup for micro, anyway.  So no big deal.



    ------------------------------
    Frank Swarbrick
    ------------------------------