Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI][Packaging][C++][Windows] Snappy patch fails to apply on arm64 windows wheel builds #35503

Closed
sjperkins opened this issue May 9, 2023 · 0 comments · Fixed by #35509
Closed

Comments

@sjperkins
Copy link
Contributor

sjperkins commented May 9, 2023

Describe the bug, including details regarding any error messages, version, and platform.

#35430 updated the vcpkg version to version 2023.04.15. Snappy patches no longer cleanly apply on arm64 windows wheel builds. See for instance #35430 (comment).

Installing 66/100 snappy:amd64-windows-static-md-release...
Building snappy[core]:amd64-windows-static-md-release...
-- [OVERLAY] Loading triplet configuration from: C:\arrow\ci\vcpkg\amd64-windows-static-md-release.cmake
-- Downloading https://github.com/google/snappy/archive/1.1.9.tar.gz -> google-snappy-1.1.9.tar.gz...
-- Extracting source C:/vcpkg/downloads/google-snappy-1.1.9.tar.gz
-- Applying patch fix_clang-cl_build.patch
-- Applying patch snappy-disable-bmi.patch
CMake Error at scripts/cmake/z_vcpkg_apply_patches.cmake:34 (message):
  Applying patch failed: error: corrupt patch at line 18

Call Stack (most recent call first):
  scripts/cmake/vcpkg_extract_source_archive.cmake:153 (z_vcpkg_apply_patches)
  scripts/cmake/vcpkg_extract_source_archive_ex.cmake:8 (vcpkg_extract_source_archive)
  scripts/cmake/vcpkg_from_github.cmake:113 (vcpkg_extract_source_archive_ex)
  ports/snappy/portfile.cmake:4 (vcpkg_from_github)
  scripts/ports.cmake:147 (include)


error: building snappy:amd64-windows-static-md-release failed with: BUILD_FAILED
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+snappy
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?title=[snappy]+Build+error&body=Copy+issue+body+from+C%3A%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md

The command 'cmd /S /C vcpkg install         --clean-after-build         --x-install-root=%VCPKG_ROOT%\installed         --x-manifest-root=arrow/ci/vcpkg         --x-feature=flight         --x-feature=gcs         --x-feature=json         --x-feature=parquet' returned a non-zero code: 1
Error: docker build --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg python=3.10 --build-arg vcpkg=501db0f17ef6df184fcdbfbe0f87cde2313b6ab1 -f D:\a\crossbow\crossbow\arrow\ci/docker/python-wheel-windows-vs2017.dockerfile -t ghcr.io/ursacomputing/arrow:python-3.10-wheel-windows-vs2017-vcpkg-501db0f17ef6df184fcdbfbe0f87cde2313b6ab1-2022-06-12 D:\a\crossbow\crossbow\arrow exited with non-zero exit code 1

Relevant parts of the patch are here:

vcpkg_cmake_configure(
diff --git a/ports/snappy/snappy-disable-bmi.patch b/ports/snappy/snappy-disable-bmi.patch
new file mode 100644
index 0000000000..a57ce0c22f
--- /dev/null
+++ b/ports/snappy/snappy-disable-bmi.patch
@@ -0,0 +1,19 @@
+diff --git a/snappy.cc b/snappy.cc
+index 79dc0e8..f3153ea 100644
+--- a/snappy.cc
++++ b/snappy.cc
+@@ -965,14 +965,10 @@ static inline void Report(const char *algorithm, size_t compressed_size,
+ static inline uint32_t ExtractLowBytes(uint32_t v, int n) {
+ assert(n >= 0);
+ assert(n <= 4);
+-#if SNAPPY_HAVE_BMI2
+- return _bzhi_u32(v, 8 * n);
+-#else
+ // This needs to be wider than uint32_t otherwise `mask << 32` will be
+ // undefined.
+ uint64_t mask = 0xffffffff;
+ return v & ~(mask << (8 * n));
+-#endif
+ }
+
+ static inline bool LeftShiftOverflows(uint8_t value, uint32_t shift) {

Component(s)

C++, Continuous Integration, Packaging

@sjperkins sjperkins changed the title Snappy patch fails to apply on arm64 windows wheel builds [CI][Packaging][C++][Windows] Snappy patch fails to apply on arm64 windows wheel builds May 9, 2023
assignUser pushed a commit that referenced this issue May 10, 2023
…indows wheel builds (#35509)

### Rationale for this change

Nightly Windows wheels have been failing for the last days.

### What changes are included in this PR?

Fix wrong snappy patch

### Are these changes tested?

Tested on crossbow

### Are there any user-facing changes?

No
* Closes: #35503

Authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
@assignUser assignUser added this to the 13.0.0 milestone May 10, 2023
liujiacheng777 pushed a commit to LoongArch-Python/arrow that referenced this issue May 11, 2023
…rm64 windows wheel builds (apache#35509)

### Rationale for this change

Nightly Windows wheels have been failing for the last days.

### What changes are included in this PR?

Fix wrong snappy patch

### Are these changes tested?

Tested on crossbow

### Are there any user-facing changes?

No
* Closes: apache#35503

Authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
ArgusLi pushed a commit to Bit-Quill/arrow that referenced this issue May 15, 2023
…rm64 windows wheel builds (apache#35509)

### Rationale for this change

Nightly Windows wheels have been failing for the last days.

### What changes are included in this PR?

Fix wrong snappy patch

### Are these changes tested?

Tested on crossbow

### Are there any user-facing changes?

No
* Closes: apache#35503

Authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
rtpsw pushed a commit to rtpsw/arrow that referenced this issue May 16, 2023
…rm64 windows wheel builds (apache#35509)

### Rationale for this change

Nightly Windows wheels have been failing for the last days.

### What changes are included in this PR?

Fix wrong snappy patch

### Are these changes tested?

Tested on crossbow

### Are there any user-facing changes?

No
* Closes: apache#35503

Authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment