-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #121182 - majaha:mingw_ci_new, r=Mark-Simulacrum
Improvements to building and CI for mingw/msys I was getting error messages when trying to follow the build instructions the mingw build for Rust, and managed to track the issue down to an incomparability of Rust's bootstrap program with MSYS2's version of git. Essentially, the problem is that MSYS2's git works in emulated unix-y paths, but bootstrap expects a Windows path. I found a workaround for this by using relative paths instead of absolute paths. Along with that fix, this PR also updates the build instructions for MinGW to be compatible with modern versions of MSYS2, and some changes to CI to make sure that MSYS2's version of git is tested. In particular, I'm suggesting using the [MSYS2 github action](https://github.com/marketplace/actions/setup-msys2) specially made for this purpose, which is much less hacky than the old approach and gives us more control of what packages are installed. I also cleaned up as many alternate versions of key tools as I could find from PATH, to avoid accidental usage, and cleaned up some abuses of the `CUSTOM_MINGW` environment variable. This fixes #105696 and fixes #117567
- Loading branch information
Showing
9 changed files
with
132 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,9 +65,20 @@ jobs: | |
- name: x86_64-gnu-tools | ||
os: ubuntu-20.04-16core-64gb | ||
env: {} | ||
defaults: | ||
run: | ||
shell: "${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}" | ||
timeout-minutes: 600 | ||
runs-on: "${{ matrix.os }}" | ||
steps: | ||
- if: "contains(matrix.os, 'windows')" | ||
uses: msys2/[email protected] | ||
with: | ||
msystem: "${{ contains(matrix.name, 'i686') && 'mingw32' || 'mingw64' }}" | ||
update: false | ||
release: true | ||
path-type: inherit | ||
install: "make dos2unix diffutils\n" | ||
- name: disable git crlf conversion | ||
run: git config --global core.autocrlf false | ||
- name: checkout the source code | ||
|
@@ -461,9 +472,20 @@ jobs: | |
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-extended --enable-profiler" | ||
SCRIPT: python x.py dist bootstrap --include-default-paths | ||
os: windows-2019-8core-32gb | ||
defaults: | ||
run: | ||
shell: "${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}" | ||
timeout-minutes: 600 | ||
runs-on: "${{ matrix.os }}" | ||
steps: | ||
- if: "contains(matrix.os, 'windows')" | ||
uses: msys2/[email protected] | ||
with: | ||
msystem: "${{ contains(matrix.name, 'i686') && 'mingw32' || 'mingw64' }}" | ||
update: false | ||
release: true | ||
path-type: inherit | ||
install: "make dos2unix diffutils\n" | ||
- name: disable git crlf conversion | ||
run: git config --global core.autocrlf false | ||
- name: checkout the source code | ||
|
@@ -589,9 +611,20 @@ jobs: | |
env: | ||
CODEGEN_BACKENDS: "llvm,cranelift" | ||
os: ubuntu-20.04-16core-64gb | ||
defaults: | ||
run: | ||
shell: "${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}" | ||
timeout-minutes: 600 | ||
runs-on: "${{ matrix.os }}" | ||
steps: | ||
- if: "contains(matrix.os, 'windows')" | ||
uses: msys2/[email protected] | ||
with: | ||
msystem: "${{ contains(matrix.name, 'i686') && 'mingw32' || 'mingw64' }}" | ||
update: false | ||
release: true | ||
path-type: inherit | ||
install: "make dos2unix diffutils\n" | ||
- name: disable git crlf conversion | ||
run: git config --global core.autocrlf false | ||
- name: checkout the source code | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,10 +111,31 @@ x--expand-yaml-anchors--remove: | |
if: success() && !env.SKIP_JOB | ||
|
||
- &base-ci-job | ||
defaults: | ||
run: | ||
shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }} | ||
timeout-minutes: 600 | ||
runs-on: "${{ matrix.os }}" | ||
env: *shared-ci-variables | ||
steps: | ||
- if: contains(matrix.os, 'windows') | ||
uses: msys2/[email protected] | ||
with: | ||
# i686 jobs use mingw32. x86_64 and cross-compile jobs use mingw64. | ||
msystem: ${{ contains(matrix.name, 'i686') && 'mingw32' || 'mingw64' }} | ||
# don't try to download updates for already installed packages | ||
update: false | ||
# don't try to use the msys that comes built-in to the github runner, | ||
# so we can control what is installed (i.e. not python) | ||
release: true | ||
# Inherit the full path from the Windows environment, with MSYS2's */bin/ | ||
# dirs placed in front. This lets us run Windows-native Python etc. | ||
path-type: inherit | ||
install: > | ||
make | ||
dos2unix | ||
diffutils | ||
- name: disable git crlf conversion | ||
run: git config --global core.autocrlf false | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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