Commit Graph

358 Commits

Author SHA1 Message Date
Jordan Liggitt
a2bba333cc
Drop development dependencies from test targets 2023-03-22 10:38:42 -04:00
Davanum Srinivas
26313ed2b0
Move the arm deprecation notice in a different spot
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-03-17 10:28:32 -04:00
Sascha Grunert
1c0a5aa84a
Link apiextensions-apiserver binary statically
The apiextensions-apiserver itself only depends on the following runtime
libraries when linking dynamically:

```
> ldd _output/bin/apiextensions-apiserver
        linux-vdso.so.1 (0x00007ffd1b39f000)
        libpthread.so.0 => /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libpthread.so.0 (0x00007fe836022000)
        libc.so.6 => /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6 (0x00007fe835e00000)
        /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/ld-linux-x86-64.so.2 => /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib64/ld-linux-x86-64.so.2 (0x00007fe836029000)
```

We now move the apiextensions-apiserver to become a static binary as
well to achieve maximum portability.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-03-13 09:00:36 +01:00
Davanum Srinivas
320cb6d9ef
Revert "Disable unified build and static init optimization for tests"
This reverts commit e20d77bb79.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-03-11 14:09:16 -05:00
Kubernetes Prow Robot
bb6c6fad2c
Merge pull request #115742 from dims/drop-32-bit-platforms
Drop 32 bit linux/arm platform
2023-03-11 06:12:40 -08:00
Kubernetes Prow Robot
5452109c9d
Merge pull request #114227 from saschagrunert/kube-aggregator-static
Link `kube-aggregator` binary statically
2023-03-10 15:22:39 -08:00
Davanum Srinivas
5da6f786df
Drop linux/arm from regular builds
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-03-06 17:31:50 -05:00
cpanato
65230338ad
[go] Bump images, dependencies and versions to go 1.20.1
Signed-off-by: cpanato <ctadeu@gmail.com>
2023-02-16 13:38:32 +01:00
Jordan Liggitt
e20d77bb79
Disable unified build and static init optimization for tests 2023-02-10 17:57:56 -05:00
cpanato
b9ddf07a75
[go] Bump images, dependencies and versions to go 1.20
Signed-off-by: cpanato <ctadeu@gmail.com>
2023-02-03 22:55:24 +01:00
Jordan Liggitt
fa66ec647d
Invoke gimme from kube::golang::verify_go_version
Defaults to ensuring .go-version is used
Override the go version by setting GO_VERSION=1.x
Force using the host go version with FORCE_HOST_GO=y
2023-02-01 17:03:30 -05:00
Tim Hockin
7c262b901f
Set GOCACHE and GOMODCACHE
If these are not set, set them.  This ensures that any subsequent
scripts we call (which may call setup_env again) use the same values.
2023-01-21 11:16:14 -08:00
Sascha Grunert
8a96ed0d20
Link kubectl-convert binary statically
The kubectl-convert binary itself only depends on the following runtime
libraries when linking dynamically:

```
> ldd _output/bin/kubectl-convert
        linux-vdso.so.1 (0x00007ffef0786000)
        libpthread.so.0 => /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libpthread.so.0 (0x00007f5f4ac25000)
        libdl.so.2 => /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libdl.so.2 (0x00007f5f4ac20000)
        libc.so.6 => /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6 (0x00007f5f4aa00000)
        /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/ld-linux-x86-64.so.2 => /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib64/ld-linux-x86-64.so.2 (0x00007f5f4ac2c000)
```

We now move kubectl-convert to become a static binary as well to achieve
maximum portability.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-12-01 11:23:26 +01:00
Sascha Grunert
3698434d6b
Link kube-aggregator binary statically
The kube-aggregator itself only depends on the following runtime
libraries when linking dynamically:

```
> ldd _output/bin/kube-aggregator
        linux-vdso.so.1 (0x00007fff1616f000)
        libpthread.so.0 => /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libpthread.so.0 (0x00007fad9339a000)
        libc.so.6 => /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6 (0x00007fad93000000)
        /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/ld-linux-x86-64.so.2 => /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib64/ld-linux-x86-64.so.2 (0x00007fad933a1000)
```

