1313 build :
1414 name : Build ${{ matrix.target }}
1515 runs-on : ${{ matrix.os }}
16- continue-on-error : true
1716 strategy :
1817 fail-fast : false
1918 matrix :
5756 use_cross : true
5857 embedded_only : true
5958
60- outputs :
61- build-success : ${{ steps.build-result.outputs.success }}
62-
6359 steps :
6460 - uses : actions/checkout@v4
6561
@@ -119,7 +115,7 @@ jobs:
119115 if : matrix.use_cross == true
120116 run : cargo install cross --git https://github.com/cross-rs/cross
121117
122- - name : Set up protoc for cross-compilation
118+ - name : Set up environment for cross-compilation
123119 if : matrix.use_cross == true && matrix.embedded_only != true
124120 run : |
125121 # Download and install protoc for cross-compilation
@@ -128,7 +124,11 @@ jobs:
128124 unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc
129125 sudo cp protoc/bin/protoc /usr/local/bin/
130126 sudo chmod +x /usr/local/bin/protoc
127+
128+ # Set environment variables for cross-compilation
131129 echo "PROTOC=/usr/local/bin/protoc" >> $GITHUB_ENV
130+ echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
131+ echo "CROSS_CONTAINER_IN_CONTAINER=true" >> $GITHUB_ENV
132132
133133 - name : Build embedded only
134134 if : matrix.embedded_only == true
@@ -138,16 +138,14 @@ jobs:
138138 if : matrix.use_cross == true && matrix.embedded_only != true
139139 env :
140140 PROTOC : /usr/local/bin/protoc
141+ PKG_CONFIG_ALLOW_CROSS : 1
142+ CROSS_CONTAINER_IN_CONTAINER : true
141143 run : cross build --release --target ${{ matrix.target }}
142144
143145 - name : Build with cargo
144146 if : matrix.use_cross != true
145147 run : cargo build --release --target ${{ matrix.target }}
146148
147- - name : Set build result
148- id : build-result
149- run : echo "success=true" >> $GITHUB_OUTPUT
150-
151149 - name : Package (Unix)
152150 if : matrix.os != 'windows-latest'
153151 run : |
0 commit comments