compile/centos_pkg_dirs
Scott Little f859498105 multiple golang versions
Kubernetes will soon be upgraded.  We wish to go from version
1.18 to 1.21.1.  The Kubernetes upgrade support is limited,
so we will also have to support several intermediate versions.
Each version of kubernetes is very explicit about the prefered version
of golang that is required to compile it.

This update makes four versions of golang available for
downstream packages to compile against.
1.13.9
1.13.15
1.15.14
1.16.6

The golang version has been made part of the package names to prevent
rpm from merely installing the latest.  So packages 'golang-1.13.9',
'golang-1.13.15', 'golang-1.15.14' and 'golang-1.16.6' replace ipackage
'golang'.

Installation paths also incorporate the golang version, so each resides
in a different directory structure.

The 'alternatives' facility is used to map 'go' to version 1.16.6 (the
newest), thereby establishing it as the default

The rpm macros are now version qualified.  Use of non-qualified macros
is still supported and will map to the default version (1.16.6)

The 'provides' of the older golang packages is reduced, such that
1.16.6 , with a full provide list, is the default under typical usage.

Selection of 1.16.6 is slightly problematic for older spec files, as
GOPATH is no longer the default way to find modules.  Backward
compatibility can be established by adding the following to the %build
section
- go env -w GO111MODULE=auto

Selection of a none default version of golang for build purposes is as
follows:
- use the version qualified package name in your BuildRequires.
- Prefix your PATH variable with the installation path of the desired
  golang version

example spec ....

%global go_version              1.13.9
%global go_path
%/usr/lib/golang-%{go_version}-%{go_version}/bin
...
BuildRequires: golang-%{go_version}
...
%build
export PATH=%{go_path}:$PATH
go env -w GO111MODULE=auto

Story: 2008972
Task: 42654
Change-Id: I9223b9ec878933a744f32e3a58be38798873365d
Signed-off-by: Scott Little <scott.little@windriver.com>
2021-08-17 13:08:58 -04:00

9 lines
163 B
Plaintext

languages/bash
tools/golang-dep
tools/rpm
languages/python-2.7.5
languages/golang-1.13.9
languages/golang-1.13.15
languages/golang-1.15.14
languages/golang-1.16.6