Troubleshooting

Run clang failed

Run the following commands:
export COMPILER_PATH=<path_to_compiler_invocation_command>
eval $(<go_installation_path>/go/etc/goz-env)

Certificate signed by unknown authority

When you run a Go application on z/OS® that uses packages outside of the standard Go library, you might encounter this error: Certificate signed by unknown authority. This might be a result of Git failure under the openSSL framework. You can try to fix the problem by using one of the following methods:
  • Set the SSL_CERT_FILE environment variable correctly, and then export SSL_CERT_FILE variable.
  • Source .envsetup in go/etc, which sets the SSL_CERT_FILE to go/etc/cacert.pem.

After you download the packages, you need to add build tags to port the applications to z/OS. See Porting applications to z/OS for more details.

Messages about finding or downloading x/sys/unix, x/crypto, or x/net

When you see this message, try the following solutions:
  • Edit the go.mod file by changing the version number of golang.org/x/sys/unix, x/crypto, or x/net packages to the word "latest".
  • Run the following command:
    go install
  • Change the minimum Go version to Go 1.17.

Undefined errors

You might encounter undefined errors in the following cases:

  1. The package has a Unix version of the file but no z/OS build tag.

    To tackle this problem, add z/OS to the + build line at top of the file.

  2. The package only has a Linux® version of the file but all functionality that is used in the file exists on z/OS.

    To tackle this problem, add z/OS to the + build line at top of the file.

  3. The function uses Syscall(…) or RawSyscall(...).

    This is not supported on z/OS. You need to make z/OS version of this function.

Cannot locate CEE.SCEEBND2 data set

If you build Go programs under the default z/OS UNIX System Services, you're supposed to locate CEE.SCEEBND2 data set. If you encounter the following error message, there might be something missing in your configuration.
FSUM3052 The data definition name SYSLIB cannot be resolved. The data set was 
not found. Ensure that data set name CEE.SCEEBND2 is specified correctly.        
open /tmp/go-build794287247/b001/exe/hello: EDC5129I No such file or directory.

Export environment variables in your environment for the prefixes.

export _C89_PLIB_PREFIX=CEE
export _C89_CLIB_PREFIX=SYS1

If this still does not work, consult your system administrator to find out the right prefix. For more details, see Unix System Services Command Reference.

Cannot produce dumps

Try the following procedure to cause a dump to occur:
  1. Set the Language Environment® runtime environment with the command:
    export _CEE_RUNOPTS=FILETAG(AUTOCVT,AUTOTAG) TERMTHDACT(UADUMP) ABTERMENC(ABEND)
  2. Disable the Go signal handler for the signal in question by setting the signal handler to the default. This can be done in either your C code or Go code.
  3. Export your dump with the following command:
    export _BPXK_MDUMP=your_dump_data_set_name