Skip to content

Commit 4b63f47

Browse files
authored
Rollup merge of rust-lang#40482 - wagenet:fix-old-macos, r=alexcrichton
Target builds for older macOS Fix rust-lang#40481
2 parents 457b440 + 61d9387 commit 4b63f47

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ matrix:
4848
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
4949
SCCACHE_ERROR_LOG=/tmp/sccache.log
5050
RUST_LOG=sccache=debug
51+
MACOSX_DEPLOYMENT_TARGET=10.8
52+
MACOSX_STD_DEPLOYMENT_TARGET=10.7
5153
os: osx
5254
osx_image: xcode8.2
5355
install: &osx_install_sccache >
@@ -60,6 +62,8 @@ matrix:
6062
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
6163
SCCACHE_ERROR_LOG=/tmp/sccache.log
6264
RUST_LOG=sccache=debug
65+
MACOSX_DEPLOYMENT_TARGET=10.8
66+
MACOSX_STD_DEPLOYMENT_TARGET=10.7
6367
os: osx
6468
osx_image: xcode8.2
6569
install: *osx_install_sccache
@@ -72,6 +76,8 @@ matrix:
7276
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
7377
SCCACHE_ERROR_LOG=/tmp/sccache.log
7478
RUST_LOG=sccache=debug
79+
MACOSX_DEPLOYMENT_TARGET=10.8
80+
MACOSX_STD_DEPLOYMENT_TARGET=10.7
7581
os: osx
7682
osx_image: xcode8.2
7783
install: >
@@ -85,6 +91,8 @@ matrix:
8591
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
8692
SCCACHE_ERROR_LOG=/tmp/sccache.log
8793
RUST_LOG=sccache=debug
94+
MACOSX_DEPLOYMENT_TARGET=10.8
95+
MACOSX_STD_DEPLOYMENT_TARGET=10.7
8896
os: osx
8997
osx_image: xcode8.2
9098
install: *osx_install_sccache
@@ -102,6 +110,8 @@ matrix:
102110
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
103111
SCCACHE_ERROR_LOG=/tmp/sccache.log
104112
RUST_LOG=sccache=debug
113+
MACOSX_DEPLOYMENT_TARGET=10.8
114+
MACOSX_STD_DEPLOYMENT_TARGET=10.7
105115
os: osx
106116
osx_image: xcode8.2
107117
install: *osx_install_sccache

src/bootstrap/compile.rs

+9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::collections::HashMap;
2020
use std::fs::{self, File};
2121
use std::path::{Path, PathBuf};
2222
use std::process::Command;
23+
use std::env;
2324

2425
use build_helper::{output, mtime, up_to_date};
2526
use filetime::FileTime;
@@ -44,6 +45,11 @@ pub fn std(build: &Build, target: &str, compiler: &Compiler) {
4445
build.clear_if_dirty(&out_dir, &build.compiler_path(compiler));
4546
let mut cargo = build.cargo(compiler, Mode::Libstd, target, "build");
4647
let mut features = build.std_features();
48+
49+
if let Ok(target) = env::var("MACOSX_STD_DEPLOYMENT_TARGET") {
50+
cargo.env("MACOSX_DEPLOYMENT_TARGET", target);
51+
}
52+
4753
// When doing a local rebuild we tell cargo that we're stage1 rather than
4854
// stage0. This works fine if the local rust and being-built rust have the
4955
// 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) {
170176
let out_dir = build.cargo_out(compiler, Mode::Libtest, target);
171177
build.clear_if_dirty(&out_dir, &libstd_stamp(build, compiler, target));
172178
let mut cargo = build.cargo(compiler, Mode::Libtest, target, "build");
179+
if let Ok(target) = env::var("MACOSX_STD_DEPLOYMENT_TARGET") {
180+
cargo.env("MACOSX_DEPLOYMENT_TARGET", target);
181+
}
173182
cargo.arg("--manifest-path")
174183
.arg(build.src.join("src/libtest/Cargo.toml"));
175184
build.run(&mut cargo);

0 commit comments

Comments
 (0)