Skip to content

Commit

Permalink
Fix OSX builders on CI
Browse files Browse the repository at this point in the history
Looks like Travis has moved on from our old images, so we're forced to
update.
  • Loading branch information
alexcrichton committed Jul 31, 2018
1 parent e1ebfaf commit e105f37
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ matrix:
- env: TARGET=i686-unknown-linux-gnu
- os: osx
env: TARGET=x86_64-apple-darwin NO_ADD=1
osx_image: xcode8.3
osx_image: xcode9.4
- os: osx
env: TARGET=i686-apple-darwin
osx_image: xcode8.3
osx_image: xcode9.4
- env: TARGET=arm-linux-androideabi
- env: TARGET=aarch64-linux-android
# FIXME(#826) should reenable
Expand All @@ -59,14 +59,14 @@ matrix:
# FIXME(#856)
rust: 1.22.1
- os: osx
osx_image: xcode8.2
osx_image: xcode9.4
env: TARGET=i386-apple-ios
CARGO_TARGET_I386_APPLE_IOS_RUNNER=$HOME/runtest
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
before_install:
rustc ./ci/ios/deploy_and_run_on_ios_simulator.rs -o $HOME/runtest
- os: osx
osx_image: xcode8.2
osx_image: xcode9.4
env: TARGET=x86_64-apple-ios
CARGO_TARGET_X86_64_APPLE_IOS_RUNNER=$HOME/runtest
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
Expand Down
65 changes: 55 additions & 10 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fn main() {
let linux = target.contains("unknown-linux");
let android = target.contains("android");
let apple = target.contains("apple");
let ios = target.contains("apple-ios");
let emscripten = target.contains("asm");
let musl = target.contains("musl") || emscripten;
let uclibc = target.contains("uclibc");
Expand Down Expand Up @@ -84,8 +85,10 @@ fn main() {
cfg.header("sys/socket.h");
}
cfg.header("net/if.h");
cfg.header("net/route.h");
cfg.header("net/if_arp.h");
if !ios {
cfg.header("net/route.h");
cfg.header("net/if_arp.h");
}
cfg.header("netdb.h");
cfg.header("netinet/in.h");
cfg.header("netinet/ip.h");
Expand Down Expand Up @@ -113,7 +116,7 @@ fn main() {
cfg.header("pwd.h");
cfg.header("grp.h");
cfg.header("sys/utsname.h");
if !solaris {
if !solaris && !ios {
cfg.header("sys/ptrace.h");
}
cfg.header("sys/mount.h");
Expand Down Expand Up @@ -175,19 +178,22 @@ fn main() {
cfg.header("util.h");
cfg.header("xlocale.h");
cfg.header("sys/xattr.h");
cfg.header("sys/sys_domain.h");
cfg.header("net/if_utun.h");
cfg.header("net/bpf.h");
if target.starts_with("x86") {
cfg.header("crt_externs.h");
}
cfg.header("net/route.h");
cfg.header("netinet/if_ether.h");
cfg.header("netinet/in.h");
cfg.header("sys/proc_info.h");
cfg.header("sys/kern_control.h");
cfg.header("sys/ipc.h");
cfg.header("sys/shm.h");

if !ios {
cfg.header("sys/sys_domain.h");
cfg.header("net/if_utun.h");
cfg.header("net/bpf.h");
cfg.header("net/route.h");
cfg.header("netinet/if_ether.h");
cfg.header("sys/proc_info.h");
cfg.header("sys/kern_control.h");
}
}

if bsdlike {
Expand Down Expand Up @@ -449,6 +455,17 @@ fn main() {
// header conflicts when including them with all the other structs.
"termios2" => true,

// Present on historical versions of iOS but missing in more recent
// SDKs
"bpf_hdr" |
"proc_taskinfo" |
"proc_taskallinfo" |
"proc_bsdinfo" |
"proc_threadinfo" |
"sockaddr_inarp" |
"sockaddr_ctl" |
"arphdr" if ios => true,

_ => false
}
});
Expand Down Expand Up @@ -594,6 +611,30 @@ fn main() {
// shouldn't be used in code anyway...
"AF_MAX" | "PF_MAX" => true,

// Present on historical versions of iOS, but now removed in more
// recent SDKs
"ARPOP_REQUEST" |
"ARPOP_REPLY" |
"ATF_COM" |
"ATF_PERM" |
"ATF_PUBL" |
"ATF_USETRAILERS" |
"AF_SYS_CONTROL" |
"SYSPROTO_EVENT" |
"PROC_PIDTASKALLINFO" |
"PROC_PIDTASKINFO" |
"PROC_PIDTHREADINFO" |
"UTUN_OPT_FLAGS" |
"UTUN_OPT_IFNAME" |
"BPF_ALIGNMENT" |
"SYSPROTO_CONTROL" if ios => true,
s if ios && s.starts_with("RTF_") => true,
s if ios && s.starts_with("RTM_") => true,
s if ios && s.starts_with("RTA_") => true,
s if ios && s.starts_with("RTAX_") => true,
s if ios && s.starts_with("RTV_") => true,
s if ios && s.starts_with("DLT_") => true,

_ => false,
}
});
Expand Down Expand Up @@ -736,6 +777,10 @@ fn main() {
// FIXME: mincore is defined with caddr_t on Solaris.
"mincore" if solaris => true,

// These were all included in historical versions of iOS but appear
// to be removed now
"system" | "ptrace" if ios => true,

_ => false,
}
});
Expand Down
12 changes: 2 additions & 10 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,16 +765,8 @@ pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000;
pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000;
pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000;
pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000;
pub const VM_FLAGS_USER_ALLOCATE: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE |
VM_FLAGS_PURGABLE |
VM_FLAGS_RANDOM_ADDR |
VM_FLAGS_NO_CACHE |
VM_FLAGS_OVERWRITE |
VM_FLAGS_SUPERPAGE_MASK |
VM_FLAGS_ALIAS_MASK;
pub const VM_FLAGS_USER_MAP: ::c_int = VM_FLAGS_USER_ALLOCATE |
VM_FLAGS_RETURN_4K_DATA_ADDR |
VM_FLAGS_RETURN_DATA_ADDR;
pub const VM_FLAGS_USER_ALLOCATE: ::c_int = 0xff07401f;
pub const VM_FLAGS_USER_MAP: ::c_int = 0xff97401f;
pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE |
VM_FLAGS_RANDOM_ADDR |
VM_FLAGS_OVERWRITE |
Expand Down
1 change: 1 addition & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ extern {
pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
pub fn closelog();
pub fn setlogmask(maskpri: ::c_int) -> ::c_int;
#[cfg_attr(target_os = "macos", link_name = "syslog$DARWIN_EXTSN")]
pub fn syslog(priority: ::c_int, message: *const ::c_char, ...);
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "nice$UNIX2003")]
Expand Down

0 comments on commit e105f37

Please sign in to comment.