diff --git a/ci/docker/python-wheel-windows-vs2022-base.dockerfile b/ci/docker/python-wheel-windows-vs2022-base.dockerfile index f1bc314d013a..56177c65eab5 100644 --- a/ci/docker/python-wheel-windows-vs2022-base.dockerfile +++ b/ci/docker/python-wheel-windows-vs2022-base.dockerfile @@ -128,6 +128,7 @@ ENV CMAKE_BUILD_TYPE=${build_type} ` VCPKG_DEFAULT_TRIPLET=amd64-windows-static-md-${build_type} ` VCPKG_FEATURE_FLAGS="manifests" COPY ci/vcpkg/vcpkg.json arrow/ci/vcpkg/ + # cannot use the S3 feature here because while aws-sdk-cpp=1.9.160 contains # ssl related fixes as well as we can patch the vcpkg portfile to support # arm machines it hits ARROW-15141 where we would need to fall back to 1.8.186 diff --git a/ci/vcpkg/vcpkg.patch b/ci/vcpkg/vcpkg.patch index a4c8d5209785..5a7d7b279554 100644 --- a/ci/vcpkg/vcpkg.patch +++ b/ci/vcpkg/vcpkg.patch @@ -1,3 +1,14 @@ +diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake +index 3cc90cc..36af495 100644 +--- a/scripts/toolchains/windows.cmake ++++ b/scripts/toolchains/windows.cmake +@@ -88,4 +88,4 @@ if(NOT _VCPKG_WINDOWS_TOOLCHAIN) + set(CMAKE_C_FLAGS_DEBUG "${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" CACHE STRING "") +- set(CMAKE_CXX_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" CACHE STRING "") +- set(CMAKE_C_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" CACHE STRING "") ++ set(CMAKE_CXX_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_CXX_FLAGS_RELEASE}" CACHE STRING "") ++ set(CMAKE_C_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_C_FLAGS_RELEASE}" CACHE STRING "") + diff --git a/scripts/cmake/vcpkg_execute_build_process.cmake b/scripts/cmake/vcpkg_execute_build_process.cmake index 60fd5b587a..c8dc021af8 100644 --- a/scripts/cmake/vcpkg_execute_build_process.cmake diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_nested.cc b/cpp/src/arrow/compute/kernels/scalar_cast_nested.cc index 3ab42d89b6ee..392fd9fbb705 100644 --- a/cpp/src/arrow/compute/kernels/scalar_cast_nested.cc +++ b/cpp/src/arrow/compute/kernels/scalar_cast_nested.cc @@ -346,11 +346,13 @@ struct CastStruct { for (int out_field_index = 0; out_field_index < out_field_count; ++out_field_index) { const auto& out_field = out_type.field(out_field_index); - // Take the first field with matching name, if any. Extract it from the map so it - // can't be reused. - auto maybe_in_field_index = in_fields.extract(out_field->name()); - if (!maybe_in_field_index.empty()) { - fields_to_select[out_field_index] = maybe_in_field_index.mapped(); + // Take the first field with matching name, if any. Erase it from the map so it + // can't be reused. Use lower_bound (which guarantees first-match) instead of + // find/extract (which do not guarantee first for duplicate keys). + auto it = in_fields.lower_bound(out_field->name()); + if (it != in_fields.end() && it->first == out_field->name()) { + fields_to_select[out_field_index] = it->second; + in_fields.erase(it); } else if (out_field->nullable()) { fields_to_select[out_field_index] = kFillNullSentinel; } else { diff --git a/dev/tasks/python-wheels/github.windows.yml b/dev/tasks/python-wheels/github.windows.yml index 77e2a04e3a0a..96605614e321 100644 --- a/dev/tasks/python-wheels/github.windows.yml +++ b/dev/tasks/python-wheels/github.windows.yml @@ -57,6 +57,28 @@ jobs: esac echo "TEST_IMAGE_PREFIX=${test_image_prefix}" >> ${GITHUB_ENV} + - name: Configure Docker data-root + shell: powershell + run: | + # The D: drive on windows-2022 GH Actions runners has ~44GB free vs ~14GB on C:. + # Moving Docker's data-root to D: prevents hcsshim::ImportLayer failures when + # building large Windows container layers (e.g. the vcpkg install layer). GH-49676 + Stop-Service docker + $daemonJson = "C:\ProgramData\Docker\config\daemon.json" + New-Item -ItemType Directory -Force -Path (Split-Path $daemonJson) | Out-Null + if (Test-Path $daemonJson) { + $json = Get-Content $daemonJson | ConvertFrom-Json + $json | Add-Member -Force -NotePropertyName "data-root" -NotePropertyValue "D:\docker" + $json | ConvertTo-Json -Depth 10 | Set-Content $daemonJson + } else { + Set-Content $daemonJson -Value '{"data-root":"D:\docker"}' + } + Start-Service docker + Write-Host "=== daemon.json ===" + Get-Content $daemonJson + Write-Host "=== docker info ===" + docker info + - name: Build wheel shell: cmd run: |