Skip to content

Commit f792298

Browse files
committed
Simplify more previous build works
1 parent 06adc74 commit f792298

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

.github/workflows/release-binaries-setup-stage/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ runs:
3030
with:
3131
arch: amd64
3232

33+
# In order to avoid some errors with long paths names, we need to shorten
34+
# the path names for the build.
35+
- name: Shorten paths on Windows
36+
if: startsWith(runner.os, 'Windows')
37+
run: |
38+
subst S: ${{ github.workspace }}
39+
3340
- name: Set Build Prefix
3441
id: build-prefix
3542
shell: bash
@@ -38,6 +45,8 @@ runs:
3845
if [ "${{ runner.os }}" = "Linux" ]; then
3946
sudo chown $USER:$USER /mnt/
4047
build_prefix=/mnt/
48+
elif [ "${{ runner.os }}" = "Windows" ]; then
49+
build_prefix=/s/
4150
fi
4251
echo "build-prefix=$build_prefix" >> $GITHUB_OUTPUT
4352

.github/workflows/release-binaries.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -236,39 +236,33 @@ jobs:
236236
id: setup-stage
237237
uses: ./workflows-main/.github/workflows/release-binaries-setup-stage
238238

239+
# We will use Wix to generate the installer on Windows, because this supports
240+
# installers > 2GB.
239241
- name: Install Wix
242+
if: runner.os == 'Windows'
240243
run: |
241244
dotnet tool install --global wix
242245
- name: Configure
243246
id: build
247+
shell: bash
244248
env:
245249
CCACHE_BIN: ${{ needs.prepare.outputs.ccache }}
246-
CMAKE: /c/Android/android-sdk/cmake/3.31.5/bin/cmake.exe
247250
run: |
248251
# There were some issues on the ARM64 MacOS runners with trying to build x86 object,
249252
# so we need to set some extra cmake flags to disable this.
250-
#export PATH=C:\Strawberry\c\bin\:$PATH
251-
subst S: ${{ github.workspace }}
252-
cmake -G Ninja -S S:\llvm -B S:\build `
253-
${{ needs.prepare.outputs.target-cmake-flags }} `
254-
-C clang\cmake\caches\Release.cmake `
255-
-DBOOTSTRAP_BOOTSTRAP_CPACK_GENERATOR=WIX `
253+
cmake -G Ninja -S llvm -B ${{ steps.setup-stage.outputs.build-prefix }}/build \
254+
${{ needs.prepare.outputs.target-cmake-flags }} \
255+
-C clang/cmake/caches/Release.cmake \
256+
-DBOOTSTRAP_LLVM_PARALLEL_LINK_JOBS=1 \
256257
-DBOOTSTRAP_BOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}"
257258
258-
- name: Build Unix
259+
- name: Build
259260
shell: bash
260261
run: |
261-
ninja -v -C /s/build stage2-package
262-
release_dir=`find /s/build -iname 'stage2-bins'`
262+
ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-package
263+
release_dir=`find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname 'stage2-bins'`
263264
mv $release_dir/${{ needs.prepare.outputs.release-binary-filename }} .
264-
265-
# There is an issue with building on Windows with bash so we use power shell.
266-
# ninja: error: mkdir(tools/clang/tools/extra/clang-tidy/misc/ConfusableTable/CMakeFiles/clang-tidy-confusable-chars-gen.dir/C_/actions-runner/llvm-project/llvm-project/llvm): No such file or directory
267-
#- name: Build Windows
268-
# if: runner.os == 'Windows'
269-
# run: |
270-
# ninja -v -C "S:\build" stage2-package
271-
265+
272266
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
273267
with:
274268
name: ${{ runner.os }}-${{ runner.arch }}-release-binary

clang/cmake/caches/Release.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
148148
set_final_stage_var(CLANG_BOLT "INSTRUMENT" STRING)
149149
endif()
150150
# We want to generate an installer on Windows.
151-
if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows")
151+
if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows")
152+
set_final_stage_var(CPACK_GENERATOR "WIX" STRING)
153+
else()
152154
set_final_stage_var(CPACK_GENERATOR "TXZ" STRING)
153155
endif()
154156
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows")

0 commit comments

Comments
 (0)