Skip to content

Commit 5090477

Browse files
authored
Merge pull request #1051 from alexcrichton/fix-apple
Fix OSX builders on CI
2 parents e1ebfaf + e6bc44b commit 5090477

File tree

5 files changed

+73
-27
lines changed

5 files changed

+73
-27
lines changed

.travis.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ matrix:
4141
- env: TARGET=i686-unknown-linux-gnu
4242
- os: osx
4343
env: TARGET=x86_64-apple-darwin NO_ADD=1
44-
osx_image: xcode8.3
44+
osx_image: xcode9.4
4545
- os: osx
4646
env: TARGET=i686-apple-darwin
47-
osx_image: xcode8.3
47+
osx_image: xcode9.4
4848
- env: TARGET=arm-linux-androideabi
4949
- env: TARGET=aarch64-linux-android
5050
# FIXME(#826) should reenable
@@ -59,14 +59,14 @@ matrix:
5959
# FIXME(#856)
6060
rust: 1.22.1
6161
- os: osx
62-
osx_image: xcode8.2
62+
osx_image: xcode9.4
6363
env: TARGET=i386-apple-ios
6464
CARGO_TARGET_I386_APPLE_IOS_RUNNER=$HOME/runtest
6565
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
6666
before_install:
6767
rustc ./ci/ios/deploy_and_run_on_ios_simulator.rs -o $HOME/runtest
6868
- os: osx
69-
osx_image: xcode8.2
69+
osx_image: xcode9.4
7070
env: TARGET=x86_64-apple-ios
7171
CARGO_TARGET_X86_64_APPLE_IOS_RUNNER=$HOME/runtest
7272
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
@@ -91,15 +91,15 @@ matrix:
9191
rust: beta
9292
- os: osx
9393
env: TARGET=x86_64-apple-darwin NO_ADD=1
94-
osx_image: xcode8.3
94+
osx_image: xcode9.4
9595
rust: beta
9696

9797
# nightly
9898
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
9999
rust: nightly
100100
- os: osx
101101
env: TARGET=x86_64-apple-darwin NO_ADD=1
102-
osx_image: xcode8.3
102+
osx_image: xcode9.4
103103
rust: nightly
104104
# not available on stable
105105
# without --release the build fails
@@ -109,6 +109,13 @@ matrix:
109109

110110
# QEMU based targets that compile in an emulator
111111
- env: TARGET=x86_64-unknown-freebsd
112+
allow_failures:
113+
- env: TARGET=i386-apple-ios
114+
CARGO_TARGET_I386_APPLE_IOS_RUNNER=$HOME/runtest
115+
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
116+
- env: TARGET=x86_64-apple-ios
117+
CARGO_TARGET_X86_64_APPLE_IOS_RUNNER=$HOME/runtest
118+
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
112119

113120
notifications:
114121
email:

ci/ios/deploy_and_run_on_ios_simulator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ fn run_app_on_simulator() {
123123
.arg("com.rust.unittests")
124124
.output());
125125

126+
println!("status: {}", output.status);
126127
println!("stdout --\n{}\n", String::from_utf8_lossy(&output.stdout));
127128
println!("stderr --\n{}\n", String::from_utf8_lossy(&output.stderr));
128129

libc-test/build.rs