We now move the kube-aggregator to become a static binary as well to
achieve maximum portability.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-12-01 11:20:24 +01:00
Benjamin Elder
db9c760ee7 remove clearly unnecessary lingering BUILD file references 2022-10-04 16:47:25 -07:00
Davanum Srinivas
866ef3c46e
run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-09-24 13:27:13 -04:00
Davanum Srinivas
a2408f39c7
[golang] Fix things commented out in 1.19rc2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-08-04 10:27:09 -04:00
Davanum Srinivas
4784b58e17
golang: Update to 1.19rc2 from 1.18.3
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Kubernetes Prow Robot
a0fe0d6b37
Merge pull request #111131 from thockin/coverage-handle-relative-paths
Make coverage handle relative-path pkgs
2022-07-15 02:26:25 -07:00
Kubernetes Prow Robot
7e2c02d4c8
Merge pull request #111133 from thockin/comment-build_binaries_for_platform
Add comment on build_binaries_for_platform
2022-07-14 16:26:47 -07:00
Kubernetes Prow Robot
08117cdd76
Merge pull request #111132 from thockin/remove-unused-platform-envs-func
Remove unused `unset_platform_envs` func
2022-07-14 16:26:36 -07:00
Tim Hockin
8461a645d6 Add comment on build_binaries_for_platform 2022-07-13 20:33:32 -07:00
Tim Hockin
4b8e3a0b54 Remove unused unset_platform_envs func 2022-07-13 20:33:24 -07:00
Tim Hockin
15cab6d085 Make coverage handle relative-path pkgs 2022-07-13 20:33:12 -07:00
Tim Hockin
0863919807 Add comments around go install 2022-07-13 20:33:03 -07:00
Patrick Ohly
f7427d07e0 build: add ginkgo aliases for WHAT
The alias for vendor/github.com/onsi/ginkgo/ginkgo ensures that code like
30e99cb2a9/experiment/kind-conformance-image-e2e.sh (L110)
continues to work. The one without "vendor/" is there just in case that it
was used because it also worked.

Long term, "ginkgo" is a nicer, version independent alias. It gets used
internally to avoid future churn and gets documented also publicly in the
Makefile help.

The caveat is that there's no guarantee that a future v3 CLI will be compatible
with current invocations. But the most common usage is through
hack/ginkgo-e2e.sh, which can deal with such differences.
2022-07-08 10:46:11 +08:00
Dave Chen
375b2a5fb2 Build Ginkgo binary
Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-07-08 10:46:11 +08:00
Hemant Kumar
86cd654371 We need to all all=-N -l because some objects are being optimzied away
Without all=-N -l, some objects are being optimized away and
impossible to debug
2022-06-13 14:31:37 -04:00
Hemant Kumar
bfe34ab224 Disable trimpath in debug mode
This allows remote debugging with debuggers like vscode and Goland
2022-06-12 07:53:18 -04:00
Kubernetes Prow Robot
2d7dcf928c
Merge pull request #109594 from linux-on-ibm-z/fastbuild_s390x
Add fast build support for s390x
2022-06-05 23:42:23 -07:00
Jordan Liggitt
6cdaecfe0a Build in hermetic module mode 2022-05-05 08:47:33 -04:00
Jordan Liggitt
2a10ca650d drop vendor from test targets 2022-05-05 08:47:33 -04:00
vitt-bagal
969ddfbd72 Add fast build support for s390x 2022-04-21 01:47:26 -07:00
Jordan Liggitt
f97bc825d5 Update min golang version to 1.18.1 2022-04-14 09:53:20 -04:00
Kir Kolyshkin
d8fdb00b34 Fix verify: generated-stable-metrics wrt go 1.18
This should fix the following error when running
./hack/update-generated-stable-metrics.sh:

	'go get' is no longer supported outside a module.
	To build and install a command, use 'go install' with a version,
	like 'go install example.com/cmd@latest'
	For more information, see https://golang.org/doc/go-get-install-deprecation
	or run 'go help get' or 'go help install'.

Using `go get` to download gopkg.in/yaml.v2 package into
KUBE_EXTRA_GOPATH directory no longer works. Interestingly, main repo
already has gopkg.in/yaml.v2@v2.4.0, same version that was installed by
that go get.

I guess that GOPATH with multiple elements no longer works either,
and since this code was the only user of KUBE_EXTRA_GOPATH, let's remove
it as well.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-03-23 10:19:59 -07:00
Davanum Srinivas
d8f1da5ecb
golang: Update to 1.18 from 1.18rc1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-03-22 09:47:35 -04:00
Tim Hockin
bf27cad256 Build flags: use all= syntax
This has somewhat subtle implications.  For a concrete example, this
changes the `-trimpath` behavior from only affecting the named pkg to
affecting all pkgs, which broke ginkgo, which seems to try to strip its
own `pwd` prefix.  But since that runs in run-in-gopath, and not in
KUBE_ROOT, it fails to strip anything.

e.g.

before this, strings in the binary would be like
    /home/user/kube/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/...
Ginkgo would find its own root as
    /home/user/kube/_output/local/go/src/k8s.io/kubernetes/
so it would produce
    vendor/github.com/onsi/ginkgo/...
in logs.

after this, strings in the binary strip the KUBE_ROOT and be like:
    _output/local/go/src/k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/...
Ginkgo would find its own root as
    /home/user/kube/_output/local/go/src/k8s.io/kubernetes/
so it would not strip anything, and produce
    _output/local/go/src/k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/...
in logs.
2022-03-01 08:48:31 -08:00
Tim Hockin
ed5e549cde Makefile: Add a DBG flag to build debug binaries
Now `make DBG=1` will produce binaries with no optimizaions and no
inlining, but with symbols and DWARF information.
2022-03-01 08:47:34 -08:00
Tim Hockin
4a0c6c2444 Slightly nicer output when building
before:

