facebook / folly

An open-source C++ library developed and used at Facebook.
https://groups.google.com/forum/?fromgroups#!forum/facebook-folly
Apache License 2.0
28.06k stars 5.53k forks source link

build from source failed on win11 ```subprocess.CalledProcessError: Command '['git', 'apply', '--ignore-space-change', 'D:\\code\\folly\\build\\fbcode_builder\\patches\\boost_comparator_operator_fix.patch']' returned non-zero exit status 128.``` #2264

Open MrX-OvO opened 1 month ago

MrX-OvO commented 1 month ago

when running python ./build/fbcode_builder/getdeps.py --allow-system-packages build in powershell, I got this error:

>python ./build/fbcode_builder/getdeps.py --allow-system-packages build
Mapping scratch dir C:\Users\mrxovo\AppData\Local\Temp\fbcode_builder_getdeps-DZZcodeZfollyZbuildZfbcode_builder -> Z:\
Building on {distro=None, distro_vers=10, fb=off, fbsource=off, os=windows, shared_libs=off, test=on}
Testing ENV[BOOST_ROOT_1_69_0]: None
Testing ENV[BOOST_ROOT_1_69_0]: None
Assessing boost...
Download with https://archives.boost.io/release/1.83.0/source/boost_1_83_0.zip -> Z:\downloads\boost-boost_1_83_0.zip ...
 downloading 212036459 of 212036459  [Complete in 77.914212 seconds]
Connection: close
Content-Length: 212036459
Content-Type: application/zip
Server: nginx/1.18.0 (Ubuntu)
Last-Modified: Sat, 12 Aug 2023 03:27:37 GMT
ETag: "64d6fc29-ca36b6b"
Accept-Ranges: bytes
Age: 4145
Date: Wed, 24 Jul 2024 10:45:17 GMT
Via: 1.1 varnish
X-Served-By: cache-qpg120093-QPG
X-Cache: HIT
X-Cache-Hits: 0
X-Timer: S1721817917.189494,VS0,VE1
Strict-Transport-Security: max-age=31557600

Extract Z:\downloads\boost-boost_1_83_0.zip -> Z:\extracted\boost-boost_1_83_0.zip
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 "D:\code\folly\build\fbcode_builder\getdeps\builder.py", line 138, in _apply_patchfile
    subprocess.check_call(patchcmd + [patchfile])
  File "C:\Users\mrxovo\miniforge3\lib\subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'apply', '--ignore-space-change', 'D:\\code\\folly\\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 "D:\code\folly\build\fbcode_builder\getdeps.py", line 1422, in <module>
    sys.exit(main())
  File "D:\code\folly\build\fbcode_builder\getdeps.py", line 1405, in main
    return args.func(args)
  File "D:\code\folly\build\fbcode_builder\getdeps.py", line 108, in run
    self.run_project_cmd(args, loader, manifest)
  File "D:\code\folly\build\fbcode_builder\getdeps.py", line 671, in run_project_cmd
    builder.build(reconfigure=reconfigure)
  File "D:\code\folly\build\fbcode_builder\getdeps\builder.py", line 163, in build
    self._apply_patchfile()
  File "D:\code\folly\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

python version

>python -V
Python 3.10.13

OS Windows 11 Pro 23H2 22631.3880

How can I fix it? Thank you.

Orvid commented 1 month ago

Could you check to see if the patch file is actually intact? The first error is saying the patch file is corrupted, so there might have been an issue when you cloned the repo.

It's also possible (though unlikely) that the patch no longer applies to the version of boost we point it at?

xiedeacc commented 1 week ago

meet same error, patch manully fixed this problem

MrX-OvO commented 1 week ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

xiedeacc commented 1 week ago

I'sure boost was the version you specified