Build Grafana with source code on mainframe z/OS USS (Unix System Services)

Hi, I am trying to build Grafana through the source code on USS (Unix System Services) on z/OS version 2.04 (Version 2 Release 4). The following are the steps I followed.

I cloned the Grafana 8.0.x source code from git: GitHub - grafana/grafana: The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.

  1. Installed NodeJS version v14.16.0, npm version 6.14.11, yarn version 1.22.11
  2. Installed Go (version go1.15.8 zos/s390x) and have set GOROOT and GOPATH env variables
  3. exported the certificate file with: export SSL_CERT_FILE=/u/home/ca/cacert.pem
  4. The make version is: GNU Make 4.3.
  5. When I run ‘make all’ I get the below error (see image):
    It says platform “os390” is not supported for node package node-cachedir.

It is very important that I build Grafana for z/OS under USS (Unix System Services). Could some one pls help?


Given that the error message you are getting is regarding building a nodejs
package, I think you might be better off asking about this on a nodejs forum /
list, because you don’t actually have any problem with Grafana at this stage.


I have raised the issue with the folks who own the node-cachedir package. The fact that this issue prevents Grafana from getting installed, pls keep this thread for tracking.
Add os390 platform · Issue #16 · LinusU/node-cachedir (

Why do you need to run Grafana on a mainframe?

I’m not asking this to be difficult; there are just plenty of other ways to run it. I would encourage you to evaluate whether one of those other ways might work for you/your client after all. Those other ways don’t require asking the developer of a package that was last updated 2 years ago, to add support for a system that was discontinued 20 years ago.

We need to build the Grafana 8.0 from source code on z/OS 2.04 and do customizations like Theme Changes, custom RACF/SAF Authentication, custom Datasources etc and many more. Hence I need to change the source code…my task is not just to install and run Grafana and do monitoring stuff…Hope I have explained you well enough. Pls feel free to ask.

Got it @sivauk that’s quite the task!

If you’re going to be making code modifications anyway, I think it may be quite easy to remove the node-cachedir dependency and implement the functionality directly (what the package does is quite trivial). Though I suspect there will be other packages where you run into the same issue, so you might end up in a world of pain nonetheless.

I have gone past the node-cachedir error by setting the XDG_CACHE_HOME env variable as: export XDG_CACHE_HOME=~/software/cache-dir/

Then executed “make run all”. After that now I have hit an sqlite3 error that says “unable to find value of constant C.SQLITE_IOERR_NOMEM”. Pls refer attachment.

Any ideas how to go past this?

I’m afraid that I don’t think anyone on this forum will be able to help with this @sivauk.

As @pooh said in his first response, these aren’t really Grafana-specific issues - rather they’re specific to trying to get 3rd party packages to build in an exotic/obsolete environment. So you’d be better off seeking help in the communities/resources for those respective packages.

By the way, I’m afraid that it looks like you have quite a few other errors apart from the final sqlite one in the screenshot - not sure what those are about, but I wouldn’t expect quite so many “undefined” errors during a build.