Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-3103

udi: golang lang server :: migrate from pkgs.devel lookaside sources file with asset-* to cachito; update to latest gopls

XMLWordPrintable

      To get closer to prod sec and legal requirements, we should move from get-sources.sh -> asset*.gz file for the golang lang server dependencies, and instead use cachito w/ container.yaml configuration to fetch sources, then build the sources inside a Docker context, letting cachito find the golang dependencies needed to build the lang server in golangci/golangci-lint.

      Once the remote_source map described above is set in container.yaml, you can now copy the upstream sources (with bundled dependencies) provided by cachito in your build image by adding:

      COPY $REMOTE_SOURCE $REMOTE_SOURCE_DIR
      to your Dockerfile. From this point on, you will find the root of the upstream project at $REMOTE_SOURCE_DIR/app, and the project dependencies at $REMOTE_SOURCE_DIR/deps.

      then

      WORKDIR $REMOTE_SOURCE_DIR/app
      RUN source $CACHITO_ENV_FILE && go build .

      https://osbs.readthedocs.io/en/latest/users.html?highlight=cachito%20node#fetching-source-code-from-external-source-using-cachito

      Note that delv is not supported on IBM Z and Power, so you might need an arch-aware block in the dockerfile like this:

              mkuznets Mykhailo Kuznietsov
              nickboldt Nick Boldt
              Jana Vrbkova Jana Vrbkova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: