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

getdeps.sh fails on windows when applying patch to boost #510

Open
fmoo opened this issue Aug 23, 2024 · 4 comments
Open

getdeps.sh fails on windows when applying patch to boost #510

fmoo opened this issue Aug 23, 2024 · 4 comments
Assignees

Comments

@fmoo
Copy link

fmoo commented Aug 23, 2024

When running getdeps.sh on Windows (via git/mingw bash), I get the following error when it tries to patch boost:

Building on {distro=None, distro_vers=10, fb=off, fbsource=off, os=windows, shared_libs=off, test=on}
Assessing gperf...
Assessing libsodium...
Assessing boost...
Building boost...
Patching boost with boost_comparator_operator_fix.patch in Z:\extracted\boost-boost_1_83_0.zip\boost_1_83_0
error: corrupt patch at line 11
Traceback (most recent call last):
  File "C:\source\proxygen\build\fbcode_builder\getdeps\builder.py", line 138, in _apply_patchfile
    subprocess.check_call(patchcmd + [patchfile])
  File "C:\Tools\Python310\Lib\subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'apply', '--ignore-space-change', 'C:\\source\\proxygen\\build\\fbcode_builder\\patches\\boost_comparator_operator_fix.patch']' returned non-zero exit status 128.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\source\proxygen\build\fbcode_builder\getdeps.py", line 1422, in <module>
    sys.exit(main())
  File "C:\source\proxygen\build\fbcode_builder\getdeps.py", line 1405, in main
    return args.func(args)
  File "C:\source\proxygen\build\fbcode_builder\getdeps.py", line 108, in run
    self.run_project_cmd(args, loader, manifest)
  File "C:\source\proxygen\build\fbcode_builder\getdeps.py", line 671, in run_project_cmd
    builder.build(reconfigure=reconfigure)
  File "C:\source\proxygen\build\fbcode_builder\getdeps\builder.py", line 163, in build
    self._apply_patchfile()
  File "C:\source\proxygen\build\fbcode_builder\getdeps\builder.py", line 140, in _apply_patchfile
    raise ValueError(f"Failed to apply patch to {self.manifest.name}")
ValueError: Failed to apply patch to boost
@fmoo
Copy link
Author

fmoo commented Aug 23, 2024

Updating the second to last line of the patch to include a single whitespace seems to fix it locally for me:

diff --git a/build/fbcode_builder/patches/boost_comparator_operator_fix.patch b/build/fbcode_builder/patches/boost_comparator_operator_fix.patch
index 3771f2fff..45ee266b0 100644
--- a/build/fbcode_builder/patches/boost_comparator_operator_fix.patch
+++ b/build/fbcode_builder/patches/boost_comparator_operator_fix.patch
@@ -8,4 +8,4 @@ diff --git a/boost/serialization/strong_typedef.hpp b/boost/serialization/strong
 +    bool operator==(const T& lhs) const {return t == lhs;}                                                       \
      bool operator<(const D& rhs) const {return t < rhs.t;}                                                       \
  };
-
+ 

@fmoo
Copy link
Author

fmoo commented Aug 23, 2024

Zlib needed four similarly:

diff --git a/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch b/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch
index 2ef115714..134191551 100644
--- a/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch
+++ b/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch
@@ -4,7 +4,7 @@ diff -Naur ../zlib-1.3.1/CMakeLists.txt ./CMakeLists.txt
 @@ -149,10 +149,8 @@
      set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
  endif(MINGW)
