Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions .github/workflows/build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,37 @@ jobs:
- name: Checkout Teleport
uses: actions/checkout@v3

- name: Get Go version
id: go-version
shell: bash
run: echo "go-version=$(make --no-print-directory print-go-version | tr -d '\n')" >> $GITHUB_OUTPUT
- name: Determine Toolchain Versions and cache paths
run: |
echo NODE_VERSION=$(make -C build.assets print-node-version) >> $GITHUB_ENV
echo GOLANG_VERSION=$(make -C build.assets print-go-version | sed 's/^go//') >> $GITHUB_ENV
echo RUST_VERSION=$(make -C build.assets print-rust-version) >> $GITHUB_ENV
echo PKG_CONFIG_PATH="$(build.assets/build-fido2-macos.sh pkg_config_path)" >> $GITHUB_ENV

- name: Setup Go
- name: Print versions
run: |
echo "make: $(make --version)"
echo "node: ${NODE_VERSION}"
echo "go: ${GOLANG_VERSION}"
echo "rust: ${RUST_VERSION}"

- name: Install Node Toolchain
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup yarn
run: |
corepack enable yarn

- name: Install Go Toolchain
uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.go-version }}
go-version: ${{ env.GOLANG_VERSION }}

- name: Configure Rust Toolchain
run: |
rustup override set ${{ env.RUST_VERSION }}

- name: Build
run: make binaries
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ endif
CHECK_CARGO := $(shell cargo --version 2>/dev/null)
CHECK_RUST := $(shell rustc --version 2>/dev/null)

# Have cargo use sparse crates.io protocol:
# https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html
# TODO: Delete when it becomes default in Rust 1.70.0
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a single rust version across the environment is a good goal, but for this PR alone, would it work to simply add export CARGO_UNSTABLE_SPARSE_REGISTRY=true to enable the spare-registry feature flag for older rust versions?

The error linked by @r0mant complains:

Caused by:
  usage of sparse registries requires `-Z sparse-registry`

CARGO_UNSTABLE_SPARSE_REGISTRY is an alternative to that switch, and from my quick testing, it doesn't break new cargo.

Copy link
Copy Markdown
Contributor Author

@ibeckermayer ibeckermayer Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tener the issue with using CARGO_UNSTABLE_SPARSE_REGISTRY is that it's only registered by a nightly build of cargo. So it has no effect using stable cargo of < 1.68, which is the default for the image we're using (it currently uses something like 1.67.2 stable).


with_rdpclient := no
RDPCLIENT_MESSAGE := without-Windows-RDP-client

Expand Down Expand Up @@ -207,7 +212,7 @@ ifeq ("$(ARCH)","arm64")
CGOFLAG += CC=aarch64-linux-gnu-gcc
endif
else ifeq ("$(ARCH)","arm")
CGOFLAG = CGO_ENABLED=1
CGOFLAG = CGO_ENABLED=1

# ARM builds need to specify the correct C compiler
ifeq ($(IS_NATIVE_BUILD),"no")
Expand Down