Skip to content

Commit 6991bf9

Browse files
author
Jethro Beekman
committed
Add x86_64-fortanix-unknown-sgx to CI
1 parent d15e9d2 commit 6991bf9

File tree

3 files changed

+54
-14
lines changed

3 files changed

+54
-14
lines changed

.travis.yml

+32
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,38 @@ matrix:
416416
sources:
417417
- ubuntu-toolchain-r-test
418418

419+
- env: TARGET_X=x86_64-fortanix-unknown-sgx FEATURES_X= MODE_X=DEBUG KCOV=0
420+
rust: nightly
421+
os: linux
422+
dist: trusty
423+
424+
- env: TARGET_X=x86_64-fortanix-unknown-sgx FEATURES_X= MODE_X=RELWITHDEBINFO KCOV=0
425+
rust: nightly
426+
os: linux
427+
dist: trusty
428+
429+
- env: TARGET_X=x86_64-fortanix-unknown-sgx CC_X=gcc-7 FEATURES_X= MODE_X=DEBUG KCOV=0
430+
rust: nightly
431+
os: linux
432+
dist: trusty
433+
addons:
434+
apt:
435+
packages:
436+
- gcc-7
437+
sources:
438+
- ubuntu-toolchain-r-test
439+
440+
- env: TARGET_X=x86_64-fortanix-unknown-sgx CC_X=gcc-7 FEATURES_X= MODE_X=RELWITHDEBINFO KCOV=0
441+
rust: nightly
442+
os: linux
443+
dist: trusty
444+
addons:
445+
apt:
446+
packages:
447+
- gcc-7
448+
sources:
449+
- ubuntu-toolchain-r-test
450+
419451
- env: TARGET_X=x86_64-apple-darwin FEATURES_X= MODE_X=DEBUG KCOV=0
420452
rust: beta
421453
os: osx

mk/travis.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if [[ "$TARGET_X" =~ ^(arm|aarch64) && ! "$TARGET_X" =~ android ]]; then
4747
sudo apt-get install --no-install-recommends binfmt-support qemu-user-binfmt -y
4848
fi
4949

50-
if [[ ! "$TARGET_X" =~ "x86_64-" ]]; then
50+
if [[ "$TARGET_X" != "$(rustc --version --verbose|sed -n 's/^host: //p')" ]]; then
5151
rustup target add "$TARGET_X"
5252

5353
# By default cargo/rustc seems to use cc for linking, We installed the
@@ -92,7 +92,7 @@ else
9292
fi
9393

9494
case $TARGET_X in
95-
armv7-linux-androideabi)
95+
armv7-linux-androideabi|x86_64-fortanix-unknown-sgx)
9696
cargo test -vv -j2 --no-run ${mode-} ${FEATURES_X-} --target=$TARGET_X
9797
# TODO: There used to be some logic for running the tests here using the
9898
# Android emulator. That was removed because something broke this. See

mk/update-travis-yml.py

+20-12
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"arm-unknown-linux-gnueabihf" : [ "arm-linux-gnueabihf-gcc" ],
4848
"i686-unknown-linux-gnu" : linux_compilers,
4949
"x86_64-unknown-linux-gnu" : linux_compilers,
50+
"x86_64-fortanix-unknown-sgx" : linux_compilers,
5051
"x86_64-apple-darwin" : osx_compilers,
5152
}
5253

@@ -76,17 +77,20 @@
7677
"aarch64-unknown-linux-gnu",
7778
"i686-unknown-linux-gnu",
7879
"arm-unknown-linux-gnueabihf",
80+
"x86_64-fortanix-unknown-sgx",
7981
],
8082
}
8183

8284
def format_entries():
83-
return "\n".join([format_entry(os, target, compiler, rust, mode, features)
84-
for rust in rusts
85-
for os in oss
86-
for target in targets[os]
87-
for compiler in compilers[target]
88-
for mode in modes
89-
for features in feature_sets])
85+
return "\n".join([entry for entry in
86+
(format_entry(os, target, compiler, rust, mode, features)
87+
for rust in rusts
88+
for os in oss
89+
for target in targets[os]
90+
for compiler in compilers[target]
91+
for mode in modes
92+
for features in feature_sets)
93+
if entry is not None])
9094

9195
# We use alternative names (the "_X" suffix) so that, in mk/travis.sh, we can
9296
# ensure that we set the specific variables we want and that no relevant
@@ -111,6 +115,12 @@ def format_entries():
111115
%(sources)s"""
112116

113117
def format_entry(os, target, compiler, rust, mode, features):
118+
if target == "x86_64-fortanix-unknown-sgx" and rust != "nightly":
119+
return
120+
# Tracked in https://github.com/fortanix/rust-sgx/issues/64
121+
if target == "x86_64-fortanix-unknown-sgx" and compiler == "clang":
122+
return
123+
114124
target_words = target.split("-")
115125
arch = target_words[0]
116126
vendor = target_words[1]
@@ -127,13 +137,11 @@ def format_entry(os, target, compiler, rust, mode, features):
127137
mode == "DEBUG")
128138

129139
if sys == "darwin":
130-
abi = sys
131140
sys = "macos"
132141
elif sys == "androideabi":
133-
abi = sys
134142
sys = "linux"
135-
else:
136-
abi = target_words[3]
143+
elif target == "x86_64-fortanix-unknown-sgx":
144+
sys = "linux"
137145

138146
def prefix_all(prefix, xs):
139147
return [prefix + x for x in xs]
@@ -263,7 +271,7 @@ def main():
263271
file.seek(0)
264272
file.write(new_contents)
265273
file.truncate()
266-
print new_contents
274+
print new_contents,
267275

268276
if __name__ == '__main__':
269277
main()

0 commit comments

Comments
 (0)