Target builds for older macOS

This commit is contained in:
Peter Wagenet 2017-03-13 11:36:44 -07:00
parent a5483a7f36
commit 61d93877b7
2 changed files with 19 additions and 0 deletions

View File

@ -48,6 +48,8 @@ matrix:
RUSTC_RETRY_LINKER_ON_SEGFAULT=1 RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log SCCACHE_ERROR_LOG=/tmp/sccache.log
RUST_LOG=sccache=debug RUST_LOG=sccache=debug
MACOSX_DEPLOYMENT_TARGET=10.8
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx os: osx
osx_image: xcode8.2 osx_image: xcode8.2
install: &osx_install_sccache > install: &osx_install_sccache >
@ -60,6 +62,8 @@ matrix:
RUSTC_RETRY_LINKER_ON_SEGFAULT=1 RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log SCCACHE_ERROR_LOG=/tmp/sccache.log
RUST_LOG=sccache=debug RUST_LOG=sccache=debug
MACOSX_DEPLOYMENT_TARGET=10.8
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx os: osx
osx_image: xcode8.2 osx_image: xcode8.2
install: *osx_install_sccache install: *osx_install_sccache
@ -72,6 +76,8 @@ matrix:
RUSTC_RETRY_LINKER_ON_SEGFAULT=1 RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log SCCACHE_ERROR_LOG=/tmp/sccache.log
RUST_LOG=sccache=debug RUST_LOG=sccache=debug
MACOSX_DEPLOYMENT_TARGET=10.8
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx os: osx
osx_image: xcode8.2 osx_image: xcode8.2
install: > install: >
@ -85,6 +91,8 @@ matrix:
RUSTC_RETRY_LINKER_ON_SEGFAULT=1 RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log SCCACHE_ERROR_LOG=/tmp/sccache.log
RUST_LOG=sccache=debug RUST_LOG=sccache=debug
MACOSX_DEPLOYMENT_TARGET=10.8
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx os: osx
osx_image: xcode8.2 osx_image: xcode8.2
install: *osx_install_sccache install: *osx_install_sccache
@ -102,6 +110,8 @@ matrix:
RUSTC_RETRY_LINKER_ON_SEGFAULT=1 RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log SCCACHE_ERROR_LOG=/tmp/sccache.log
RUST_LOG=sccache=debug RUST_LOG=sccache=debug
MACOSX_DEPLOYMENT_TARGET=10.8
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx os: osx
osx_image: xcode8.2 osx_image: xcode8.2
install: *osx_install_sccache install: *osx_install_sccache

View File

@ -20,6 +20,7 @@ use std::collections::HashMap;
use std::fs::{self, File}; use std::fs::{self, File};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::Command; use std::process::Command;
use std::env;
use build_helper::{output, mtime, up_to_date}; use build_helper::{output, mtime, up_to_date};
use filetime::FileTime; use filetime::FileTime;
@ -44,6 +45,11 @@ pub fn std(build: &Build, target: &str, compiler: &Compiler) {
build.clear_if_dirty(&out_dir, &build.compiler_path(compiler)); build.clear_if_dirty(&out_dir, &build.compiler_path(compiler));
let mut cargo = build.cargo(compiler, Mode::Libstd, target, "build"); let mut cargo = build.cargo(compiler, Mode::Libstd, target, "build");
let mut features = build.std_features(); let mut features = build.std_features();
if let Ok(target) = env::var("MACOSX_STD_DEPLOYMENT_TARGET") {
cargo.env("MACOSX_DEPLOYMENT_TARGET", target);
}
// When doing a local rebuild we tell cargo that we're stage1 rather than // When doing a local rebuild we tell cargo that we're stage1 rather than
// stage0. This works fine if the local rust and being-built rust have the // stage0. This works fine if the local rust and being-built rust have the
// same view of what the default allocator is, but fails otherwise. Since // same view of what the default allocator is, but fails otherwise. Since
@ -170,6 +176,9 @@ pub fn test(build: &Build, target: &str, compiler: &Compiler) {
let out_dir = build.cargo_out(compiler, Mode::Libtest, target); let out_dir = build.cargo_out(compiler, Mode::Libtest, target);
build.clear_if_dirty(&out_dir, &libstd_stamp(build, compiler, target)); build.clear_if_dirty(&out_dir, &libstd_stamp(build, compiler, target));
let mut cargo = build.cargo(compiler, Mode::Libtest, target, "build"); let mut cargo = build.cargo(compiler, Mode::Libtest, target, "build");
if let Ok(target) = env::var("MACOSX_STD_DEPLOYMENT_TARGET") {
cargo.env("MACOSX_DEPLOYMENT_TARGET", target);
}
cargo.arg("--manifest-path") cargo.arg("--manifest-path")
.arg(build.src.join("src/libtest/Cargo.toml")); .arg(build.src.join("src/libtest/Cargo.toml"));
build.run(&mut cargo); build.run(&mut cargo);