fix: protobuf install in build (#2714)
Co-authored-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
@@ -64,6 +64,12 @@ jobs:
|
|||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
CROSS_VERBOSE: 1
|
CROSS_VERBOSE: 1
|
||||||
run: |
|
run: |
|
||||||
|
# Install protoc if on macOS
|
||||||
|
if [ "${{ matrix.os }}" = "macos-latest" ]; then
|
||||||
|
brew install protobuf
|
||||||
|
export PROTOC=$(which protoc)
|
||||||
|
fi
|
||||||
|
|
||||||
export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
|
export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
|
||||||
rustup target add "${TARGET}"
|
rustup target add "${TARGET}"
|
||||||
echo "Building for target: ${TARGET}"
|
echo "Building for target: ${TARGET}"
|
||||||
@@ -72,7 +78,7 @@ jobs:
|
|||||||
echo "Cross version:"
|
echo "Cross version:"
|
||||||
cross --version
|
cross --version
|
||||||
|
|
||||||
# 'cross' is used to cross-compile for different architectures (see Cross.toml)
|
echo "Building with explicit PROTOC path..."
|
||||||
cross build --release --target ${TARGET} -p goose-cli -vv
|
cross build --release --target ${TARGET} -p goose-cli -vv
|
||||||
|
|
||||||
# tar the goose binary as goose-<TARGET>.tar.bz2
|
# tar the goose binary as goose-<TARGET>.tar.bz2
|
||||||
@@ -84,4 +90,4 @@ jobs:
|
|||||||
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # pin@v4
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # pin@v4
|
||||||
with:
|
with:
|
||||||
name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }}
|
name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }}
|
||||||
path: ${{ env.ARTIFACT }}
|
path: ${{ env.ARTIFACT }}
|
||||||
+43
-3
@@ -1,4 +1,11 @@
|
|||||||
# Configuration for cross-compiling using cross
|
# Configuration for cross-compiling using cross
|
||||||
|
[build.env]
|
||||||
|
passthrough = [
|
||||||
|
"PROTOC",
|
||||||
|
"RUST_LOG",
|
||||||
|
"RUST_BACKTRACE"
|
||||||
|
]
|
||||||
|
|
||||||
[target.aarch64-unknown-linux-gnu]
|
[target.aarch64-unknown-linux-gnu]
|
||||||
xargo = false
|
xargo = false
|
||||||
pre-build = [
|
pre-build = [
|
||||||
@@ -6,29 +13,62 @@ pre-build = [
|
|||||||
"dpkg --add-architecture arm64",
|
"dpkg --add-architecture arm64",
|
||||||
"""\
|
"""\
|
||||||
apt-get update --fix-missing && apt-get install -y \
|
apt-get update --fix-missing && apt-get install -y \
|
||||||
|
curl \
|
||||||
|
unzip \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
libssl-dev:arm64 \
|
libssl-dev:arm64 \
|
||||||
libdbus-1-dev:arm64 \
|
libdbus-1-dev:arm64 \
|
||||||
libxcb1-dev:arm64
|
libxcb1-dev:arm64
|
||||||
|
""",
|
||||||
|
"""\
|
||||||
|
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v31.1/protoc-31.1-linux-x86_64.zip && \
|
||||||
|
unzip -o protoc-31.1-linux-x86_64.zip -d /usr/local && \
|
||||||
|
chmod +x /usr/local/bin/protoc && \
|
||||||
|
ln -sf /usr/local/bin/protoc /usr/bin/protoc && \
|
||||||
|
which protoc && \
|
||||||
|
protoc --version
|
||||||
"""
|
"""
|
||||||
]
|
]
|
||||||
|
|
||||||
[target.x86_64-unknown-linux-gnu]
|
[target.x86_64-unknown-linux-gnu]
|
||||||
xargo = false
|
xargo = false
|
||||||
pre-build = [
|
pre-build = [
|
||||||
# Install necessary dependencies for x86_64
|
|
||||||
# We don't need architecture-specific flags because x86_64 dependencies are installable on Ubuntu system
|
|
||||||
"""\
|
"""\
|
||||||
apt-get update && apt-get install -y \
|
apt-get update && apt-get install -y \
|
||||||
|
curl \
|
||||||
|
unzip \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
libdbus-1-dev \
|
libdbus-1-dev \
|
||||||
libxcb1-dev \
|
libxcb1-dev
|
||||||
|
""",
|
||||||
|
"""\
|
||||||
|
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v31.1/protoc-31.1-linux-x86_64.zip && \
|
||||||
|
unzip -o protoc-31.1-linux-x86_64.zip -d /usr/local && \
|
||||||
|
chmod +x /usr/local/bin/protoc && \
|
||||||
|
ln -sf /usr/local/bin/protoc /usr/bin/protoc && \
|
||||||
|
which protoc && \
|
||||||
|
protoc --version
|
||||||
"""
|
"""
|
||||||
]
|
]
|
||||||
|
env = { "PROTOC" = "/usr/bin/protoc", "PATH" = "/usr/local/bin:${PATH}" }
|
||||||
|
|
||||||
[target.x86_64-pc-windows-gnu]
|
[target.x86_64-pc-windows-gnu]
|
||||||
image = "dockcross/windows-static-x64:latest"
|
image = "dockcross/windows-static-x64:latest"
|
||||||
# Enable verbose output for Windows builds
|
# Enable verbose output for Windows builds
|
||||||
build-std = true
|
build-std = true
|
||||||
env = { "RUST_LOG" = "debug", "RUST_BACKTRACE" = "1", "CROSS_VERBOSE" = "1" }
|
env = { "RUST_LOG" = "debug", "RUST_BACKTRACE" = "1", "CROSS_VERBOSE" = "1" }
|
||||||
|
pre-build = [
|
||||||
|
"""\
|
||||||
|
apt-get update && apt-get install -y \
|
||||||
|
curl \
|
||||||
|
unzip
|
||||||
|
""",
|
||||||
|
"""\
|
||||||
|
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v31.1/protoc-31.1-linux-x86_64.zip && \
|
||||||
|
unzip protoc-31.1-linux-x86_64.zip -d /usr/local && \
|
||||||
|
chmod +x /usr/local/bin/protoc && \
|
||||||
|
export PROTOC=/usr/local/bin/protoc && \
|
||||||
|
protoc --version
|
||||||
|
"""
|
||||||
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user