Workarounds for missing -municode support
#543
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: cygwin | |
| on: | |
| push: | |
| # since master is a symbolic reference to main, don't run for both | |
| branches-ignore: | |
| - 'master' | |
| tags: | |
| - '*' | |
| jobs: | |
| fedora-build: | |
| runs-on: ubuntu-latest | |
| container: fedora:latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-pc-cygwin | |
| pkgarch: 64 | |
| name: Fedora cross ${{ matrix.target }} | |
| env: | |
| HAS_SSH_KEY: ${{ secrets.SSH_KEY != '' }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| # install build tools | |
| - name: Install build tools | |
| run: | | |
| dnf install -y autoconf automake gawk make patch perl mingw${{ matrix.pkgarch }}-gcc-c++ mingw${{ matrix.pkgarch }}-winpthreads-static mingw${{ matrix.pkgarch }}-zlib-static | |
| # enable 'dnf copr' | |
| - name: Enable 'dnf copr' | |
| run: | | |
| dnf install -y dnf-plugins-core | |
| # install cross-cygwin toolchain and libs from copr | |
| - name: Install cross-cygwin toolchain and libs and cocom from copr | |
| run: | | |
| dnf copr enable -y yselkowitz/cygwin | |
| dnf install -y cygwin${{ matrix.pkgarch }}-gcc-c++ cygwin${{ matrix.pkgarch }}-gettext cygwin${{ matrix.pkgarch }}-libbfd cygwin${{ matrix.pkgarch }}-libiconv cygwin${{ matrix.pkgarch }}-zlib cocom | |
| # install doc tools | |
| - name: Install doc tools | |
| run: | | |
| dnf install -y dblatex docbook2X docbook-xsl xmlto python3 python3-lxml python3-ply openssh-clients | |
| fmtutil-sys --byfmt pdflatex && texhash | |
| # build | |
| - name: Configure, build and install | |
| run: | | |
| mkdir build install | |
| (cd winsup && ./autogen.sh) | |
| (cd build && ../configure --target=${{ matrix.target }} --prefix=$(realpath $(pwd)/../install) ) | |
| make -C build | |
| make -C build/*/newlib info man | |
| make -C build install | |
| make -C build/*/newlib install-info install-man | |
| # deploy documentation | |
| - name: Deploy documentation | |
| env: | |
| SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
| run: | | |
| # pushes to main are deployed as preview | |
| # pushes to cygwin-n.n.n (but not 'cygwin-n.n.n.dev') tags are deployed as stable | |
| # other references are ignored by this step | |
| case "${{ github.ref }}" in | |
| refs/heads/main) | |
| DEST='preview' | |
| ;; | |
| refs/tags/cygwin-[0-9.]*) | |
| DEST='stable' | |
| ;; | |
| *) | |
| exit 0 | |
| ;; | |
| esac | |
| # unfuck github fuckery of HOME in a container | |
| unset HOME | |
| # add the hosts public key to known_hosts | |
| mkdir -p ~/.ssh/ | |
| echo "cygwin.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKoejTnTCbXaIIMYfbX7t4tYUOQ2bTxZC3e/td3BageF" >> ~/.ssh/known_hosts | |
| # load the key (restricted to scp only) into ssh-agent | |
| ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
| ssh-add - <<< "${{ secrets.SSH_KEY }}" | |
| # 'make install' doesn't install faq, so instead just deploy from build directory | |
| scp -pr build/*/winsup/doc/{cygwin-api,cygwin-ug-net,faq} [email protected]:/sourceware/www/sourceware/htdocs/cygwin/doc/${DEST}/ | |
| if: env.HAS_SSH_KEY == 'true' | |
| windows-build: | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-pc-cygwin | |
| pkgarch: x86_64 | |
| name: Windows native ${{ matrix.pkgarch }} | |
| steps: | |
| # checkout action uses the native git (we can avoid this messing up line | |
| # endings, but this could still be dangerous e.g if we need symlinks in the | |
| # repo) | |
| - run: git config --global core.autocrlf input | |
| # remove inheritable permissions since they break assumptions testsuite | |
| # makes about file modes | |
| - name: adjust permissions | |
| run: | | |
| icacls . /inheritance:r | |
| icacls . /grant Administrators:F | |
| - uses: actions/checkout@v3 | |
| # install cygwin and build tools | |
| - name: Install Cygwin | |
| uses: cygwin/cygwin-install-action@master | |
| with: | |
| platform: ${{ matrix.pkgarch }} | |
| packages: >- | |
| autoconf, | |
| automake, | |
| busybox, | |
| cocom, | |
| cygutils-extra, | |
| dblatex, | |
| dejagnu, | |
| docbook-xml45, | |
| docbook-xsl, | |
| docbook2X, | |
| gcc-g++, | |
| gettext-devel, | |
| libiconv, | |
| libiconv-devel, | |
| libzstd-devel, | |
| make, | |
| mingw64-${{ matrix.pkgarch }}-gcc-g++, | |
| mingw64-${{ matrix.pkgarch }}-zlib, | |
| patch, | |
| perl, | |
| python39-lxml, | |
| python39-ply, | |
| texlive-collection-fontsrecommended, | |
| texlive-collection-latexrecommended, | |
| texlive-collection-pictures, | |
| xmlto, | |
| zlib-devel | |
| # build | |
| - name: Build Cygwin | |
| run: >- | |
| export PATH=/usr/bin:$(cygpath ${SYSTEMROOT})/system32 && | |
| export DESTDIR=$(realpath $(pwd)/install) && | |
| mkdir build install && | |
| (cd winsup; ./autogen.sh) && | |
| cd build && | |
| ../configure --prefix=/usr -v && | |
| export MAKEFLAGS=-j$(nproc) && | |
| make && | |
| export CYGWIN=winsymlinks:sys && | |
| make install -j1 tooldir=/usr gcc_tooldir=/usr DESTDIR=${DESTDIR} && | |
| (cd */newlib; make info man) && | |
| (cd */newlib; make install-info install-man tooldir=/usr gcc_tooldir=/usr DESTDIR=${DESTDIR}) | |
| shell: bash --noprofile --norc -eo pipefail '{0}' | |
| # adjust install so it matches the physical arrangement of directories when | |
| # unpacked by setup | |
| - name: Rearrange for default mountpoints | |
| run: | | |
| mv -v install/usr/bin install/bin | |
| mv -v install/usr/lib install/lib | |
| shell: bash --noprofile --norc -o igncr -eo pipefail '{0}' | |
| # upload installed cygwin as an artifact, for subsequent use in | |
| # test job(s) | |
| - name: Make Cygwin installation artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cygwin-install-${{ matrix.pkgarch }} | |
| path: | | |
| install | |
| # test | |
| - name: Test Cygwin | |
| run: >- | |
| export PATH=/usr/bin:$(cygpath ${SYSTEMROOT})/system32 && | |
| export MAKEFLAGS=-j$(nproc) && | |
| cd build && | |
| (export PATH=${{ matrix.target }}/winsup/testsuite/testinst/bin:${PATH} && cmd /c $(cygpath -wa ${{ matrix.target }}/winsup/cygserver/cygserver) &) && | |
| (cd ${{ matrix.target }}/winsup; make check AM_COLOR_TESTS=always) | |
| shell: bash --noprofile --norc -eo pipefail '{0}' | |
| # upload test logs to facilitate investigation of problems | |
| - name: Upload test logs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: testlogs | |
| path: | | |
| build/${{ matrix.target }}/winsup/testsuite/**/*.log | |
| build/${{ matrix.target }}/winsup/testsuite/**/*.trs | |
| if: ${{ !cancelled() }} | |
| # workaround problems with actions/checkout post-run step using cygwin git | |
| - name: Avoid actions/checkout post-run step using Cygwin git | |
| run: bash -c 'rm /usr/bin/git.exe' | |
| windows-stress-test: | |
| needs: windows-build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - pkgarch: x86_64 | |
| runarch: x86_64 | |
| runner: windows-latest | |
| - pkgarch: x86_64 | |
| runarch: arm64 | |
| runner: windows-11-arm | |
| runs-on: ${{ matrix.runner }} | |
| name: stress tests ${{ matrix.pkgarch }} on ${{ matrix.runarch }} Windows | |
| steps: | |
| - run: git config --global core.autocrlf input | |
| - uses: actions/checkout@v3 | |
| # install cygwin | |
| - name: Install Cygwin | |
| id: cygwin-install | |
| uses: cygwin/cygwin-install-action@master | |
| with: | |
| platform: ${{ matrix.pkgarch }} | |
| packages: | | |
| procps-ng | |
| stress-ng | |
| # fetch the just-built cygwin installation artifact | |
| - name: Unpack just-built Cygwin artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: cygwin-install-${{ matrix.pkgarch }} | |
| # use the install-dir of cygwin-install-action above, so we unpack the | |
| # artifact over it | |
| path: ${{ steps.cygwin-install.outputs.root }} | |
| # This isn't quite right, as it just overwrites existing files, it doesn't | |
| # remove anything which is no longer provided. Ideally, we'd make a cygwin | |
| # package of the just-built cygwin version and install it here, but tools | |
| # don't exist (yet) to let us do that... | |
| # run stress-test | |
| - name: Run stress tests | |
| run: | | |
| export PATH=/usr/bin:$(cygpath ${SYSTEMROOT})/system32 | |
| uname -a | |
| export LOGDIR=$(cygpath -a logs) | |
| winsup/testsuite/stress/cygstress CI | |
| shell: bash --noprofile --norc -o igncr -eo pipefail '{0}' | |
| continue-on-error: ${{ matrix.runarch == 'arm64' }} | |
| # upload logs artifact | |
| - name: Capture logs artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: stress-logs-${{ matrix.pkgarch }}-on-${{ matrix.runarch }} | |
| path: | | |
| logs | |
| if: ${{ !cancelled() }} | |
| windows-stc-regression-test: | |
| needs: windows-build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - pkgarch: x86_64 | |
| runarch: x86_64 | |
| runner: windows-latest | |
| - pkgarch: x86_64 | |
| runarch: arm64 | |
| runner: windows-11-arm | |
| runs-on: ${{ matrix.runner }} | |
| name: stc tests ${{ matrix.pkgarch }} on ${{ matrix.runarch }} Windows | |
| steps: | |
| # install cygwin | |
| - name: Install Cygwin | |
| id: cygwin-install | |
| uses: cygwin/cygwin-install-action@master | |
| with: | |
| platform: ${{ matrix.pkgarch }} | |
| packages: | | |
| gcc-core | |
| git | |
| meson | |
| ninja | |
| # The download-artifact action currently seems to fail with EPERM when it | |
| # tries to unpack over a symlink. Remove the only such instance. | |
| - name: Workaround download-artifact issue | |
| run: | | |
| cd /d ${{ steps.cygwin-install.outputs.root }}\lib | |
| bash -c 'rm libg.a' | |
| shell: cmd | |
| # fetch the just-built cygwin installation artifact | |
| - name: Unpack just-built Cygwin artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: cygwin-install-${{ matrix.pkgarch }} | |
| # use the install-dir of cygwin-install-action above, so we unpack the | |
| # artifact over it | |
| path: ${{ steps.cygwin-install.outputs.root }} | |
| # This isn't quite right, as it just overwrites existing files, it doesn't | |
| # remove anything which is no longer provided. Ideally, we'd make a cygwin | |
| # package of the just-built cygwin version and install it here, but tools | |
| # don't exist (yet) to let us do that... | |
| # fetch and build stc test | |
| - name: Fetch and build stc tests | |
| run: | | |
| export PATH=/usr/bin:$(cygpath ${SYSTEMROOT})/system32 | |
| uname -a | |
| git clone https://cygwin.com/git/cygwin-apps/stc.git --depth 1 | |
| meson setup _build stc | |
| ninja -C _build | |
| shell: bash --noprofile --norc -o igncr -eo pipefail '{0}' | |
| # run stc test | |
| - name: Run stc tests | |
| run: | | |
| export PATH=/usr/bin:$(cygpath ${SYSTEMROOT})/system32 | |
| meson test -C _build | |
| shell: bash --noprofile --norc -o igncr -eo pipefail '{0}' | |
| # upload logs artifact | |
| - name: Capture logs artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: stc-logs-${{ matrix.pkgarch }}-on-${{ matrix.runarch }} | |
| path: | | |
| _build/meson-logs | |
| if: ${{ !cancelled() }} |