From 0ad91ee0ec4f30ba630ab69199ebad31cafd0152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Barto=C5=88?= Date: Tue, 8 Oct 2024 13:17:09 +0200 Subject: [PATCH] Add daily rebase of Cygwin to `rebase.yml` --- .github/scripts/toolchain/patch-cygwin.sh | 2 + .github/workflows/rebase.yml | 48 +++++++++++++++++++++++ patches/cygwin/0003-fix-mingw.patch | 29 ++++++++++++++ 3 files changed, 79 insertions(+) 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/rebase.yml b/.github/workflows/rebase.yml index 9d0a62167..15e21dc39 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,6 +106,29 @@ 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] uses: ./.github/workflows/advanced.yml @@ -181,6 +206,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,