facebook / facebook/folly

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.```

Open
#2,264 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
30.5k
Forks
5.9k
PR merge metrics
No merged PRs in 30d

Description

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
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.