File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,31 @@ serde_json = "1.0"
49
49
"""
50
50
51
51
def build (tgt_dir ):
52
- pass
52
+ # support RELEASE
53
+ cmd = ["cargo" , "build" ]
54
+ bin_dir = "debug"
55
+ if "RELEASE" in os .environ :
56
+ cmd += "--release"
57
+ bin_dir = "release"
58
+ env = {
59
+ "CARGO_HOME" : "/usr/local/cargo" ,
60
+ "PATH" : "/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ,
61
+ "RUSTUP_HOME" : "/usr/local/rustup"
62
+ }
63
+ p = subprocess .Popen (cmd ,
64
+ stdout = subprocess .PIPE ,
65
+ stderr = subprocess .PIPE ,
66
+ cwd = "/usr/src" , env = env )
67
+ (o , e ) = p .communicate ()
68
+ if isinstance (o , bytes ): o = o .decode ('utf-8' )
69
+ if isinstance (e , bytes ): e = e .decode ('utf-8' )
70
+ if p .returncode != 0 :
71
+ sys .stdout .write (o )
72
+ sys .stdout .write (e )
73
+ else :
74
+ shutil .move (
75
+ "/usr/src/target/%s/action_loop" % bin_dir ,
76
+ "%s/exec" % tgt_dir )
53
77
54
78
def sources (main , src_dir ):
55
79
# move away the action dir and replace with the new
You can’t perform that action at this time.
0 commit comments