Use Z option for docker-run volume mount

This is necessary on systems with SELinux to prevent file permission/access errors when building WASM output

 * cli/src/wasm.rs: Use Z volume mount option for docker-run
 * script/build-wasm: Likewise.
This commit is contained in:
Matthew Krupcale 2019-06-29 15:49:25 -04:00
parent 83f0ea80cf
commit 71d96e813f
2 changed files with 3 additions and 3 deletions

View file

@ -33,12 +33,12 @@ pub fn compile_language_to_wasm(language_dir: &Path, force_docker: bool) -> Resu
let mut volume_string;
if let (Some(parent), Some(filename)) = (language_dir.parent(), language_dir.file_name()) {
volume_string = OsString::from(parent);
volume_string.push(":/src");
volume_string.push(":/src:Z");
command.arg("--workdir");
command.arg(&Path::new("/src").join(filename));
} else {
volume_string = OsString::from(language_dir);
volume_string.push(":/src");
volume_string.push(":/src:Z");
command.args(&["--workdir", "/src"]);
}

View file

@ -67,7 +67,7 @@ if which emcc > /dev/null && [[ "$force_docker" == "0" ]]; then
elif which docker > /dev/null; then
emcc="docker run \
--rm \
-v $(pwd):/src \
-v $(pwd):/src:Z \
-u $(id -u) \
-e EMCC_FORCE_STDLIBS=libc++ \
trzeci/emscripten-slim \