Skip to content

Commit 5c79408

Browse files
authored
fix: build failure on aarch64 #5633 (#6020)
1 parent 0fa51e3 commit 5c79408

File tree

9 files changed

+54
-17
lines changed

9 files changed

+54
-17
lines changed

.github/workflows/release-images.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
distribution: 'temurin'
9595

9696
- name: Set up Node.js
97-
uses: actions/setup-node@v1
97+
uses: actions/setup-node@v3
9898
with:
9999
node-version: 20
100100

.github/workflows/release-sdk-typescript.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ jobs:
4949
exit 1
5050
fi
5151
52-
- name: Setup Node
52+
- name: Setup Node.js
5353
uses: actions/setup-node@v3
5454
with:
55-
node-version: 18
55+
node-version: 20
5656
registry-url: 'https://registry.npmjs.org'
5757

5858
- name: Check Node Version

.github/workflows/release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
distribution: 'temurin'
3535

3636
- name: Set up Node.js
37-
uses: actions/setup-node@v1
37+
uses: actions/setup-node@v3
3838
with:
3939
node-version: 20
4040

go-sdk/Makefile

+12-2
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,27 @@ PROJECT_PATH := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
33
PROJECT_BIN := $(PROJECT_PATH)/bin
44
GO := $(PROJECT_BIN)/go1.20
55

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

11+
.PHONY: check
12+
check:
13+
@{ \
14+
V="$$(go version | sed -e 's|[^0-9.]*\([0-9.]*\).*|\1|')"; \
15+
if [ ! "$$V" \> 1.20 ]; then \
16+
echo "ERROR: Your go version $$V is not supported. Minimum required version is 1.20."; \
17+
exit 1; \
18+
fi \
19+
}
20+
1121
.PHONY: clean
1222
clean:
1323
rm -rf $(PROJECT_BIN) kiota_tmp v2.json v3.json
1424

1525
.PHONY: generate
16-
generate:
26+
generate: check
1727
./generate.sh
1828

1929
.PHONY: test

go-sdk/generate.sh

+32-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,39 @@
11
#!/usr/bin/env bash
22

3+
# === Detect arch and OS
4+
5+
RAW_ARCH="$(uname -m)"
6+
# See https://stackoverflow.com/a/45125525
7+
if [[ "$RAW_ARCH" == aarch64* || "$RAW_ARCH" == armv8* ]]; then
8+
ARCH=arm64
9+
elif [[ "$RAW_ARCH" == x86_64* ]]; then
10+
ARCH=x64
11+
elif [[ "$RAW_ARCH" == i*86 ]]; then
12+
ARCH=x86
13+
else
14+
echo "ERROR: Detected processor architecture is not recognized or supported: $RAW_ARCH"
15+
exit 1
16+
fi
17+
18+
if [[ "$OSTYPE" == linux* ]]; then
19+
OS=linux
20+
elif [[ "$OSTYPE" == darwin* ]]; then
21+
OS=osx
22+
else
23+
# Windows not supported yet.
24+
echo "ERROR: Detected OS is not recognized or supported: $OSTYPE"
25+
exit 1
26+
fi
27+
28+
PACKAGE_NAME="$OS-$ARCH"
29+
30+
# ===
31+
332
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
433

5-
SED_NAME="sed"
6-
PACKAGE_NAME="linux-x64"
7-
if [[ $OSTYPE == 'darwin'* ]]; then
8-
SED_NAME="gsed"
9-
PACKAGE_NAME="osx-x64"
34+
SED_NAME=sed
35+
if [[ "$OS" == osx ]]; then
36+
SED_NAME=gsed
1037
fi
1138

1239
# TODO move the kiota-version.csproj to it's own folder?

go-sdk/go-sdk.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.22.3" />
9+
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.23.0" />
1010
</ItemGroup>
1111

1212
</Project>

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@
266266

267267
<!-- Kiota -->
268268
<kiota.libs.version>1.8.4</kiota.libs.version>
269-
<kiota.community.version>0.0.20</kiota.community.version>
269+
<kiota.community.version>0.0.21</kiota.community.version>
270270

271-
<kiota.version>1.21.0</kiota.version>
271+
<kiota.version>1.23.0</kiota.version>
272272
<kiota.timeout>60</kiota.timeout>
273273
<kiota.base.url>https://github.com/microsoft/kiota/releases/download</kiota.base.url>
274274

python-sdk/python-sdk.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.22.3" />
9+
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.23.0" />
1010
</ItemGroup>
1111

1212
</Project>

typescript-sdk/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
],
1111
"scripts": {
1212
"clean": "rimraf dist lib/generated-client .kiota",
13-
"kiota-info": "cross-env KIOTA_VERSION=v1.22.3 kiota info -l typescript",
14-
"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",
13+
"kiota-info": "cross-env KIOTA_VERSION=v1.23.0 kiota info -l typescript",
14+
"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",
1515
"dev": "vite",
1616
"build": "tsc --p ./tsconfig-build.json && vite build",
1717
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",

0 commit comments

Comments
 (0)