From 6495a90f93b1aba61de81f9b5eefc4d8579825e5 Mon Sep 17 00:00:00 2001 From: "Zeyi (Rice) Fan" Date: Wed, 8 Jun 2022 13:18:38 -0700 Subject: [PATCH] disable autocrlf on Windows jobs Summary: In D36905191 (https://github.com/facebook/proxygen/commit/6e6bf12f62ffef571b4418f8a8cd2a82a1b8bcb6), getdeps gained the ability to apply patches on Windows. However, on GitHub Action workers, `core.autocrlf` is turned on by default. This means the patch files we checked in will end up having CRLF endings while the source code we downloaded are still in LF endings, and `git apply` doesn't like that. This diff teaches getdeps to disable `core.autocrlf` in GitHub Action Windows workers. Reviewed By: vitaut Differential Revision: D37008387 fbshipit-source-id: 34c9f89e8783d0613040d190c4ad3477bd7bfd53 --- .github/workflows/getdeps_linux.yml | 12 ++++++++---- .github/workflows/getdeps_mac.yml | 12 ++++++++---- build/fbcode_builder/getdeps.py | 5 ++++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/getdeps_linux.yml b/.github/workflows/getdeps_linux.yml index 1ddc2312d..2563bb491 100644 --- a/.github/workflows/getdeps_linux.yml +++ b/.github/workflows/getdeps_linux.yml @@ -15,12 +15,12 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - - name: Fetch zlib - run: python3 build/fbcode_builder/getdeps.py fetch --no-tests zlib - name: Fetch ninja run: python3 build/fbcode_builder/getdeps.py fetch --no-tests ninja - name: Fetch cmake run: python3 build/fbcode_builder/getdeps.py fetch --no-tests cmake + - name: Fetch zlib + run: python3 build/fbcode_builder/getdeps.py fetch --no-tests zlib - name: Fetch zstd run: python3 build/fbcode_builder/getdeps.py fetch --no-tests zstd - name: Fetch boost @@ -51,6 +51,8 @@ jobs: run: python3 build/fbcode_builder/getdeps.py fetch --no-tests gperf - name: Fetch libsodium run: python3 build/fbcode_builder/getdeps.py fetch --no-tests libsodium + - name: Fetch xz + run: python3 build/fbcode_builder/getdeps.py fetch --no-tests xz - name: Fetch folly run: python3 build/fbcode_builder/getdeps.py fetch --no-tests folly - name: Fetch fizz @@ -59,12 +61,12 @@ jobs: run: python3 build/fbcode_builder/getdeps.py fetch --no-tests mvfst - name: Fetch wangle run: python3 build/fbcode_builder/getdeps.py fetch --no-tests wangle - - name: Build zlib - run: python3 build/fbcode_builder/getdeps.py build --no-tests zlib - name: Build ninja run: python3 build/fbcode_builder/getdeps.py build --no-tests ninja - name: Build cmake run: python3 build/fbcode_builder/getdeps.py build --no-tests cmake + - name: Build zlib + run: python3 build/fbcode_builder/getdeps.py build --no-tests zlib - name: Build zstd run: python3 build/fbcode_builder/getdeps.py build --no-tests zstd - name: Build boost @@ -95,6 +97,8 @@ jobs: run: python3 build/fbcode_builder/getdeps.py build --no-tests gperf - name: Build libsodium run: python3 build/fbcode_builder/getdeps.py build --no-tests libsodium + - name: Build xz + run: python3 build/fbcode_builder/getdeps.py build --no-tests xz - name: Build folly run: python3 build/fbcode_builder/getdeps.py build --no-tests folly - name: Build fizz diff --git a/.github/workflows/getdeps_mac.yml b/.github/workflows/getdeps_mac.yml index 528ba1947..296385ed8 100644 --- a/.github/workflows/getdeps_mac.yml +++ b/.github/workflows/getdeps_mac.yml @@ -15,12 +15,12 @@ jobs: runs-on: macOS-latest steps: - uses: actions/checkout@v2 - - name: Fetch zlib - run: python3 build/fbcode_builder/getdeps.py fetch --no-tests zlib - name: Fetch ninja run: python3 build/fbcode_builder/getdeps.py fetch --no-tests ninja - name: Fetch cmake run: python3 build/fbcode_builder/getdeps.py fetch --no-tests cmake + - name: Fetch zlib + run: python3 build/fbcode_builder/getdeps.py fetch --no-tests zlib - name: Fetch zstd run: python3 build/fbcode_builder/getdeps.py fetch --no-tests zstd - name: Fetch boost @@ -53,6 +53,8 @@ jobs: run: python3 build/fbcode_builder/getdeps.py fetch --no-tests gperf - name: Fetch libsodium run: python3 build/fbcode_builder/getdeps.py fetch --no-tests libsodium + - name: Fetch xz + run: python3 build/fbcode_builder/getdeps.py fetch --no-tests xz - name: Fetch folly run: python3 build/fbcode_builder/getdeps.py fetch --no-tests folly - name: Fetch fizz @@ -61,12 +63,12 @@ jobs: run: python3 build/fbcode_builder/getdeps.py fetch --no-tests mvfst - name: Fetch wangle run: python3 build/fbcode_builder/getdeps.py fetch --no-tests wangle - - name: Build zlib - run: python3 build/fbcode_builder/getdeps.py build --no-tests zlib - name: Build ninja run: python3 build/fbcode_builder/getdeps.py build --no-tests ninja - name: Build cmake run: python3 build/fbcode_builder/getdeps.py build --no-tests cmake + - name: Build zlib + run: python3 build/fbcode_builder/getdeps.py build --no-tests zlib - name: Build zstd run: python3 build/fbcode_builder/getdeps.py build --no-tests zstd - name: Build boost @@ -99,6 +101,8 @@ jobs: run: python3 build/fbcode_builder/getdeps.py build --no-tests gperf - name: Build libsodium run: python3 build/fbcode_builder/getdeps.py build --no-tests libsodium + - name: Build xz + run: python3 build/fbcode_builder/getdeps.py build --no-tests xz - name: Build folly run: python3 build/fbcode_builder/getdeps.py build --no-tests folly - name: Build fizz diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index dd4b2c2c9..369285bb8 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -973,7 +973,6 @@ jobs: out.write(" build:\n") out.write(" runs-on: %s\n" % runs_on) out.write(" steps:\n") - out.write(" - uses: actions/checkout@v2\n") if build_opts.is_windows(): # cmake relies on BOOST_ROOT but GH deliberately don't set it in order @@ -994,6 +993,10 @@ jobs: # that we want it to use them! out.write(" - name: Fix Git config\n") out.write(" run: git config --system core.longpaths true\n") + out.write(" - name: Disable autocrlf\n") + out.write(" run: git config --system core.autocrlf false\n") + + out.write(" - uses: actions/checkout@v2\n") allow_sys_arg = "" if (