Skip to content

Commit

Permalink
Update cc crate to 1.0.40
Browse files Browse the repository at this point in the history
This change updates the cc crate to version 1.0.40.

Import subrepo cc/:cc at 6ad3da7558ec3ccb4dc9c2ed1487fc139469d41e
  • Loading branch information
d-e-s-o committed Aug 15, 2019
1 parent 155f9b7 commit b766d58
Show file tree
Hide file tree
Showing 13 changed files with 274 additions and 168 deletions.
2 changes: 1 addition & 1 deletion cc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cc"
version = "1.0.37"
version = "1.0.40"
authors = ["Alex Crichton <[email protected]>"]
license = "MIT/Apache-2.0"
repository = "https://github.com/alexcrichton/cc-rs"
Expand Down
4 changes: 4 additions & 0 deletions cc/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Note for forks: Azure Pipelines is triggered only by commits to the branches
# matching the patterns below.
# See https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers
trigger:
- master
- ci-*

jobs:
- job: min_linux
Expand Down
28 changes: 21 additions & 7 deletions cc/ci/azure-install-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,30 @@ steps:
if [ "$toolchain" = "" ]; then
toolchain=stable
fi
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $toolchain
echo "##vso[task.prependpath]$HOME/.cargo/bin"
if command -v rustup; then
rustup update $toolchain
rustup default $toolchain
else
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $toolchain
echo "##vso[task.prependpath]$HOME/.cargo/bin"
fi
displayName: Install rust (unix)
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
IF "%TOOLCHAIN%"=="" (SET TOOLCHAIN=stable-%TARGET%)
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %TOOLCHAIN%
echo ##vso[task.prependpath]%USERPROFILE%\.cargo\bin
- bash: |
set -e
toolchain=$TOOLCHAIN
if [ "$toolchain" = "" ]; then
toolchain=stable-$TARGET
fi
if command -v rustup; then
rustup update --no-self-update $toolchain
rustup default $toolchain
else
curl.exe -sSf -o rustup-init.exe https://win.rustup.rs
./rustup-init.exe -y --default-toolchain $toolchain
echo "##vso[task.prependpath]$USERPROFILE/.cargo/bin"
fi
displayName: Install rust (windows)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
Expand Down
11 changes: 9 additions & 2 deletions cc/ci/azure-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@ steps:
- bash: rustup target add $TARGET
displayName: Install Rust target

# Remove the ubuntu-toolchain-r/test PPA, which is added by default. Some
# packages were removed, and this is causing the g++multilib install to fail.
# Similar issue: https://github.com/scikit-learn/scikit-learn/issues/13928
- bash: sudo add-apt-repository --remove ppa:ubuntu-toolchain-r/test
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: Remove ppa:ubuntu-toolchain-r/test

- bash: sudo apt-get install g++-multilib
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: Install g++-multilib

- script: cargo build
displayName: "Normal build"
- bash: cargo test $NO_RUN -- --test-threads 1
- bash: cargo test $NO_RUN
displayName: "Crate tests"
- bash: cargo test $NO_RUN --features parallel -- --test-threads 1
- bash: cargo test $NO_RUN --features parallel
displayName: "Crate tests (parallel)"
- bash: cargo test $NO_RUN --manifest-path cc-test/Cargo.toml --target $TARGET
displayName: "cc-test tests"
Expand Down
39 changes: 32 additions & 7 deletions cc/src/bin/gcc-shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,43 @@ use std::io::prelude::*;
use std::path::PathBuf;

fn main() {
let out_dir = PathBuf::from(env::var_os("GCCTEST_OUT_DIR").unwrap());
let mut args = env::args();
let program = args.next().expect("Unexpected empty args");

let out_dir = PathBuf::from(
env::var_os("GCCTEST_OUT_DIR").expect(&format!("{}: GCCTEST_OUT_DIR not found", program)),
);

// Find the first nonexistent candidate file to which the program's args can be written.
for i in 0.. {
let candidate = out_dir.join(format!("out{}", i));
let candidate = &out_dir.join(format!("out{}", i));

// If the file exists, commands have already run. Try again.
if candidate.exists() {
continue;
}
let mut f = File::create(candidate).unwrap();
for arg in env::args().skip(1) {
writeln!(f, "{}", arg).unwrap();
}

File::create(out_dir.join("libfoo.a")).unwrap();
// Create a file and record the args passed to the command.
let mut f = File::create(candidate).expect(&format!(
"{}: can't create candidate: {}",
program,
candidate.to_string_lossy()
));
for arg in args {
writeln!(f, "{}", arg).expect(&format!(
"{}: can't write to candidate: {}",
program,
candidate.to_string_lossy()
));
}
break;
}

// Create a file used by some tests.
let path = &out_dir.join("libfoo.a");
File::create(path).expect(&format!(
"{}: can't create libfoo.a: {}",
program,
path.to_string_lossy()
));
}
Loading

0 comments on commit b766d58

Please sign in to comment.