Skip to content

Commit 461479d

Browse files
authored
Fix GHA CI Windows Path Limits (#451)
GHA Windows runners have an enviornment option LongPathsEnabled which defaults to true (1). This can be tested by running (Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled in a Windows runner. This value isn't honored within bash shells on Windows and the path limit caused build errors in the Packaging Build workflow for Firestore targets. This change removes 'bash' as the shell when building and instead executespython scripts/gha/build_desktop.py via the host operating system's default shell.
1 parent 85ccba4 commit 461479d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/cpp-packaging.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,23 @@ jobs:
339339
run: |
340340
python scripts/gha/install_prereqs_desktop.py
341341
342-
- name: Build desktop SDK
342+
- name: Export verbose flag
343343
shell: bash
344344
run: |
345345
verbose_flag=
346346
if [[ -n "${{ github.event.inputs.verboseBuild }}" && "${{ github.event.inputs.verboseBuild }}" -ne 0 ]]; then
347347
verbose_flag=--verbose
348348
fi
349-
python scripts/gha/build_desktop.py --arch "${{ matrix.architecture }}" --config "${{ matrix.build_type }}" --msvc_runtime_library "${{ matrix.msvc_runtime }}" --linux_abi "${{ matrix.linux_abi }}" --build_dir out-sdk ${verbose_flag} ${{ matrix.additional_build_flags }}
350-
# Make a list of all the source files, for debugging purposes.
349+
echo "VERBOSE_FLAG=${verbose_flag}" >> $GITHUB_ENV
350+
351+
# Run the build in the host OS default shell since Windows can't handle long path names in bash.
352+
- name: Build desktop SDK
353+
run: |
354+
python scripts/gha/build_desktop.py --arch "${{ matrix.architecture }}" --config "${{ matrix.build_type }}" --msvc_runtime_library "${{ matrix.msvc_runtime }}" --linux_abi "${{ matrix.linux_abi }}" --build_dir out-sdk ${VERBOSE_FLAG} ${{ matrix.additional_build_flags }}
355+
356+
- name: Archive SDK
357+
shell: bash
358+
run: |
351359
cd out-sdk
352360
find .. -type f -print > src_file_list.txt
353361
tar -czhf ../firebase-cpp-sdk-${{ env.SDK_NAME }}-build.tgz .

0 commit comments

Comments
 (0)