-
+ 
 -add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
 +add_library(zlib ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
  target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
@@ -12,9 +12,9 @@ diff -Naur ../zlib-1.3.1/CMakeLists.txt ./CMakeLists.txt
 -target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
  set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
  set_target_properties(zlib PROPERTIES SOVERSION 1)
-
+ 
 @@ -169,7 +167,7 @@
-
+ 
  if(UNIX)
      # On unix-like platforms the library is almost always called libz
 -   set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
@@ -24,7 +24,7 @@ diff -Naur ../zlib-1.3.1/CMakeLists.txt ./CMakeLists.txt
     endif()
 @@ -179,7 +177,7 @@
  endif()
-
+ 
  if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
 -    install(TARGETS zlib zlibstatic
 +    install(TARGETS zlib

1 similar comment
@fmoo
Copy link
Author

fmoo commented Aug 23, 2024

Zlib needed four similarly:

diff --git a/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch b/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch
index 2ef115714..134191551 100644
--- a/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch
+++ b/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch
@@ -4,7 +4,7 @@ diff -Naur ../zlib-1.3.1/CMakeLists.txt ./CMakeLists.txt
 @@ -149,10 +149,8 @@
      set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
  endif(MINGW)
-
+ 
 -add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
 +add_library(zlib ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
  target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
@@ -12,9 +12,9 @@ diff -Naur ../zlib-1.3.1/CMakeLists.txt ./CMakeLists.txt
 -target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
  set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
  set_target_properties(zlib PROPERTIES SOVERSION 1)
-
+ 
 @@ -169,7 +167,7 @@
-
+ 
  if(UNIX)
      # On unix-like platforms the library is almost always called libz
 -   set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
@@ -24,7 +24,7 @@ diff -Naur ../zlib-1.3.1/CMakeLists.txt ./CMakeLists.txt
     endif()
 @@ -179,7 +177,7 @@
  endif()
-
+ 
  if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
 -    install(TARGETS zlib zlibstatic
 +    install(TARGETS zlib

@fmoo
Copy link
Author

fmoo commented Aug 23, 2024

After this, I got all the way up to folly, which failed with:

CMake Error at C:/source/proxygen/_build/boost-Ct8ZMk_J_pyqyHLfrydelwvlfzw-NfC_5D8VmaRrOvw/lib/cmake/Boost-1.83.0/BoostConfig.cmake:141 (find_package):
  Found package configuration file:

    C:/source/proxygen/_build/boost-Ct8ZMk_J_pyqyHLfrydelwvlfzw-NfC_5D8VmaRrOvw/lib/cmake/boost_context-1.83.0/boost_context-config.cmake

  but it set boost_context_FOUND to FALSE so package "boost_context" is
  considered to be NOT FOUND.  Reason given by package:

  No suitable build variant has been found.

  The following variants have been tried and rejected:

  * boost_context-vc143-mt-x64-1_83.lib (vc143, detected vc141, set
  Boost_COMPILER to override)

  * libboost_context-vc143-mt-x64-1_83.lib (vc143, detected vc141, set
  Boost_COMPILER to override)

Call Stack (most recent call first):
  C:/source/proxygen/_build/boost-Ct8ZMk_J_pyqyHLfrydelwvlfzw-NfC_5D8VmaRrOvw/lib/cmake/Boost-1.83.0/BoostConfig.cmake:262 (boost_find_component)
  C:/source/proxygen/_build/cmake-EFTozGEkm4tQR_57fvLQiFbFunALgAvRSIBuLcqKKpc/share/cmake-3.20/Modules/FindBoost.cmake:594 (find_package)
  CMake/folly-deps.cmake:38 (find_package)
  CMakeLists.txt:133 (include)


-- Configuring incomplete, errors occurred!
See also "Z:/build/folly/CMakeFiles/CMakeOutput.log".
See also "Z:/build/folly/CMakeFiles/CMakeError.log".
Command '['Z:\\build\\folly\\succeed.bat', '&&', 'C:/source/proxygen/_build/cmake-EFTozGEkm4tQR_57fvLQiFbFunALgAvRSIBuLcqKKpc\\bin\\cmake.exe', 'Z:\\repos\\github.com-facebook-folly.git', '-DCMAKE_INSTALL_PREFIX=C:/source/proxygen/_build/folly', '-DBUILD_SHARED_LIBS=OFF', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DBOOST_LINK_STATIC=ON', '-DBUILD_TESTS=OFF', '-DBUILD_BENCHMARKS=OFF', '-G', 'Ninja']' returned non-zero exit status 1.
!! Failed

CMakeError.log
CMakeOutput.log

lmk if I should open a separate issue for that or what.

kvtsoy added a commit to kvtsoy/proxygen that referenced this issue Sep 20, 2024
Summary:
facebook#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Differential Revision: D63148510
@kvtsoy kvtsoy mentioned this issue Sep 20, 2024
kvtsoy added a commit to kvtsoy/proxygen that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007


facebook#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510
facebook-github-bot pushed a commit to facebook/fb303 that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebookexperimental/edencommon that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebookexperimental/rust-shed that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

Pull Request resolved: #518

#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebook/openr that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebook/wangle that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebook/mvfst that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebookexperimental/moxygen that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebook/fboss that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebook/folly that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebook/watchman that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebookincubator/fizz that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebookincubator/katran that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebookincubator/hsthrift that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebook/sapling that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebook/fbthrift that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
facebook-github-bot pushed a commit to facebook/hhvm that referenced this issue Oct 8, 2024
Summary:
X-link: facebookincubator/zstrong#1007

X-link: facebook/proxygen#518

facebook/proxygen#510

git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix.
I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine.

Reviewed By: afrind, bigfootjon

Differential Revision: D63148510

fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants