@@ -131,49 +131,125 @@ jobs:
131131 if : " runner.os == 'Linux'"
132132 run : |
133133 case "${{ join(matrix.targets) }}" in
134+ *aarch64*linux*musl*)
135+ sudo apt-get install -y gcc-aarch64-linux-gnu
136+ curl -Ls -o- https://github.com/rui314/mold/releases/download/v2.40.3/mold-2.40.3-aarch64-linux.tar.gz|sudo tar --strip=1 -xzf - -C/usr/local/
137+ hash -r
138+ export RUSTFLAGS="-Clink-arg=-Bmold"
139+ expr "$CC" : ".*gcc" >/dev/null && : "${CFLAGS:=-std=c11 -Bmold -Wno-implicit-function-declaration -Wno-error=implicit-function-declaration}"
140+ export CC
141+ export CFLAGS
142+ ;;
134143 *aarch64*linux*)
135- sudo apt-get install gcc-aarch64-linux-gnu -y
144+ sudo apt-get install -y gcc-aarch64-linux-gnu
136145 #sed -i -e 's|^#rustc-wrapper|rustc-wrapper|' .cargo/config.toml
137146 #curl -LO https://github.com/mozilla/sccache/releases/download/v0.9.0/sccache-v0.9.0-x86_64-unknown-linux-musl.tar.gz
138147 #tar -xvf sccache-v0.9.0-x86_64-unknown-linux-musl.tar.gz --strip=1 -C ~/.cargo/bin/
139148 #ls -l ~/.cargo/bin/
140- curl -Ls -o- https://github.com/rui314/mold/releases/download/v2.36.0/mold-2.36.0-aarch64-linux.tar.gz|sudo tar --strip=1 -xzf - -C/usr/local/
149+ curl -Ls -o- https://github.com/rui314/mold/releases/download/v2.40.3/mold-2.40.3-aarch64-linux.tar.gz|sudo tar --strip=1 -xzf - -C/usr/local/
150+ hash -r
151+ export RUSTFLAGS="-Clink-arg=-Bmold"
152+ expr "$CC" : ".*gcc" >/dev/null && : "${CFLAGS:=-std=c11 -Bmold -Wno-implicit-function-declaration -Wno-error=implicit-function-declaration}"
153+ export CC
154+ export CFLAGS
155+ ;;
156+ *arm*linux*musl*)
157+ sudo apt-get install -y gcc-arm-linux-gnueabihf
158+ curl -Ls -o- https://github.com/rui314/mold/releases/download/v2.40.3/mold-2.40.3-arm-linux.tar.gz|sudo tar --strip=1 -xzf - -C/usr/local/
141159 hash -r
142160 export RUSTFLAGS="-Clink-arg=-Bmold"
143161 expr "$CC" : ".*gcc" >/dev/null && : "${CFLAGS:=-std=c11 -Bmold -Wno-implicit-function-declaration -Wno-error=implicit-function-declaration}"
162+ export CC
144163 export CFLAGS
145164 ;;
146165 *arm*linux*)
147- sudo apt-get install gcc-arm-linux-gnueabihf -y
166+ sudo apt-get install -y gcc-arm-linux-gnueabihf
148167 #sed -i -e 's|^#rustc-wrapper|rustc-wrapper|' .cargo/config.toml
149168 #curl -LO https://github.com/mozilla/sccache/releases/download/v0.9.0/sccache-v0.9.0-x86_64-unknown-linux-musl.tar.gz
150169 #tar -xvf sccache-v0.9.0-x86_64-unknown-linux-musl.tar.gz --strip=1 -C ~/.cargo/bin/
151170 #ls -l ~/.cargo/bin/
152- curl -Ls -o- https://github.com/rui314/mold/releases/download/v2.36.0/mold-2.36.0-arm-linux.tar.gz|sudo tar --strip=1 -xzf - -C/usr/local/
171+ curl -Ls -o- https://github.com/rui314/mold/releases/download/v2.40.3/mold-2.40.3-arm-linux.tar.gz|sudo tar --strip=1 -xzf - -C/usr/local/
172+ hash -r
173+ export RUSTFLAGS="-Clink-arg=-Bmold"
174+ expr "$CC" : ".*gcc" >/dev/null && : "${CFLAGS:=-std=c11 -Bmold -Wno-implicit-function-declaration -Wno-error=implicit-function-declaration}"
175+ export CC
176+ export CFLAGS
177+ ;;
178+ *linux*musl*)
179+ sudo apt-get install -y libgoogle-perftools-dev pkg-config
180+ curl -Ls -o- https://github.com/rui314/mold/releases/download/v2.40.3/mold-2.40.3-x86_64-linux.tar.gz|sudo tar --strip=1 -xzf - -C/usr/local/
153181 hash -r
154182 export RUSTFLAGS="-Clink-arg=-Bmold"
155183 expr "$CC" : ".*gcc" >/dev/null && : "${CFLAGS:=-std=c11 -Bmold -Wno-implicit-function-declaration -Wno-error=implicit-function-declaration}"
184+ export CC
156185 export CFLAGS
186+ #export CXXFLAGS
157187 ;;
158188 *linux*)
159189 #sed -i -e 's|^#rustc-wrapper|rustc-wrapper|' .cargo/config.toml
190+ sudo apt-get install -y libgoogle-perftools-dev pkg-config
160191 #curl -LO https://github.com/mozilla/sccache/releases/download/v0.9.0/sccache-v0.9.0-x86_64-unknown-linux-musl.tar.gz
161192 #tar -xvf sccache-v0.9.0-x86_64-unknown-linux-musl.tar.gz --strip=1 -C ~/.cargo/bin/
162193 #ls -l ~/.cargo/bin/
163- curl -Ls -o- https://github.com/rui314/mold/releases/download/v2.36.0 /mold-2.36.0 -x86_64-linux.tar.gz|sudo tar --strip=1 -xzf - -C/usr/local/
194+ curl -Ls -o- https://github.com/rui314/mold/releases/download/v2.40.3 /mold-2.40.3 -x86_64-linux.tar.gz|sudo tar --strip=1 -xzf - -C/usr/local/
164195 hash -r
165196 export RUSTFLAGS="-Clink-arg=-Bmold"
166197 expr "$CC" : ".*gcc" >/dev/null && : "${CFLAGS:=-std=c11 -Bmold -Wno-implicit-function-declaration -Wno-error=implicit-function-declaration}"
198+ export CC
167199 export CFLAGS
200+ export CXXFLAGS
168201 ;;
169202 esac
170203 shell : " sh"
204+ - name : " features Setting"
205+ id : " features"
206+ run : |
207+ case "${{ join(matrix.targets) }}" in
208+ *arm*linux*musl*)
209+ echo "cargo=cargo" >> $GITHUB_OUTPUT
210+ echo "features=" >> $GITHUB_OUTPUT
211+ ;;
212+ *aarch64*linux*musl*)
213+ echo "cargo=cargo" >> $GITHUB_OUTPUT
214+ echo "features=" >> $GITHUB_OUTPUT
215+ ;;
216+ *linux*musl*)
217+ echo "features=use-mimalloc-rs" >> $GITHUB_OUTPUT
218+ echo "cargo=cargo" >> $GITHUB_OUTPUT
219+ ;;
220+ *aarch64*linux*)
221+ echo "features=use-mimalloc-rs" >> $GITHUB_OUTPUT
222+ echo "cargo=cargo" >> $GITHUB_OUTPUT
223+ ;;
224+ *arm*linux*)
225+ echo "features=use-mimalloc-rs" >> $GITHUB_OUTPUT
226+ echo "cargo=cargo" >> $GITHUB_OUTPUT
227+ ;;
228+ *linux*)
229+ echo "features=use-tcmalloc" >> $GITHUB_OUTPUT
230+ echo "cargo=cargo" >> $GITHUB_OUTPUT
231+ ;;
232+ *windows*)
233+ echo "features=" >> $GITHUB_OUTPUT
234+ echo "cargo=cargo-xwin" >> $GITHUB_OUTPUT
235+ ;;
236+ *)
237+ echo "features=use-mimalloc-rs" >> $GITHUB_OUTPUT
238+ echo "cargo=cargo" >> $GITHUB_OUTPUT
239+ ;;
240+ esac
241+ ## backup memo
242+ #${{ steps.features.outputs.cargo }} build --profile dist --target "${{ join(matrix.targets) }}" ${{ steps.features.outputs.features }}
243+ #dist manifest ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} --target "${{ join(matrix.targets) }}" > dist-manifest.json
244+
245+ shell : " bash"
171246 - name : " Install rust and rust-src"
172247 run : |
173248 # nightly -> rust 1.85.1 stable
174249 #sed -i -e 's|channel.*=.*|channel = "nightly"|' rust-toolchain.toml
175250 #sed -i -e 's|features =.*$|features = [ "use-mimalloc-rs", "unstable" ]|' dist-workspace.toml
176-
251+ rustup target add "${{ join(matrix.targets) }}"
252+ rustup component add rust-src
177253 #rust-toolchain.tomlに記載しているので、cargoコマンドで自動で追加インストールされるため不要
178254 #rustup update nightly
179255 #rustup component add rust-src --toolchain nightly
@@ -199,6 +275,7 @@ jobs:
199275 - name : Build artifacts
200276 run : |
201277 # Actually do builds and make zips and whatnot
278+ sed -i -e "s/features = .*/features = [\"${{ steps.features.outputs.features }}\"]/" dist-workspace.toml
202279 dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
203280 echo "dist ran successfully"
204281 - id : cargo-dist
0 commit comments