Bootstrap Rust #47
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: Bootstrap Rust | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| curl: | |
| runs-on: windows-latest | |
| outputs: | |
| llvm_version: ${{ steps.build.outputs.llvm_version }} | |
| curl_version: ${{ steps.build.outputs.curl_version }} | |
| steps: | |
| - run: git config --global core.autocrlf input | |
| - uses: dawidd6/action-download-artifact@v10 | |
| with: | |
| workflow: bootstrap_llvm.yml | |
| workflow_conclusion: success | |
| branch: ${{ github.ref_name }} | |
| name: packages | |
| path: pkgs | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: dawidd6/action-download-artifact@v10 | |
| with: | |
| repo: jeremyd2019/cygwin | |
| workflow: cygwin.yml | |
| workflow_conclusion: success | |
| branch: cygwin-3.6.2-posix-spawn | |
| event: push | |
| name: cygwin-install-x86_64 | |
| path: test-cygwin | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - id: cygwin | |
| uses: cygwin/cygwin-install-action@master | |
| with: | |
| site: >- | |
| http://mirrors.kernel.org/sourceware/cygwin/ | |
| file://${{ github.workspace }}/pkgs | |
| check-sig: false | |
| packages: | | |
| cygutils-extra | |
| cmake | |
| calm | |
| cygport | |
| flexdll | |
| gdb | |
| git | |
| make | |
| ninja | |
| ocaml | |
| python3 | |
| libxml2-devel | |
| zlib-devel | |
| libzstd-devel | |
| vim | |
| python39-sphinx | |
| python39-pytz | |
| libcurl-devel | |
| libpcre2-devel | |
| libssh2-devel | |
| libssl-devel=3.0.16-2 | |
| libssl3=3.0.16-2 | |
| openssl=3.0.16-2 | |
| - name: update cygwin | |
| env: | |
| CHERE_INVOKING: 1 | |
| shell: c:/msys64/usr/bin/bash.exe -leo pipefail '{0}' | |
| run: | | |
| cp -f test-cygwin/bin/cygwin1.dll /d/cygwin/bin/cygwin1.dll | |
| - id: build | |
| name: build | |
| run: | | |
| export PATH=/usr/local/bin:/usr/bin:/bin:$PATH | |
| mv "$(cygpath -u '${{github.workspace}}')/pkgs" . | |
| mkdir -p pkgs/x86_64/release | |
| cat pkgs/llvm_version.txt >> "$GITHUB_OUTPUT" | |
| git clone git://cygwin.com/git/cygwin-packages/curl | |
| cd curl | |
| sed -i -e 's|^PATCH_URI=$|&"https://github.com/curl/curl/commit/7a30481760f1f7bfb7928d0b22d49a5ae263386f.patch"|' curl.cygport | |
| awk -i inplace -F= -v OFS== '$1=="RELEASE" {$2++} 1' curl.cygport | |
| cygport curl.cygport download all-test | |
| echo curl-*.x86_64 | sed -e 's/^curl-\(.*\)\.x86_64$/curl_version=\1/' >> "$GITHUB_OUTPUT" | |
| cp -R curl-*.x86_64/dist/* ../pkgs/x86_64/release | |
| cd ../pkgs | |
| mksetupini --arch x86_64 --inifile=x86_64/setup.ini --releasearea=. --disable-check=missing-required-package,missing-depended-package,missing-build-depended-package,missing-curr | |
| bzip2 <x86_64/setup.ini >x86_64/setup.bz2 | |
| xz -6e <x86_64/setup.ini >x86_64/setup.xz | |
| shell: d:\cygwin\bin\bash.exe -leo pipefail -o igncr '{0}' | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: packages | |
| path: | | |
| ${{steps.cygwin.outputs.root}}/home/runneradmin/pkgs/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cygwin | |
| path: | | |
| test-cygwin/ | |
| cross_rust: | |
| runs-on: windows-latest | |
| needs: curl | |
| steps: | |
| - run: git config --global core.autocrlf input | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: packages | |
| path: pkgs | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: cygwin | |
| path: test-cygwin | |
| - id: msys2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| release: true | |
| update: true | |
| msystem: MINGW64 | |
| install: >- | |
| mingw-w64-x86_64-toolchain | |
| mingw-w64-x86_64-llvm | |
| mingw-w64-x86_64-clang | |
| - id: cygwin | |
| uses: cygwin/cygwin-install-action@master | |
| with: | |
| site: >- | |
| http://mirrors.kernel.org/sourceware/cygwin/ | |
| file://${{ github.workspace }}/pkgs | |
| check-sig: false | |
| packages: | | |
| cygutils-extra | |
| cmake | |
| calm | |
| cygport | |
| flexdll | |
| gdb | |
| git | |
| make | |
| ninja | |
| ocaml | |
| python3 | |
| libxml2-devel | |
| zlib-devel | |
| libzstd-devel | |
| vim | |
| python39-sphinx | |
| python39-pytz | |
| python39-tomli | |
| libgit2_1.9 | |
| libgit2-devel | |
| libssh2-devel | |
| libssl-devel=3.0.16-2 | |
| libssl3=3.0.16-2 | |
| openssl=3.0.16-2 | |
| libcurl-devel=${{needs.curl.outputs.curl_version}} | |
| libcurl4=${{needs.curl.outputs.curl_version}} | |
| libllvm20.1=${{needs.curl.outputs.llvm_version}} | |
| libllvm-devel=${{needs.curl.outputs.llvm_version}} | |
| llvm=${{needs.curl.outputs.llvm_version}} | |
| - name: update cygwin | |
| env: | |
| CHERE_INVOKING: 1 | |
| shell: c:/msys64/usr/bin/bash.exe -leo pipefail '{0}' | |
| run: | | |
| cp -f test-cygwin/bin/cygwin1.dll /d/cygwin/bin/cygwin1.dll | |
| - name: build | |
| run: | | |
| export PATH=/usr/local/bin:/usr/bin:/bin:$PATH | |
| export GITHUB_WORKSPACE="$(cygpath -u '${{github.workspace}}')" | |
| mv "$GITHUB_WORKSPACE/pkgs" . | |
| mkdir -p pkgs/x86_64/release | |
| find "$GITHUB_WORKSPACE/" -maxdepth 1 -type f ! -name .\* -exec cp -t . '{}' + | |
| mkdir bin | |
| gcc -o bin/llvm-config.exe llvm-config-wrapper.c | |
| gcc -o bin/gcc.exe wrapper.c | |
| for b in g++ ar ranlib x86_64-pc-cygwin-gcc curl-config; do | |
| ln bin/gcc.exe bin/${b}.exe | |
| done | |
| RUST_URL="$(python3 -c "import tomli; from urllib.request import urlopen; x = tomli.load(urlopen('https://static.rust-lang.org/dist/channel-rust-nightly.toml')); a = [y for y in x['artifacts']['source-code']['target']['*'] if y['url'].endswith('.xz')]; print(a[0]['url'])")" | |
| echo "$RUST_URL" | tee rust-url.txt | |
| curl -LO "$RUST_URL" | |
| tar -Jxf rustc-nightly-src.tar.xz | |
| cd rustc-nightly-src | |
| MSYS2_ROOT="$(cygpath -m '${{ steps.msys2.outputs.msys2-location }}')" WORKSPACE="$(cygpath -ma "$HOME/bin")" envsubst < ../bootstrap.toml > bootstrap.toml | |
| export PATH="$HOME/bin:$(cygpath -u '${{ steps.msys2.outputs.msys2-location }}')/mingw64/bin:$PATH" | |
| PKG_CONFIG_SYSROOT_DIR="$(cygpath -w /)" \ | |
| PKG_CONFIG="$(cygpath -w /usr/bin/pkgconf.exe)" \ | |
| LIBGIT2_NO_VENDOR=1 \ | |
| OPENSSL_DIR="$(cygpath -w /usr)" \ | |
| OPENSSL_LIB_DIR="$(cygpath -w /usr/lib)" \ | |
| OPENSSL_STATIC=0 \ | |
| DESTDIR="$(cygpath -w "$PWD/build-Cygwin/dest-rust")" \ | |
| python x.py install --stage 2 | |
| cd build-Cygwin/dest-rust && tar -Jcf ~/rust-prefix.tar.xz * | |
| shell: d:\cygwin\bin\bash.exe -leo pipefail -o igncr '{0}' | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: rust-prefix | |
| path: | | |
| ${{steps.cygwin.outputs.root}}/home/runneradmin/rust-url.txt | |
| ${{steps.cygwin.outputs.root}}/home/runneradmin/rust-prefix.tar.xz | |
| ${{steps.cygwin.outputs.root}}/home/runneradmin/rustc-nightly-src.tar.xz | |
| native_rust: | |
| runs-on: windows-latest | |
| needs: [curl, cross_rust] | |
| steps: | |
| - run: git config --global core.autocrlf input | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: packages | |
| path: pkgs | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: cygwin | |
| path: test-cygwin | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: rust-prefix | |
| path: rust-prefix | |
| - id: cygwin | |
| uses: cygwin/cygwin-install-action@master | |
| with: | |
| site: >- | |
| http://mirrors.kernel.org/sourceware/cygwin/ | |
| file://${{ github.workspace }}/pkgs | |
| check-sig: false | |
| packages: | | |
| cygutils-extra | |
| cmake | |
| calm | |
| cygport | |
| flexdll | |
| gdb | |
| git | |
| make | |
| ninja | |
| ocaml | |
| python3 | |
| libxml2-devel | |
| zlib-devel | |
| libzstd-devel | |
| vim | |
| python39-sphinx | |
| python39-pytz | |
| python39-tomli | |
| libgit2_1.9 | |
| libgit2-devel | |
| libssh2-devel | |
| libssl-devel=3.0.16-2 | |
| libssl3=3.0.16-2 | |
| openssl=3.0.16-2 | |
| libcurl-devel=${{needs.curl.outputs.curl_version}} | |
| libcurl4=${{needs.curl.outputs.curl_version}} | |
| libllvm20.1=${{needs.curl.outputs.llvm_version}} | |
| libllvm-devel=${{needs.curl.outputs.llvm_version}} | |
| llvm=${{needs.curl.outputs.llvm_version}} | |
| - name: update cygwin | |
| env: | |
| CHERE_INVOKING: 1 | |
| shell: c:/msys64/usr/bin/bash.exe -leo pipefail '{0}' | |
| run: | | |
| cp -f test-cygwin/bin/cygwin1.dll /d/cygwin/bin/cygwin1.dll | |
| - name: build | |
| run: | | |
| export PATH=/usr/local/bin:/usr/bin:/bin:$PATH | |
| export GITHUB_WORKSPACE="$(cygpath -u '${{github.workspace}}')" | |
| mv "$GITHUB_WORKSPACE/pkgs" . | |
| mkdir -p pkgs/x86_64/release | |
| cp "$GITHUB_WORKSPACE/rust-prefix/rust-url.txt" . | |
| (cd / && tar -Jxvf "$GITHUB_WORKSPACE/rust-prefix/rust-prefix.tar.xz" | grep -E -- '^usr/bin/[^/]+-[0-9a-f]{16}.dll$' | grep -v rustc_driver | xargs rm) | |
| rebase -s /usr/bin/rustc_driver*.dll | |
| tar -Jxf "$GITHUB_WORKSPACE/rust-prefix/rustc-nightly-src.tar.xz" | |
| cd rustc-nightly-src | |
| cp "$GITHUB_WORKSPACE/bootstrap-native.toml" bootstrap.toml | |
| LIBGIT2_NO_VENDOR=1 \ | |
| OPENSSL_STATIC=0 \ | |
| DESTDIR="$PWD/build-Cygwin/dest-rust" \ | |
| python3 x.py install --stage 2 | |
| cd build-Cygwin/dest-rust && tar -Jcf ~/rust-prefix.tar.xz * | |
| shell: d:\cygwin\bin\bash.exe -leo pipefail -o igncr '{0}' | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: rust-prefix | |
| overwrite: true | |
| path: | | |
| ${{steps.cygwin.outputs.root}}/home/runneradmin/rust-url.txt | |
| ${{steps.cygwin.outputs.root}}/home/runneradmin/rust-prefix.tar.xz |