This is an automated email from the ASF dual-hosted git repository. msciabarra pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-runtime-rust.git
commit 253b03af8de724bd97e43d059d97a93a9cb74ea4 Author: Michele Sciabarra <msciaba...@apache.org> AuthorDate: Tue Mar 5 17:09:12 2019 +0100 fixed compilation --- rust1.32/compile | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/rust1.32/compile b/rust1.32/compile index 343e76a..650904e 100755 --- a/rust1.32/compile +++ b/rust1.32/compile @@ -49,7 +49,31 @@ serde_json = "1.0" """ def build(tgt_dir): - pass + # support RELEASE + cmd = ["cargo", "build"] + bin_dir = "debug" + if "RELEASE" in os.environ: + cmd += "--release" + bin_dir = "release" + env = { + "CARGO_HOME": "/usr/local/cargo", + "PATH": "/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "RUSTUP_HOME": "/usr/local/rustup" + } + p = subprocess.Popen(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + cwd="/usr/src", env=env) + (o, e) = p.communicate() + if isinstance(o, bytes): o = o.decode('utf-8') + if isinstance(e, bytes): e = e.decode('utf-8') + if p.returncode != 0: + sys.stdout.write(o) + sys.stdout.write(e) + else: + shutil.move( + "/usr/src/target/%s/action_loop" % bin_dir, + "%s/exec" % tgt_dir) def sources(main, src_dir): # move away the action dir and replace with the new