From a12b4fccacf4fe2c2172ddb2d389f1ad8e2a0b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Barto=C5=88?= Date: Thu, 10 Oct 2024 17:03:13 +0200 Subject: [PATCH] Add daily rebase of Cygwin to `rebase.yml` (#203) --- .github/scripts/toolchain/patch-cygwin.sh | 2 + .github/workflows/advanced.yml | 13 ++++-- .github/workflows/rebase.yml | 55 ++++++++++++++++++++++- patches/cygwin/0003-fix-mingw.patch | 29 ++++++++++++ 4 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 patches/cygwin/0003-fix-mingw.patch diff --git a/.github/scripts/toolchain/patch-cygwin.sh b/.github/scripts/toolchain/patch-cygwin.sh index a5c4b4b3b..987548230 100755 --- a/.github/scripts/toolchain/patch-cygwin.sh +++ b/.github/scripts/toolchain/patch-cygwin.sh @@ -50,6 +50,8 @@ echo "::group::Patch Cygwin" if [[ "$STAGE" = "1" ]]; then patch -p1 -i $PATCH_DIR/0002-after-autogen.patch fi + + patch -p1 -i $PATCH_DIR/0003-fix-mingw.patch echo "::endgroup::" echo 'Success!' diff --git a/.github/workflows/advanced.yml b/.github/workflows/advanced.yml index b22da3bf1..4afb9bc2b 100644 --- a/.github/workflows/advanced.yml +++ b/.github/workflows/advanced.yml @@ -151,8 +151,8 @@ jobs: - name: Check `tar` and `zstd` version shell: bash run: | - zstd --version - tar --version + zstd --version || true + tar --version || true - name: Checkout repository uses: actions/checkout@v4 @@ -488,8 +488,15 @@ jobs: - name: Check `tar` and `zstd` version shell: bash run: | + zstd --version || true + tar --version || true + + - name: Install zstd + run: | + Invoke-WebRequest https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-v1.5.2-win64.zip -OutFile $env:RUNNER_TEMP\zstd.zip + Expand-Archive $env:RUNNER_TEMP\zstd.zip -DestinationPath $env:RUNNER_TEMP + Add-Content $env:GITHUB_PATH "$env:RUNNER_TEMP\zstd-v1.5.2-win64" zstd --version - tar --version - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 9d0a62167..98b7064a3 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -28,6 +28,8 @@ env: GCC_UPSTREAM_URL: git://gcc.gnu.org/git/gcc.git MINGW_REPO: Windows-on-ARM-Experiments/mingw-woarm64 MINGW_UPSTREAM_URL: https://git.code.sf.net/p/mingw-w64/mingw-w64 + CYGWIN_REPO: Windows-on-ARM-Experiments/newlib-cygwin + CYGWIN_UPSTREAM_URL: https://cygwin.com/git/newlib-cygwin.git SOURCE_PATH: ${{ github.workspace }}/code ORIGIN_BRANCH: ${{ inputs.origin_branch || 'woarm64' }} @@ -104,8 +106,36 @@ jobs: run: | ${{ github.workspace }}/.github/scripts/rebase-start.sh ${{ env.MINGW_UPSTREAM_URL }} ${{ env.UPSTREAM_BRANCH }} ${{ env.REBASE_BRANCH }} + start-cygwin-rebase: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + path: ${{ github.workspace }} + + - name: Checkout Cygwin + uses: actions/checkout@v4 + with: + token: ${{ secrets.GNU_PUSH_PAT }} + repository: ${{ env.CYGWIN_REPO }} + ref: ${{ env.ORIGIN_BRANCH }} + fetch-depth: 0 + path: ${{ env.SOURCE_PATH }}/cygwin + + - name: Start Cygwin rebase + working-directory: ${{ env.SOURCE_PATH }}/cygwin + run: | + ${{ github.workspace }}/.github/scripts/rebase-start.sh ${{ env.CYGWIN_UPSTREAM_URL }} ${{ env.UPSTREAM_BRANCH }} ${{ env.REBASE_BRANCH }} + build: - needs: [start-binutils-rebase, start-gcc-rebase, start-mingw-rebase] + needs: [ + start-binutils-rebase, + start-gcc-rebase, + start-mingw-rebase, + start-cygwin-rebase + ] uses: ./.github/workflows/advanced.yml with: binutils_branch: ${{ inputs.rebase_branch || 'rebase-upstream' }} @@ -181,6 +211,29 @@ jobs: run: | ${{ github.workspace }}/.github/scripts/rebase-finish.sh ${{ env.REBASE_BRANCH }} ${{ env.ORIGIN_BRANCH }} + finish-cygwin-rebase: + needs: [build] + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + path: ${{ github.workspace }} + + - name: Checkout Cygwin + uses: actions/checkout@v4 + with: + token: ${{ secrets.GNU_PUSH_PAT }} + repository: ${{ env.CYGWIN_REPO }} + ref: ${{ env.ORIGIN_BRANCH }} + path: ${{ env.SOURCE_PATH }}/cygwin + + - name: Finish Cygwin rebase + working-directory: ${{ env.SOURCE_PATH }}/cygwin + run: | + ${{ github.workspace }}/.github/scripts/rebase-finish.sh ${{ env.REBASE_BRANCH }} ${{ env.ORIGIN_BRANCH }} + deploy: needs: [build] runs-on: ubuntu-latest diff --git a/patches/cygwin/0003-fix-mingw.patch b/patches/cygwin/0003-fix-mingw.patch new file mode 100644 index 000000000..b0990e8d3 --- /dev/null +++ b/patches/cygwin/0003-fix-mingw.patch @@ -0,0 +1,29 @@ +--- a/winsup/cygwin/local_includes/ntdll.h ++++ b/winsup/cygwin/local_includes/ntdll.h +@@ -489,26 +489,6 @@ typedef struct _FILE_DISPOSITION_INFORMATION_EX // 64 + ULONG Flags; + } FILE_DISPOSITION_INFORMATION_EX, *PFILE_DISPOSITION_INFORMATION_EX; + +-typedef struct _FILE_STAT_INFORMATION // 68 +-{ +- LARGE_INTEGER FileId; +- LARGE_INTEGER CreationTime; +- LARGE_INTEGER LastAccessTime; +- LARGE_INTEGER LastWriteTime; +- LARGE_INTEGER ChangeTime; +- LARGE_INTEGER AllocationSize; +- LARGE_INTEGER EndOfFile; +- ULONG FileAttributes; +- ULONG ReparseTag; +- ULONG NumberOfLinks; +- ACCESS_MASK EffectiveAccess; +-} FILE_STAT_INFORMATION, *PFILE_STAT_INFORMATION; +- +-typedef struct _FILE_CASE_SENSITIVE_INFORMATION // 71 +-{ +- ULONG Flags; +-} FILE_CASE_SENSITIVE_INFORMATION, *PFILE_CASE_SENSITIVE_INFORMATION; +- + enum { + FILE_LINK_REPLACE_IF_EXISTS = 0x01, + FILE_LINK_POSIX_SEMANTICS = 0x02,