Skip to content

Commit 6a603af

Browse files
xgo 1.16 darwin/amd64 - increase base sdk version (#99)
1 parent b33106d commit 6a603af

File tree

6 files changed

+55
-26
lines changed

6 files changed

+55
-26
lines changed

.github/workflows/build_images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: build base image
5353
uses: docker/build-push-action@v2
5454
# if: steps.base_build.outputs.value != '0'
55-
if: true
55+
if: false
5656
with:
5757
context: docker/base/
5858
tags: techknowlogick/xgo:base

.github/workflows/test_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ jobs:
4343
uses: docker/setup-buildx-action@v1
4444
- name: build base image
4545
uses: docker/build-push-action@v2
46-
# if: steps.base_build.outputs.value == '0'
47-
if: true
46+
# if: steps.base_build.outputs.value != '0'
47+
if: false
4848
with:
4949
context: docker/base/
5050
tags: techknowlogick/xgo:base

docker/base/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,24 @@ ADD patches /patches
5858
##########################
5959

6060
# Configure the container for OSX cross compilation
61-
ENV OSX_SDK MacOSX10.11.sdk
62-
ENV OSX_SDK_PATH https://s3.dockerproject.org/darwin/v2/$OSX_SDK.tar.xz
61+
ENV OSX_SDK MacOSX11.1.sdk
62+
ENV OSX_SDK_PATH https://faasd-test.spacebear.ee/$OSX_SDK.tar.xz
6363

6464
# Make libxar known to the ld64 and cctools build
6565
ENV LD_LIBRARY_PATH=/osxcross/target/lib
6666

6767
# Download the osx sdk and build the osx toolchain
6868
# We download the osx sdk, patch it and pack it again to be able to throw the patched version at osxcross
6969
RUN \
70-
$FETCH $OSX_SDK_PATH dd228a335194e3392f1904ce49aff1b1da26ca62 && \
70+
$FETCH $OSX_SDK_PATH e8f0382f9e54ab3d7211b4886216475201ee750e47fa76dc6a0bf4604a63ddfc && \
7171
tar -xf `basename $OSX_SDK_PATH` && rm -f `basename $OSX_SDK_PATH`
7272
ADD patch.tar.xz $OSX_SDK/usr/include/c++
7373
RUN tar -cf - $OSX_SDK/ | xz -c - > $OSX_SDK.tar.xz && rm -rf $OSX_SDK
7474

7575
# Actually build the toolchain
7676
RUN \
7777
git clone https://github.com/tpoechtrager/osxcross.git && \
78-
cd osxcross && git checkout 88cb6e8d0d7675cae7c8a2d66c11f58237101df0 && cd ../ && \
78+
#cd osxcross && git checkout 035cc170338b7b252e3f13b0e3ccbf4411bffc41 && cd ../ && \
7979
mv $OSX_SDK.tar.xz /osxcross/tarballs/ && \
8080
OSX_VERSION_MIN=10.10 UNATTENDED=1 LD_LIBRARY_PATH=/osxcross/target/lib /osxcross/build.sh
8181

docker/base/bootstrap_pure.sh

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,23 @@ GOOS=linux GOARCH=386 CGO_ENABLED=1 go install std
3333
echo "Bootstrapping linux/arm64..."
3434
GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc-6 go install std
3535

36-
if [ $GO_VERSION -ge 170 ]; then
37-
echo "Bootstrapping linux/mips64..."
38-
GOOS=linux GOARCH=mips64 CGO_ENABLED=1 CC=mips64-linux-gnuabi64-gcc-6 go install std
36+
echo "Bootstrapping linux/mips64..."
37+
GOOS=linux GOARCH=mips64 CGO_ENABLED=1 CC=mips64-linux-gnuabi64-gcc-6 go install std
3938

40-
echo "Bootstrapping linux/mips64le..."
41-
GOOS=linux GOARCH=mips64le CGO_ENABLED=1 CC=mips64el-linux-gnuabi64-gcc-6 go install std
42-
fi
39+
echo "Bootstrapping linux/mips64le..."
40+
GOOS=linux GOARCH=mips64le CGO_ENABLED=1 CC=mips64el-linux-gnuabi64-gcc-6 go install std
4341

44-
if [ $GO_VERSION -ge 180 ]; then
45-
echo "Bootstrapping linux/mips..."
46-
GOOS=linux GOARCH=mips CGO_ENABLED=1 CC=mips-linux-gnu-gcc-6 go install std
42+
echo "Bootstrapping linux/mips..."
43+
GOOS=linux GOARCH=mips CGO_ENABLED=1 CC=mips-linux-gnu-gcc-6 go install std
4744

48-
echo "Bootstrapping linux/mipsle..."
49-
GOOS=linux GOARCH=mipsle CGO_ENABLED=1 CC=mipsel-linux-gnu-gcc-6 go install std
50-
fi
45+
echo "Bootstrapping linux/mipsle..."
46+
GOOS=linux GOARCH=mipsle CGO_ENABLED=1 CC=mipsel-linux-gnu-gcc-6 go install std
47+
48+
echo "Bootstrapping linux/ppc64le..."
49+
GOOS=linux GOARCH=ppc64le CGO_ENABLED=1 CC=powerpc64le-linux-gnu-gcc-6 go install std
50+
51+
echo "Bootstrapping linux/s390x..."
52+
GOOS=linux GOARCH=s390x CGO_ENABLED=1 CC=s390x-linux-gnu-gcc-6 go install std
5153

5254
echo "Bootstrapping windows/amd64..."
5355
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go install std
@@ -58,6 +60,11 @@ GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc go install std
5860
echo "Bootstrapping darwin/amd64..."
5961
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 CC=o64-clang go install std
6062

63+
if [ $GO_VERSION -ge 1160 ]; then
64+
echo "Bootstrapping darwin/arm64..."
65+
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 CC=o64-clang go install std
66+
fi
67+
6168
# Install xgo within the container to enable internal cross compilation
6269
echo "Installing xgo-in-xgo..."
6370
go get -u src.techknowlogick.com/xgo

docker/base/build.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# FLAG_BUILDMODE - Optional buildmode flag to set on the Go builder
2222
# FLAG_TRIMPATH - Optional trimpath flag to set on the Go builder
2323
# TARGETS - Comma separated list of build targets to compile for
24-
# GO_VERSION - Bootstrapped version of Go to disable uncupported targets
24+
# GO_VERSION - Bootstrapped version of Go to disable unsupported targets
2525
# EXT_GOPATH - GOPATH elements mounted from the host filesystem
2626

2727
# Define a function that figures out the binary extension
@@ -50,7 +50,7 @@ function extension {
5050
# Detect if we are using go modules
5151
if [[ "$GO111MODULE" == "on" || "$GO111MODULE" == "auto" ]]; then
5252
USEMODULES=true
53-
else
53+
else
5454
USEMODULES=false
5555
fi
5656

@@ -414,6 +414,14 @@ for TARGET in $TARGETS; do
414414
fi
415415
CC=o64-clang CXX=o64-clang++ GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build $V $X $TP $MOD "${T[@]}" --ldflags="$LDSTRIP $V $LD" $R $BM -o "/build/$NAME-darwin-$PLATFORM-amd64$R`extension darwin`" $PACK_RELPATH
416416
fi
417+
if [ $XGOARCH == "." ] || [ $XGOARCH == "arm64" ]; then
418+
echo "Compiling for darwin-$PLATFORM/arm64..."
419+
CC=o64-clang CXX=o64-clang++ HOST=arm64-apple-darwin15 PREFIX=/usr/local $BUILD_DEPS /deps ${DEPS_ARGS[@]}
420+
if [[ "$USEMODULES" == false ]]; then
421+
CC=o64-clang CXX=o64-clang++ GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go get $V $X "${T[@]}" --ldflags="$LDSTRIP $V $LD" -d $PACK_RELPATH
422+
fi
423+
CC=o64-clang CXX=o64-clang++ GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build $V $X $TP $MOD "${T[@]}" --ldflags="$LDSTRIP $V $LD" $R $BM -o "/build/$NAME-darwin-$PLATFORM-arm64$R`extension darwin`" $PACK_RELPATH
424+
fi
417425
# Remove any automatically injected deployment target vars
418426
unset MACOSX_DEPLOYMENT_TARGET
419427
fi

xgo.bats

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#!/usr/bin/env bats
22

33
@test "embedded c" {
4-
run go run xgo.go github.com/techknowlogick/xgo/tests/embedded_c
4+
run go run xgo.go ./tests/embedded_c
5+
echo "$output"
56
[ "$status" -eq 0 ]
67
}
78

89
@test "embedded cpp" {
910
skip "TODO: C++ is failing on linux/386, need to look into this"
10-
run go run xgo.go github.com/techknowlogick/xgo/tests/embedded_cpp
11+
run go run xgo.go ./tests/embedded_cpp
1112
echo "$output"
1213
[ "$status" -eq 0 ]
1314
}
@@ -25,16 +26,29 @@
2526
}
2627

2728
@test "branches" {
28-
run go run xgo.go --branch memprof --targets "linux/amd64" github.com/rwcarlsen/cyan/cmd/cyan
29+
skip "remotes are temporarily disabled due to gomod"
30+
run go run xgo.go --remote github.com/rwcarlsen/cyan --branch memprof --targets "linux/amd64" github.com/rwcarlsen/cyan/cmd/cyan
31+
echo "$output"
2932
[ "$status" -eq 0 ]
3033
}
3134

3235
@test "eth smoke" {
33-
run go run xgo.go --targets "linux/amd64" github.com/ethereum/go-ethereum/cmd/geth
36+
skip "remotes are temporarily disabled due to gomod"
37+
run go run xgo.go --remote github.com/ethereum/go-ethereum --targets "linux/amd64" github.com/ethereum/go-ethereum/cmd/geth
38+
echo "$output"
3439
[ "$status" -eq 0 ]
3540
}
3641

3742
@test "gitea smoke" {
38-
run go run xgo.go --targets "darwin-10.6/amd64" code.gitea.io/gitea
43+
git clone https://github.com/go-gitea/gitea.git /tmp/gitea
44+
run go run xgo.go --targets "darwin-10.6/amd64" -tags 'netgo osusergo sqlite sqlite_unlock_notify' /tmp/gitea
45+
echo "$output"
46+
[ "$status" -eq 0 ]
47+
}
48+
49+
@test "vikunja smoke" {
50+
git clone https://kolaente.dev/vikunja/api /tmp/vikunja
51+
run go run xgo.go --targets "darwin-10.6/amd64" /tmp/vikunja
52+
echo "$output"
3953
[ "$status" -eq 0 ]
4054
}

0 commit comments

Comments
 (0)