Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixmoebius
libc
Commits
3f1e8b9c
Commit
3f1e8b9c
authored
5 years ago
by
Alex Crichton
Browse files
Options
Downloads
Patches
Plain Diff
Enable the wasi target on CI
Now that wasi is in nightlies, we can run it on PRs!
parent
173c5be7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.travis.yml
+3
-0
3 additions, 0 deletions
.travis.yml
ci/docker/wasm32-unknown-wasi/Dockerfile
+5
-5
5 additions, 5 deletions
ci/docker/wasm32-unknown-wasi/Dockerfile
src/wasi.rs
+12
-9
12 additions, 9 deletions
src/wasi.rs
with
20 additions
and
14 deletions
.travis.yml
+
3
−
0
View file @
3f1e8b9c
...
...
@@ -204,6 +204,9 @@ matrix:
stage
:
tier2
-
env
:
TARGET=x86_64-unknown-linux-musl
stage
:
tier2
-
env
:
TARGET=wasm32-unknown-wasi
rust
:
nightly
stage
:
tier2
allow_failures
:
# FIXME: android build bots time out irregularly
...
...
This diff is collapsed.
Click to expand it.
ci/docker/wasm32-unknown-wasi/Dockerfile
+
5
−
5
View file @
3f1e8b9c
...
...
@@ -28,7 +28,7 @@ RUN mv /clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04 /wasmcc
# those breaking changes on `libc`'s own CI
RUN
git clone https://github.com/CraneStation/wasi-sysroot
&&
\
cd
wasi-sysroot
&&
\
git reset
--hard
3
20054e84f8f2440def3b1c8700cedb8fd697bf
8
git reset
--hard
3
ca44511c298cbbc99e690b761310070b3527fe
8
RUN
make
-C
wasi-sysroot
install
-j
$(
nproc
)
WASM_CC
=
/wasmcc/bin/clang
INSTALL_DIR
=
/wasi-sysroot
# This is a small wrapper script which executes the actual clang binary in
...
...
@@ -58,9 +58,9 @@ RUN curl -sSf https://sh.rustup.rs | sh -s -- -y
ENV
PATH=/root/.cargo/bin:$PATH
RUN
apt-get
install
-y
--no-install-recommends
python
RUN
git clone https://github.com/CraneStation/wasmtime
-wasi
wasmtime
&&
\
RUN
git clone https://github.com/CraneStation/wasmtime wasmtime
&&
\
cd
wasmtime
&&
\
git reset
--hard
4fe2d6084e5b5cc74e69a26860f12750df51d339
git reset
--hard
a1c123c3dd8f9766990efe0f1734a646f61ba8a0
RUN
cargo build
--release
--manifest-path
wasmtime/Cargo.toml
# And finally in the last image we're going to assemble everything together.
...
...
@@ -75,9 +75,9 @@ RUN apt-get update && \
libxml2
# Copy over clang we downloaded to link executables ...
COPY
--from=
reference
-sysroot /wasmcc /wasmcc/
COPY
--from=
wasi
-sysroot /wasmcc /wasmcc/
# ... and the sysroot we built to link executables against ...
COPY
--from=
reference
-sysroot /wasi-sysroot/ /wasi-sysroot/
COPY
--from=
wasi
-sysroot /wasi-sysroot/ /wasi-sysroot/
# ... and finally wasmtime to actually execute binaries
COPY
--from=wasmtime /wasmtime/target/release/wasmtime /usr/bin/
...
...
This diff is collapsed.
Click to expand it.
src/wasi.rs
+
12
−
9
View file @
3f1e8b9c
...
...
@@ -388,12 +388,15 @@ pub const __WASI_WHENCE_CUR: u8 = 0;
pub
const
__WASI_WHENCE_END
:
u8
=
1
;
pub
const
__WASI_WHENCE_SET
:
u8
=
2
;
#[cfg_attr(feature
=
"rustc-dep-of-std"
,
link(name
=
"c"
,
kind
=
"static"
,
cfg(target_feature
=
"crt-static"
)))]
#[cfg_attr(feature
=
"rustc-dep-of-std"
,
link(name
=
"c"
,
cfg(not(target_feature
=
"crt-static"
))))]
extern
{
#[cfg_attr(
feature
=
"rustc-dep-of-std"
,
link(name
=
"c"
,
kind
=
"static"
,
cfg(target_feature
=
"crt-static"
))
)]
#[cfg_attr(
feature
=
"rustc-dep-of-std"
,
link(name
=
"c"
,
cfg(not(target_feature
=
"crt-static"
)))
)]
extern
"C"
{
pub
fn
_Exit
(
code
:
c_int
)
->
!
;
pub
fn
_exit
(
code
:
c_int
)
->
!
;
pub
fn
abort
()
->
!
;
...
...
@@ -452,8 +455,8 @@ extern {
pub
fn
puts
(
a
:
*
const
c_char
)
->
c_int
;
pub
fn
perror
(
a
:
*
const
c_char
);
pub
fn
srand
(
a
:
c_uint
);
pub
fn
atexit
(
a
:
extern
fn
())
->
c_int
;
pub
fn
at_quick_exit
(
a
:
extern
fn
())
->
c_int
;
pub
fn
atexit
(
a
:
extern
"C"
fn
())
->
c_int
;
pub
fn
at_quick_exit
(
a
:
extern
"C"
fn
())
->
c_int
;
pub
fn
quick_exit
(
a
:
c_int
)
->
!
;
pub
fn
posix_memalign
(
a
:
*
mut
*
mut
c_void
,
b
:
size_t
,
c
:
size_t
)
->
c_int
;
pub
fn
rand_r
(
a
:
*
mut
c_uint
)
->
c_int
;
...
...
@@ -501,7 +504,7 @@ extern {
}
#[link(wasm_import_module
=
"wasi_unstable"
)]
extern
{
extern
"C"
{
#[link_name
=
"clock_res_get"
]
pub
fn
__wasi_clock_res_get
(
clock_id
:
__wasi_clockid_t
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment