Skip to content

Commit 9f153e9

Browse files
committed
Patch mingw libraries for windows gnu targets
1 parent d4bb00a commit 9f153e9

File tree

5 files changed

+50
-29
lines changed

5 files changed

+50
-29
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ documentation = "http://doc.rust-lang.org/libc"
1010
keywords = ["libc", "ffi", "bindings", "operating", "system" ]
1111
categories = ["external-ffi-bindings", "no-std", "os"]
1212
build = "build.rs"
13-
exclude = ["/ci/*", "/.travis.yml", "/appveyor.yml"]
13+
exclude = ["/ci/*", "/azure-pipelines.yml"]
1414
description = """
1515
Raw FFI bindings to platform libraries like libc.
1616
"""

azure-pipelines.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
trigger:
2-
- master
1+
variables:
2+
- group: secrets
3+
resources:
4+
repositories:
5+
- repository: rustinfra
6+
type: github
7+
name: rust-lang/simpleinfra
8+
endpoint: rust-lang
9+
trigger: ["master"]
10+
pr: ["master"]
311

412
jobs:
513
- job: DockerLinux
@@ -99,13 +107,13 @@ jobs:
99107
matrix:
100108
x86_64-pc-windows-gnu:
101109
TARGET: x86_64-pc-windows-gnu
102-
MSYS_BITS: 64
110+
ARCH_BITS: 64
103111
ARCH: x86_64
104112
x86_64-pc-windows-msvc:
105113
TARGET: x86_64-pc-windows-msvc
106114
i686-pc-windows-gnu:
107115
TARGET: i686-pc-windows-gnu
108-
MSYS_BITS: 32
116+
ARCH_BITS: 32
109117
ARCH: i686
110118
i686-pc-windows-msvc:
111119
TARGET: i686-pc-windows-msvc
@@ -118,7 +126,10 @@ jobs:
118126
- script: sh ci/style.sh
119127
displayName: Check style
120128
- script: sh ci/dox.sh
121-
displayName: Generate and upload documentation
129+
displayName: Generate documentation
130+
- template: azure-configs/static-websites.yml@rustinfra
131+
parameters:
132+
deploy_dir: target/doc
122133

123134
#- job: SemverLinux
124135
# continueOnError: true

ci/README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,12 @@ this project.
88

99
First up, let's talk about the files in this directory:
1010

11-
* `run-travis.sh` - a shell script run by all Travis builders, this is
12-
responsible for setting up the rest of the environment such as installing new
13-
packages, downloading Rust target libraries, etc.
11+
* `run-docker.sh` - a shell script run by most builders, it will execute
12+
`run.sh` inside a Docker container configured for the target.
1413

1514
* `run.sh` - the actual script which runs tests for a particular architecture.
16-
Called from the `run-travis.sh` script this will run all tests for the target
17-
specified.
1815

19-
* `cargo-config` - Cargo configuration of linkers to use copied into place by
20-
the `run-travis.sh` script before builds are run.
21-
22-
* `dox.sh` - script called from `run-travis.sh` on only the linux 64-bit nightly
23-
Travis bots to build documentation for this crate.
16+
* `dox.sh` - build the documentation of the crate and publish it to gh-pages.
2417

2518
* `landing-page-*.html` - used by `dox.sh` to generate a landing page for all
2619
architectures' documentation.

ci/azure-install-rust.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ steps:
1515
displayName: Install rust (unix)
1616
condition: ne( variables['Agent.OS'], 'Windows_NT' )
1717
- script: |
18+
@echo on
1819
if not defined TOOLCHAIN set TOOLCHAIN=nightly
19-
rustup update %TOOLCHAIN%
20-
rustup default %TOOLCHAIN%
20+
rustup update %TOOLCHAIN%-%TARGET%
21+
rustup default %TOOLCHAIN%-%TARGET%
2122
displayName: Install rust (windows)
2223
condition: eq( variables['Agent.OS'], 'Windows_NT' )
2324
- script: |
@@ -27,13 +28,31 @@ steps:
2728
fi
2829
condition: ne( variables['Agent.OS'], 'Windows_NT' )
2930
displayName: Install target (unix)
30-
- script: if defined TARGET rustup target add %TARGET%
31+
- script: |
32+
@echo on
33+
if defined TARGET rustup target add %TARGET%
3134
condition: eq( variables['Agent.OS'], 'Windows_NT' )
3235
displayName: Install target (windows)
33-
#- script: if defined MSYS_BITS for %%I in (crt2.o dllcrt2.o libmsvcrt.a) do xcopy /Y "C:\msys64\mingw%MSYS_BITS%\%ARCH%-w64-mingw32\lib\%%I" "C:\Program Files (x86)\Rust\lib\rustlib\%TARGET%\lib"
34-
# condition: eq( variables['Agent.OS'], 'Windows_NT' )
35-
# displayName: Fix MinGW (windows)
3636
- script: |
37+
@echo on
38+
if "%ARCH%" == "i686" choco install mingw --x86 --force
39+
condition: eq( variables['Agent.OS'], 'Windows_NT' )
40+
displayName: Install MinGW32 (windows)
41+
- bash: |
42+
set -ex
43+
gcc -print-search-dirs
44+
find "C:\ProgramData\Chocolatey" -name "crt2*"
45+
find "C:\ProgramData\Chocolatey" -name "dllcrt2*"
46+
find "C:\ProgramData\Chocolatey" -name "libmsvcrt*"
47+
condition: eq( variables['Agent.OS'], 'Windows_NT' )
48+
displayName: Find GCC libraries (windows)
49+
- script: |
50+
@echo on
51+
if not defined TOOLCHAIN set TOOLCHAIN=nightly
52+
if defined ARCH_BITS for %%I in (crt2.o dllcrt2.o libmsvcrt.a) do xcopy /Y "C:\ProgramData\Chocolatey\lib\mingw\tools\install\mingw%ARCH_BITS%\%ARCH%-w64-mingw32\lib\%%I" "C:\Program Files\Rust\.rustup\toolchains\%TOOLCHAIN%-%TARGET%\lib\rustlib\%TARGET%\lib\%%I"
53+
condition: eq( variables['Agent.OS'], 'Windows_NT' )
54+
displayName: Fix MinGW (windows)
55+
- bash: |
3756
set -ex
3857
rustc -Vv
3958
cargo -V
@@ -44,6 +63,11 @@ steps:
4463
which rustup
4564
displayName: Query rust and cargo versions
4665
- script: |
66+
@echo on
67+
where gcc
68+
condition: eq( variables['Agent.OS'], 'Windows_NT' )
69+
displayName: Query gcc path
70+
- bash: |
4771
set -ex
4872
cargo generate-lockfile
4973
cargo generate-lockfile --manifest-path libc-test/Cargo.toml

ci/dox.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,3 @@ set -x
6969

7070
# Copy the licenses
7171
cp LICENSE-* $TARGET_DOC_DIR/
72-
73-
# If we're on travis, not a PR, and on the right branch, publish!
74-
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
75-
pip install ghp_import --install-option="--prefix=$HOME/.local"
76-
"${HOME}/.local/bin/ghp-import" $TARGET_DOC_DIR
77-
git push -qf "https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git" gh-pages
78-
fi

0 commit comments

Comments
 (0)