Skip to content

Commit

Permalink
fix: build failure on aarch64 #5633 (#6020)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsenko authored Mar 6, 2025
1 parent 0fa51e3 commit 5c79408
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
distribution: 'temurin'

- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 20

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-sdk-typescript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ jobs:
exit 1
fi
- name: Setup Node
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: Check Node Version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
distribution: 'temurin'

- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 20

Expand Down
14 changes: 12 additions & 2 deletions go-sdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,27 @@ PROJECT_PATH := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
PROJECT_BIN := $(PROJECT_PATH)/bin
GO := $(PROJECT_BIN)/go1.20

bin/go:
bin/go: check
mkdir -p $(PROJECT_BIN)
GOBIN=$(PROJECT_BIN) go install golang.org/dl/go1.20@latest
$(PROJECT_BIN)/go1.20 download

.PHONY: check
check:
@{ \
V="$$(go version | sed -e 's|[^0-9.]*\([0-9.]*\).*|\1|')"; \
if [ ! "$$V" \> 1.20 ]; then \
echo "ERROR: Your go version $$V is not supported. Minimum required version is 1.20."; \
exit 1; \
fi \
}

.PHONY: clean
clean:
rm -rf $(PROJECT_BIN) kiota_tmp v2.json v3.json

.PHONY: generate
generate:
generate: check
./generate.sh

.PHONY: test
Expand Down
37 changes: 32 additions & 5 deletions go-sdk/generate.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
#!/usr/bin/env bash

# === Detect arch and OS

RAW_ARCH="$(uname -m)"
# See https://stackoverflow.com/a/45125525
if [[ "$RAW_ARCH" == aarch64* || "$RAW_ARCH" == armv8* ]]; then
ARCH=arm64
elif [[ "$RAW_ARCH" == x86_64* ]]; then
ARCH=x64
elif [[ "$RAW_ARCH" == i*86 ]]; then
ARCH=x86
else
echo "ERROR: Detected processor architecture is not recognized or supported: $RAW_ARCH"
exit 1
fi

if [[ "$OSTYPE" == linux* ]]; then
OS=linux
elif [[ "$OSTYPE" == darwin* ]]; then
OS=osx
else
# Windows not supported yet.
echo "ERROR: Detected OS is not recognized or supported: $OSTYPE"
exit 1
fi

PACKAGE_NAME="$OS-$ARCH"

# ===

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

SED_NAME="sed"
PACKAGE_NAME="linux-x64"
if [[ $OSTYPE == 'darwin'* ]]; then
SED_NAME="gsed"
PACKAGE_NAME="osx-x64"
SED_NAME=sed
if [[ "$OS" == osx ]]; then
SED_NAME=gsed
fi

# TODO move the kiota-version.csproj to it's own folder?
Expand Down
2 changes: 1 addition & 1 deletion go-sdk/go-sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.22.3" />
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.23.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@

<!-- Kiota -->
<kiota.libs.version>1.8.4</kiota.libs.version>
<kiota.community.version>0.0.20</kiota.community.version>
<kiota.community.version>0.0.21</kiota.community.version>

<kiota.version>1.21.0</kiota.version>
<kiota.version>1.23.0</kiota.version>
<kiota.timeout>60</kiota.timeout>
<kiota.base.url>https://github.com/microsoft/kiota/releases/download</kiota.base.url>

Expand Down
2 changes: 1 addition & 1 deletion python-sdk/python-sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.22.3" />
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.23.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions typescript-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
],
"scripts": {
"clean": "rimraf dist lib/generated-client .kiota",
"kiota-info": "cross-env KIOTA_VERSION=v1.22.3 kiota info -l typescript",
"generate-sources": "cross-env KIOTA_VERSION=v1.22.3 kiota generate --serializer none --deserializer none -l typescript -d ../common/src/main/resources/META-INF/openapi.json -c ApicurioRegistryClient -o ./lib/generated-client",
"kiota-info": "cross-env KIOTA_VERSION=v1.23.0 kiota info -l typescript",
"generate-sources": "cross-env KIOTA_VERSION=v1.23.0 kiota generate --serializer none --deserializer none -l typescript -d ../common/src/main/resources/META-INF/openapi.json -c ApicurioRegistryClient -o ./lib/generated-client",
"dev": "vite",
"build": "tsc --p ./tsconfig-build.json && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
Expand Down

0 comments on commit 5c79408

Please sign in to comment.