Commit graph

532 commits

Author SHA1 Message Date
dependabot[bot] 9d432be41c
Bump golang.org/x/oauth2 from 0.8.0 to 0.9.0 in /build.assets/tooling (#27999)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.8.0 to 0.9.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-20 12:29:08 +00:00
Alan Parra 2aa68358ac
chore: Bump golangci-lint to v1.53.3 (#27898) 2023-06-15 19:12:08 +00:00
Walt fafa16a19c
Remove unused FIPS build boxes (#26859)
FIPS is only built on amd64, and only on our centos:7 buildboxes.  These
other dockerfiles and targets are vestigial.  Furthermore, the buildbox
is a security risk, as ubuntu:18.04 is not supported after 2023-05-31.

If/when we want to support FIPS on ARM, we can build off the centos:7
infrastructure, or its successor.
2023-06-14 23:44:38 +00:00
Michael Wilson cb84fbf564
Make devbox sandbox friendly, add devbox CI. (#27728)
* Make devbox sandbox friendly, add devbox CI.

The devbox is now sandbox friendly, and devbox CI has been added to ensure
that any changes to Devbox are properly validated.

* Install correct binary name for node protoc plugin.

* Add in zlib to support LIBFIDO compilation.
2023-06-14 20:58:45 +00:00
Alan Parra bb4415acc7
chore: Bump Buf and Go versions (#27840)
* chore: Bump Buf to v1.21.0

* chore: Bump Go to 1.20.5

* Run `make dronegen`

* Update devbox packages
2023-06-14 18:55:35 +00:00
Marco André Dinis fcaa5f10b0
Fix TestDiagnoseSSHConnection flakiness (#27762)
* remove timeout for ssh diag test

* fix assertion

* Skip TestDiagnoseSSHConnection in flaky test detector
2023-06-14 15:46:56 +00:00
Michael Wilson cb493019bb
[devbox] Speed up yarn install, unset GOROOT. (#27664)
* Speed up yarn install, set GOROOT to nix go.

Yarn is now being installed via yarn's generic install script, which seems
to be much faster than the corresponding nix package. Additionally, the GOROOT
environment variable is being properly set to the nix's go installation.

* Unset goroot instead of trying to set it.
2023-06-12 13:01:18 +00:00
Michael Wilson 76464169c3
Add libpcsc to devbox. (#27667)
libpcsc has been added to devbox, which mirrors the installation in
build.assets/Dockerfile-multiarch.
2023-06-09 17:24:15 +00:00
fheinecke 541fb41fe7
Set UID/GID for ARC runner builds (#27638)
* Set UID/GID for ARC runner builds

* Set GOCACHE

* Reverted GOCACHE change

* Remove accidental changes

* Removed unnecessary change
2023-06-09 03:47:08 +00:00
fheinecke be477555af
Fixed trailing whitespace on makefile vars (#27653) 2023-06-09 03:28:06 +00:00
Michael Wilson 90c98c38fd
Initial devbox. (#27373)
* Initial devbox.

As devbox has added in version pinning, it seems like a viable way for
maintaining consistent tooling across devboxes. This is an initial pass
at using devbox in Teleport.

* Use latest git/bash, use clang instead of gcc.

* Add in TELEPORT_DEVBOX env variable for future use.

* Alphabetize and add in gotestsum.

* Remove gotestsum.

* Bump golangci-lint to 1.53.2

* Make sure libbpf works in linux.

* Add in notes to update devbox.json, add in a few more dependencies to devbox.json.

* Remove extraneous comments in Dockerfile, add in README.md blurb.
2023-06-08 16:03:39 +00:00
public-renovate-gha[bot] 8f602ed4f5
chore(deps): update build assets - tooling (#27542)
Co-authored-by: public-renovate-gha[bot] <135069952+public-renovate-gha[bot]@users.noreply.github.com>
2023-06-07 14:54:28 +00:00
Cam Hutchison 6e4470e0bf
tooling: Add a flaky test report to render-tests (#27098)
* tooling: Refactor render-tests

Refactor render-tests to simplify and group the logic prior to adding a
mode to report flaky tests. No additional functionality has been added,
but the coverage detection has been fixed as the regexp was incorrect
(presumably the output format changed).

* tooling: Rework render-tests counting

Rework the counting of pass/fail/skip events in render-test to record
these counts at the test and package level instead of a single status of
pass/fail/skip. This will allow us to accumulate results from more than
one test run to be able to test for flaky tests.

Tally and output package and test counts separately as previously it was
technically incorrect when it said "n tests passed", as that also
included package results. This may make it a little clearer just how
much is failing when a failure occurs.

* tooling: Add flakiness mode to render-tests

Add a `-report-by flakiness` mode to `render-tests` that can accumulate
multiple test runs and report the top N flaky tests. This mode is
intended to be used in a daily run of the tests for a couple of hours,
or perhaps 200 times, and to report on the tests that have failed the
most.

The output of multiple test runs should be fed into the single run of
`render-tests`. A `rerun` utility is forthcoming with which you could
do:

    rerun -n 200 -t 2h go test -shuffle on -cover -json . | \
        render-tests -report-by flakiness -top 10

* tooling: Have render-tests write summary to file

Add the `-summary-file` flag to have render-tests write a summary of the
test run to the specified file. This is to be used to get a flaky test
summary that can be sent on slack via CI (GitHub Actions).

* tooling: Add rerun command for multiple test runs

Add a `rerun` command that is intended to be used to run tests multiple
times for a duration. It allows `go test -json` to be run many times
with the output piped to `render-tests -report-by flakiness` to generate
a summary of flaky tests over a large number of runs.
2023-06-07 07:13:12 +00:00
Cam Hutchison bb822bf26b
Fix build for new buildbox (#27521)
* Revert the removal of quintush/helm-unittest

Commit 5d53c91c7a removed
quintush/helm-unittest from the buildbox. It seems we still need that
version so revert those hunks that removed it.

* tests: Fix invalid sudoers file test

Fix the invalid sudoers file test to not look for an exact string but
just a substring. The error message has changed from Ubuntu 20.04 to
22.04 and it has removed some extra wording.
2023-06-07 06:35:59 +00:00
Jakub Nyckowski 5d53c91c7a
Use Ubuntu 22.04 for the buildbox (#27497)
After moving the Connect to a separate Docker image https://github.com/gravitational/teleport/pull/27175 we're able to use the latest ubuntu LTS on our build image. We're not using this image to produce any releases (only CI runs), so updating the image will have no effect on our releases.
2023-06-07 03:31:53 +00:00
Jakub Nyckowski eb4acddf06
Move Connect build to a new Docker container (#27175)
* Move Connect build to a new Docker container

* Update comments

* Update comments
Remove unused packages and unused arguments

* Always use UID=1000 for building teleterm.
2023-06-06 15:28:20 +00:00
Brian Joerger 70c5ce7e8c
Add tsh e2e tests with various security features enabled (#26862)
* * Refactor tool/tsh to enable tsh e2e tests outside of the tsh package.

* Add tool/teleport/testenv to enable easier e2e tests from outside
  packages.

* Skip all flaky test checks when * is provided.
2023-06-06 01:25:09 +00:00
Alan Parra 5316027d21
chore: Bump golangci-lint to v1.53.2 (#27381)
Update to latest patch.
2023-06-05 21:37:48 +00:00
Alan Parra f6d8d49f31
chore: Bump Buf to v1.20.0 (#27267)
Keep up with latest releases.

https://github.com/bufbuild/buf/releases/tag/v1.20.0
2023-06-05 16:20:12 +00:00
dependabot[bot] db074b8e04
Bump github.com/stretchr/testify in /build.assets/tooling (#27340)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.3 to 1.8.4.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.3...v1.8.4)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-05 16:19:27 +00:00
Jakub Nyckowski 9b1a657ade
Allow overriding docker in make grpc (#27268)
* Set the correct file permission on make grpc

https://github.com/gravitational/teleport/pull/26640 introduced the new GRPC buildbox. The new Docker image uses the default user (root) which changes the generated files owner on all generates files.
This PR sets XDG_CACHE_HOME to allow buf to run as a provided user.

Note: This is mainly Linux issue, as MacOS does not change the owner of modified files in mounted volumes.

* Use podman for GRPC generation

* Remove docker override on Linux

* Restore example ARG values

* Update build.assets/Dockerfile-grpcbox

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>

---------

Co-authored-by: Marco André Dinis <marco.dinis@goteleport.com>
2023-06-02 16:02:40 +00:00
Tiago Silva 6c10c7f5f0
Pin golangci-lint to v1.53.1 and upgrade depguard config to v2 (#27264)
* Bump golang-ci to `v1.53.0` and upgrade `depguard` config to `v2`

* pin golangci-lint version

* Keep golangci version only in the Dockerfile

* Bump golangci-lint to v1.53.1

---------

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2023-06-02 13:47:42 +00:00
Jakub Nyckowski d3848c2cbd
Update Docker images to use v14 (#27189)
After the new Docker images have been published https://github.com/gravitational/teleport/pull/27055 this PR makes use of them in GHA.
2023-06-01 19:47:51 +00:00
Krzysztof Skrzętnicki d7627b5019
flaky test detector: pass --skip flag in all jobs, skip new tests (#27145)
* Use `--skip` flag in all difftest invocations.

* make `difftest` respect the `--skip` flag for new tests.
2023-06-01 06:54:02 +00:00
Jakub Nyckowski 95b4339a04
Update base Ubuntu image to 20.04 (#26905)
* Update base Ubuntu image to 22.04

* Revert the ubuntu image to 20.04

* Update the Dockerfile comment

* Add CentOS 7 note

* Add Connect note
2023-05-31 15:30:04 +00:00
Jakub Nyckowski ff80e52edd
Speedup OpenSSL build (#27056)
* Speedup OpenSSL build

Our Docker images build OpenSSL using one job. Running the build using multiple jobs speeds up the process significantly.

* Simplify make command
2023-05-30 19:17:38 +00:00
Jakub Nyckowski 68a6c7b6cf
Update buildbox version to v14 (#27055)
* Update buildbox version to v14

* Regenerate .drone.yml
2023-05-30 18:59:02 +00:00
Alan Parra 623f8c17c9
chore: Bump OpenSSL to 3.0.9 (#27109)
Keep up with security releases.

https://github.com/openssl/openssl/releases/tag/openssl-3.0.9
2023-05-30 14:43:29 +00:00
Mike Jensen 83a64c1eec
Update dependencies for build.assets/tooling (#26907)
* Bump github.com/hashicorp/go-hclog in /build.assets/tooling

Bumps [github.com/hashicorp/go-hclog](https://github.com/hashicorp/go-hclog) from 0.9.3-0.20191025211905-234833755cb2 to 1.5.0.
- [Release notes](https://github.com/hashicorp/go-hclog/releases)
- [Commits](https://github.com/hashicorp/go-hclog/commits/v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-hclog
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump golang.org/x/oauth2 in /build.assets/tooling

Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.0.0-20180821212333-d2e6202438be to 0.8.0.
- [Commits](https://github.com/golang/oauth2/commits/v0.8.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump golang.org/x/mod from 0.6.0 to 0.10.0 in /build.assets/tooling

Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.6.0 to 0.10.0.
- [Commits](https://github.com/golang/mod/compare/v0.6.0...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/bmatcuk/doublestar/v4 in /build.assets/tooling

Bumps [github.com/bmatcuk/doublestar/v4](https://github.com/bmatcuk/doublestar) from 4.4.0 to 4.6.0.
- [Release notes](https://github.com/bmatcuk/doublestar/releases)
- [Commits](https://github.com/bmatcuk/doublestar/compare/v4.4.0...v4.6.0)

---
updated-dependencies:
- dependency-name: github.com/bmatcuk/doublestar/v4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/bradleyfalzon/ghinstallation/v2 in /build.assets/tooling

Bumps [github.com/bradleyfalzon/ghinstallation/v2](https://github.com/bradleyfalzon/ghinstallation) from 2.1.0 to 2.4.0.
- [Release notes](https://github.com/bradleyfalzon/ghinstallation/releases)
- [Commits](https://github.com/bradleyfalzon/ghinstallation/compare/v2.1.0...v2.4.0)

---
updated-dependencies:
- dependency-name: github.com/bradleyfalzon/ghinstallation/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/stretchr/testify in /build.assets/tooling

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.3.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.2...v1.8.3)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/sirupsen/logrus in /build.assets/tooling

Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.8.1 to 1.9.2.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.8.1...v1.9.2)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/gravitational/trace in /build.assets/tooling

Bumps [github.com/gravitational/trace](https://github.com/gravitational/trace) from 1.1.15 to 1.2.1.
- [Release notes](https://github.com/gravitational/trace/releases)
- [Commits](https://github.com/gravitational/trace/compare/v1.1.15...v1.2.1)

---
updated-dependencies:
- dependency-name: github.com/gravitational/trace
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update CIRCL to address CVE https://github.com/advisories/GHSA-2q89-485c-9j2x

* go.mod: Join two require sections

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-25 16:38:51 +00:00
Alan Parra 52605f24cd
chore: Bump libudev-zero to 1.0.2 (#26851)
Keep up with latest releases.

* https://github.com/illiliti/libudev-zero/releases/tag/1.0.2
2023-05-24 20:12:33 +00:00
Alan Parra 690606b455
Fix grpcbox for arm64 and undo protoc rollback (#26758)
* Revert protoc downgrade

* Use correct protoc URL for arm64
2023-05-23 16:14:11 +00:00
Alan Parra 014003880f
Add a codegen-focused buildbox (#26640)
* Add the babybox Dockerfile and Makefile

* Change Makefiles to use the babybox

* Change buildbox to use version args

* Keep the old "if BUILDARCH" on protoc install

* Drop --platform directive on babybox (its platform doesn't matter)

* Use mktemp to download protoc

* Remove defaults from ARGs

* Copy ARG comments to buildbox Dockerfile

* Rename babybox to grpcbox
2023-05-22 21:32:46 +00:00
Alan Parra f1fe49f7fb
Add a few convenience toggles to genproto.sh (#26642)
* Add a few convenience toggles to genproto.sh

* Echo key commands on genproto.sh
2023-05-22 12:35:43 +00:00
Zac Bergquist d6f2a52155
flaky test detector: add exclusion step (#26542)
Depends on gravitational/shared-workflows#115
2023-05-19 22:47:22 +00:00
Alan Parra e12a133463
chore: Bump Buf to v1.19.0 (#26634)
Update to the latest release.

* https://github.com/bufbuild/buf/releases/tag/v1.19.0
2023-05-19 21:45:00 +00:00
Alan Parra 6bb0ee54b8
Bump golangci-lint to v1.52.2 (#26524) 2023-05-19 13:13:45 +00:00
Grzegorz Zdunek 9d05287cc9
Update kingpin & allow autocompletion (#26238)
* Update kingpin version

* Convert `defaultUsageTemplate` to "text/template"

* Add // replaced

* Sort deps

* Change kingpin v2.3.1 to v2.3.2

* Add missing indirect dep

* Update go.sum

* Delete kingpin_deleteme.go
2023-05-19 07:10:53 +00:00
Nic Klaassen 20aaee7c88
opentelemetry dependency updates (#25497)
* Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp

Bumps [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.40.0 to 0.41.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.40.0...zpages/v0.41.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc

Bumps [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) from 1.14.0 to 1.15.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.14.0...v1.15.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* merge outstanding otel updates

* serialize TestTraceProvider subtests

This test modifies the global trace provider and a race can reliably
detected with the latest version of the oteltrace library.

This doesn't have much impact on the test runtime, which is dominated by
a single subtest.
```
--- PASS: TestTraceProvider (1.07s)
    --- PASS: TestTraceProvider/not_sampling_prevents_exporting (0.00s)
    --- PASS: TestTraceProvider/spans_exported_with_gRPC+TLS (0.00s)
    --- PASS: TestTraceProvider/spans_exported_with_gRPC (0.00s)
    --- PASS: TestTraceProvider/spans_exported_with_HTTP (0.00s)
    --- PASS: TestTraceProvider/spans_exported_with_HTTPS (1.06s)
```

* fix races in tsh tests

* Add TestForwardingTraces to flaky test detector skip list

* fix race in TestExportingTraces

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tim Ross <tim.ross@goteleport.com>
2023-05-18 12:51:17 +00:00
Cam Hutchison 49ab2a7bfd
Update version in tsh.app Info.plist (#25616)
Update the version in tsh.app (tsh and tshdev) `Info.plist` files when
`make version` (`make update-version`) is run. If the version number has
any semver prerelease tags, then the tsh version number will be set to
"1.0", as those tags are not valid in the CFBundleShortVersionString or
CFBundleVersion fields. For a release without a semver tag, the value
will be set.

This will update the CFBundleVersion and CFBundleShortVersionString
fields of the `Info.plist` file.

This commit contains re-written plist files as they get reindented by
the tool, the CFBundleVersion becomes "1.0" (was "1") and one empty
element is shortened to the empty-element form.

Link: https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion
Link: https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring
2023-05-15 22:42:54 +00:00
Tiago Silva 32d8d5f489
Restore Kubernetes Integration tests (#25624)
* Restore Kubernetes Integration tests

This PR re-enables the Kubernetes integrations tests using a KinD
(Kubernetes in Docker) cluster.

New steps have been introduced to GitHub's Integrations (Non-Root)
Action that configure the KinD cluster using
[`helm/kind-action`](https://github.com/helm/kind-action) and do some
network configurations allowing the container where tests run to connect
to the KinD control plane.

This PR also fixes some of the tests and fixes a bug that affected
joining operations when the target service was a legacy kubernetes
proxy. Some improvements will be introduced in future patches to improve
the logic and reduce the time required for the tests to run.

Fixes #25539

* fix data race in spdystream dep

* address feedback

* remove docker installation

* fix test
2023-05-12 16:38:16 +00:00
Tiago Silva 996464cd70
Add docker cli to buildbox (#25729)
As part of restoring Kubernetes integration tests, we need to have
docker cli on our build box image in order to spawn a KinD (Kubernetes
in Docker) cluster.

Part of #25539
2023-05-10 08:44:19 +00:00
Cam Hutchison 3badac8786
gh-trigger-workflow: Retry transient server errors (#25868)
Retry GitHub API requests on transient server errors, using
`github.com/hashicorp/retryablehttp-go`. We get the occasional 502 error
which breaks the whole drone pipeline run:

    Failed to start workflow run Failed polling workflow jobs
      Failed to fetch workflow jobs
          GET https://api.github.com/repos/gravitational/teleport.e/actions/runs/4858067495/jobs: 502 Server Error []
2023-05-09 22:52:22 +00:00
Steven Martin a140d17e70
provide starting message for tar ball install (#25851) 2023-05-09 13:50:36 +00:00
Alan Parra 61a94a7fd8
Bump Buf to 1.18.0 (#25808)
Keep up with the latest releases.

* https://github.com/bufbuild/buf/releases/tag/v1.18.0
2023-05-08 17:11:01 +00:00
Justinas Stankevičius b1fd50f67e
Create ToolchainDir if does not exist (#25693) 2023-05-08 09:10:37 +00:00
Trent Clarke f8cdf987c5
Remove obsolete targets from Makefiles (#25611)
These targets were originally set up to allow parallel arm64 builds
using GHA. These targets were obsoleted when the ARM64 builds were
expanded to be full-fledged teleport releases, but were not removed
at that time.

Leaving these targets is messy and confusing, so this patch removes
them.
2023-05-05 11:48:42 +00:00
Cam Hutchison d3eed17856
build: Support arm64 and universal binaries for MacOS (#25460)
* build: Support ARM64 (cross)builds of fido2 et al

Add support for building/cross-building the fido2 libraries (cbor,
openssl and fido2), supporting ARM64 builds. This is done by adding the
appropriate flags to the library builds in `build-fido2-macos.sh` based
on the `C_ARCH` environment variable. If unset then the host
architecture is used. The `Makefile` defined `C_ARCH` based on the
`ARCH` variable, mapping it to an appropriate value for the C compiler.

Building the libraries should now be done through the new `build-fido2`
target, and getting the pkg-config path should be done with the
`print-fido2-pkg-path`. This is instead of calling the
`build-fido2-macos.sh` script directly as the `Makefile` takes care of
setting the `C_ARCH` environment variable appropriately.

* build: Add make target to install rust cross toolchain

Add the `rustup-set-target-toolchain` target to the Makefile to ensure
the right rust toolchain is installed for the version of Rust we use as
well as the target architecture we wish to generate code for, based on
the `ARCH` variable. This is intended to be used by CI jobs to ensure
they build with the correct toolchain.

* build: Support building MacOS packages for ARM64

Remove the restriction that allows only AMD64 packages to be built on
MacOS for the teleport and tsh packages. This is via the existing `-a`
flag to `build-package.sh` and a newly added `-a` flag to
`build-pkg-tsh.sh`.

This adds the architecture to the filename of the package to distinguish
the packages for different architectures.

Update the comments in the Makefile mentioning that `arch` is ignored.

build: add architecture to package names

* build: Build Teleport Connect with target architecture

When packaging Teleport Connect with electron-builder, pass an
architecture flag so that we can cross-build Teleport Connect. This will
allow us to build MacOS ARM64 binaries on the AMD64 runners.

Add the architecture to the `dmg` filename via the electron-builder
config, so that the filenames for different architectures don't clash.

* build: Copy Mac release artifacts to release directory

Copy the Mac release artifacts to a release artifact directory so that
the CI scripts do not have to. This makes it clearer what is and is not
a release artifact and puts the logic in the Makefile instead of the CI
yaml, so it can more easily be tested locally and to make it easier to
migrate to the next CI system.

This will also be useful for building universal binaries for Mac as the
CI system can put the architecture-specific binaries from a previous
workflow job into a common location.

We should look at copying all release artifacts for the other builds
(Linux tarballs and packages, etc) into this directory too. It may help
with unifying the GitHub Actions release workflows.

* build: Add MacOS universal builds

Add support for ARCH=universal on Darwin to produce universal (fat)
binaries from pre-built arm64 and amd64 binaries.

Packages (pkg) and disk images (dmg) for containing universal binaries
are named without an architecture in the filename, as that is the
current naming for the current AMD64-only releases. These universal ones
will replace those AMD64-only ones providing a single release artifact
working across architectures.

Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>

* build: Do not clean before release-darwin

Remove the `clean` prerequisite from the `release-darwin-unsigned`
target as it is not needed when building on GitHub Actions, as it starts
with a fresh slate each run. We do not make releases manually so we
don't need to ensure a clean working directory there either.

Not doing a clean makes it easier to build a MacOS universal release as
it depends on the architecture-specific tarballs from a previous release
build. We would need to manually save the tarballs from the first
architecture release build as they would get deleted by the `clean` from
the second. So just stop cleaning as it is not needed.

---------

Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
2023-05-04 20:47:49 +00:00
Alan Parra ff2f7adce7
chore: Bump Go to 1.20.4 (#25503)
* chore: Bump Go to 1.20.4

* Run `make dronegen`

* Update e/ reference
2023-05-02 20:25:30 +00:00
rosstimothy 8f23cd40ad
Use web address when appropriate for a jump host (#25237)
* Use web address when appropriate for a jump hosts

Determines whether the jump host provided via `tsh ssh -J` is belongs
to the Proxy SSH or Web server to ensure when using jump hosts that
connections are established directly on the target cluster.

Closes #25178

* Modify tsh tests to capture issues with jump hosts

Alters the root and leaf cluster and node names used by tsh tests
so that the root cluster is named `root` instead of `localhost` and
sets a unique `NodeName` for each cluster instead of reusing
`localnode` for both. This was masking problems in jump hosts tests
by connecting to the node in the root cluster instead of the leaf
cluster.

Some additional changes to tsh tests were made as a result of
changing the cluster and node names.

* fix proxy client tests

* update TestList to login once

* ignore TestList in flaky test detector
2023-05-02 18:03:35 +00:00
Trent Clarke 6cfcd24283
Updates distroless Dockerfile to handle fips realeases (#25449) 2023-05-02 03:29:03 +00:00