Lines changed: 56 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ fn main() {
1515
let linux = target.contains("unknown-linux");
1616
let android = target.contains("android");
1717
let apple = target.contains("apple");
18+
let ios = target.contains("apple-ios");
1819
let emscripten = target.contains("asm");
1920
let musl = target.contains("musl") || emscripten;
2021
let uclibc = target.contains("uclibc");
@@ -84,8 +85,10 @@ fn main() {
8485
cfg.header("sys/socket.h");
8586
}
8687
cfg.header("net/if.h");
87-
cfg.header("net/route.h");
88-
cfg.header("net/if_arp.h");
88+
if !ios {
89+
cfg.header("net/route.h");
90+
cfg.header("net/if_arp.h");
91+
}
8992
cfg.header("netdb.h");
9093
cfg.header("netinet/in.h");
9194
cfg.header("netinet/ip.h");
@@ -113,7 +116,7 @@ fn main() {
113116
cfg.header("pwd.h");
114117
cfg.header("grp.h");
115118
cfg.header("sys/utsname.h");
116-
if !solaris {
119+
if !solaris && !ios {
117120
cfg.header("sys/ptrace.h");
118121
}
119122
cfg.header("sys/mount.h");
@@ -175,19 +178,22 @@ fn main() {
175178
cfg.header("util.h");
176179
cfg.header("xlocale.h");
177180
cfg.header("sys/xattr.h");
178-
cfg.header("sys/sys_domain.h");
179-
cfg.header("net/if_utun.h");
180-
cfg.header("net/bpf.h");
181-
if target.starts_with("x86") {
181+
if target.starts_with("x86") && !ios {
182182
cfg.header("crt_externs.h");
183183
}
184-
cfg.header("net/route.h");
185-
cfg.header("netinet/if_ether.h");
186184
cfg.header("netinet/in.h");
187-
cfg.header("sys/proc_info.h");
188-
cfg.header("sys/kern_control.h");
189185
cfg.header("sys/ipc.h");
190186
cfg.header("sys/shm.h");
187+
188+
if !ios {
189+
cfg.header("sys/sys_domain.h");
190+
cfg.header("net/if_utun.h");
191+
cfg.header("net/bpf.h");
192+
cfg.header("net/route.h");
193+
cfg.header("netinet/if_ether.h");
194+
cfg.header("sys/proc_info.h");
195+
cfg.header("sys/kern_control.h");
196+
}
191197
}
192198

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

458+
// Present on historical versions of iOS but missing in more recent
459+
// SDKs
460+
"bpf_hdr" |
461+
"proc_taskinfo" |
462+
"proc_taskallinfo" |
463+
"proc_bsdinfo" |
464+
"proc_threadinfo" |
465+
"sockaddr_inarp" |
466+
"sockaddr_ctl" |
467+
"arphdr" if ios => true,
468+
452469
_ => false
453470
}
454471
});
@@ -594,6 +611,30 @@ fn main() {
594611
// shouldn't be used in code anyway...
595612
"AF_MAX" | "PF_MAX" => true,
596613

614+
// Present on historical versions of iOS, but now removed in more
615+
// recent SDKs
616+
"ARPOP_REQUEST" |
617+
"ARPOP_REPLY" |
618+
"ATF_COM" |
619+
"ATF_PERM" |
620+
"ATF_PUBL" |
621+
"ATF_USETRAILERS" |
622+
"AF_SYS_CONTROL" |
623+
"SYSPROTO_EVENT" |
624+
"PROC_PIDTASKALLINFO" |
625+
"PROC_PIDTASKINFO" |
626+
"PROC_PIDTHREADINFO" |
627+
"UTUN_OPT_FLAGS" |
628+
"UTUN_OPT_IFNAME" |
629+
"BPF_ALIGNMENT" |
630+
"SYSPROTO_CONTROL" if ios => true,
631+
s if ios && s.starts_with("RTF_") => true,
632+
s if ios && s.starts_with("RTM_") => true,
633+
s if ios && s.starts_with("RTA_") => true,
634+
s if ios && s.starts_with("RTAX_") => true,
635+
s if ios && s.starts_with("RTV_") => true,
636+
s if ios && s.starts_with("DLT_") => true,
637+
597638
_ => false,
598639
}
599640
});
@@ -736,6 +777,10 @@ fn main() {
736777
// FIXME: mincore is defined with caddr_t on Solaris.
737778
"mincore" if solaris => true,
738779

780+
// These were all included in historical versions of iOS but appear
781+
// to be removed now
782+
"system" | "ptrace" if ios => true,
783+
739784
_ => false,
740785
}
741786
});

src/unix/bsd/apple/mod.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -765,16 +765,8 @@ pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000;
765765
pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000;
766766
pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000;
767767
pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000;
768-
pub const VM_FLAGS_USER_ALLOCATE: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE |
769-
VM_FLAGS_PURGABLE |
770-
VM_FLAGS_RANDOM_ADDR |
771-
VM_FLAGS_NO_CACHE |
772-
VM_FLAGS_OVERWRITE |
773-
VM_FLAGS_SUPERPAGE_MASK |
774-
VM_FLAGS_ALIAS_MASK;
775-
pub const VM_FLAGS_USER_MAP: ::c_int = VM_FLAGS_USER_ALLOCATE |
776-
VM_FLAGS_RETURN_4K_DATA_ADDR |
777-
VM_FLAGS_RETURN_DATA_ADDR;
768+
pub const VM_FLAGS_USER_ALLOCATE: ::c_int = 0xff07401b;
769+
pub const VM_FLAGS_USER_MAP: ::c_int = 0xff97401b;
778770
pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE |
779771
VM_FLAGS_RANDOM_ADDR |
780772
VM_FLAGS_OVERWRITE |

src/unix/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,7 @@ extern {
931931
pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
932932
pub fn closelog();
933933
pub fn setlogmask(maskpri: ::c_int) -> ::c_int;
934+
#[cfg_attr(target_os = "macos", link_name = "syslog$DARWIN_EXTSN")]
934935
pub fn syslog(priority: ::c_int, message: *const ::c_char, ...);
935936
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
936937
link_name = "nice$UNIX2003")]

0 commit comments

Comments
 (0)