```
$ make generated_files
+++ [0226 13:42:17] Building go targets for linux/amd64:
    hack/make-rules/helpers/go2make
> non-static build: k8s.io/kubernetes/hack/make-rules/helpers/go2make
```

after:

```
$ make generated_files
+++ [0226 14:30:08] Building go targets for linux/amd64
    k8s.io/kubernetes/hack/make-rules/helpers/go2make (non-static)
```
2022-02-27 10:29:59 -08:00
Kubernetes Prow Robot
da73a24f6a
Merge pull request #106123 from pohly/log-go-runner-windows
package log runner as part of Kubernetes releases
2021-11-15 09:04:48 -08:00
Patrick Ohly
c3cd9a3902 kubemark: static binary, replace deprecated --log-file parameter
The --log-file parameter will be deprecated as of Kubernetes 1.23 and should be
avoided. The replacement for distroless images is the image with go-runner, a
tool that handles output redirection.

For kubemark to run in that image it must be built as static binary.
2021-11-04 20:52:56 +01:00
Patrick Ohly
d2a8a81639 Package kube-log-runner as part of Kubernetes releases
kube-log-runner was formerly known as go-runner when it was originally introduced
in 393e0952e9
It was moved to kubernetes/release/images/build/go-runner later but is now
needed again in Kubernetes itself as replacement for the deprecated --log-file
klog feature: when bringing up a Windows node, kube-proxy.exe and kubelet.exe must be wrapped
with the helper binary to redirect output.

It got renamed to avoid a naming conflict with
test/conformance/image/go-runner and because the name was too vague.

Other downstream Kubernetes users may have a similar need, therefore it makes
sense to provide a prebuilt binary also in the release archives.
2021-11-04 10:00:26 +01:00
Kubernetes Prow Robot
a7c67c03ff
Merge pull request #105399 from mopsfelder/ppc64le
Allow fast builds on ppc64le
2021-10-11 22:21:46 -07:00
Kubernetes Prow Robot
f31453fe5b
Merge pull request #104894 from pacoxu/windows-arm
add windows arm support on client-side since go 1.17 supports
2021-10-04 04:19:07 -07:00
Murilo Opsfelder Araujo
1589605a7c Allow fast builds on ppc64le
On a ppc64le host, fast build was failing:

    # make KUBE_FASTBUILD=true quick-release
    +++ [0908 15:56:36] Verifying Prerequisites....
    +++ [0908 15:56:36] Building Docker image kube-build:build-fd009aaa81-5-v1.23.0-go1.17-buster.0
    +++ [0908 15:56:44] Syncing sources to container
    +++ [0908 15:56:48] Running build command...
    +++ [0908 15:56:56] Building go targets for linux/ppc64le:
        ./vendor/k8s.io/code-generator/cmd/prerelease-lifecycle-gen
    > non-static build: k8s.io/kubernetes/./vendor/k8s.io/code-generator/cmd/prerelease-lifecycle-gen
    touch: cannot touch '_output/bin/prerelease-lifecycle-gen': No such file or directory
    make[2]: *** [Makefile.generated_files:209: _output/bin/prerelease-lifecycle-gen] Error 1
    make[1]: *** [Makefile:552: generated_files] Error 2
    make: *** [Makefile:512: cross] Error 1
    !!! [0908 15:56:58] Call tree:
    !!! [0908 15:56:58]  1: build/../build/common.sh:476 kube::build::run_build_command_ex(...)
    !!! [0908 15:56:58]  2: build/release.sh:36 kube::build::run_build_command(...)
    make: *** [Makefile:454: quick-release] Error 1

This error happened because the _output/bin/ directory didn't exist at
the moment the file _output/bin/prerelease-lifecycle-gen was touched, so
the path didn't exist.

The _output/bin symlink was not created by kube::golang::place_bins()
because kube::golang::setup_platforms() assumed
KUBE_CLIENT_PLATFORMS=linux/amd64 despite being on a ppc64le host.

Fix build error by not assuming host_arch=amd64 when on ppc64le in
kube::golang::setup_platforms().

Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
2021-10-01 09:31:10 -03:00
Elana Hashman
132fa1cbf3
Revert "Build non-static binaries with PIE buildmode" 2021-09-29 11:36:20 -07:00
Paco Xu
9a2a4f1051 add windows arm support on client-side since go 1.17 supports 2021-09-10 15:42:45 +08:00
Stephen Augustus
e8d2bff6ba
[go1.17] Update to go1.17
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:41 -04:00
Yaakov Selkowitz
67e14290aa Fix build with multiple GOFLAGS
The tag extraction from GOFLAGS doesn't do anything if -tags is not
present in GOFLAGS.  Not only does that mean non-sensical tags are
passed, but because GOFLAGS is a space-separated variable, the build
will fail because the build flags because -tags must be comma-separated.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2021-08-11 19:23:41 -04:00
Kubernetes Prow Robot
0427b17395
Merge pull request #104164 from dims/allow-override-of-cgo-enabled
Allow override of KUBE_CGO_OVERRIDES (for switching on/off of `CGO_ENABLED`)
2021-08-05 16:37:26 -07:00