File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 33
33
'ovmf_dir' : WORKSPACE_DIR / 'uefi-test-runner' ,
34
34
}
35
35
36
+ # Path to target directory. If None, it will be initialized with information
37
+ # from cargo metadata at the first time target_dir function is invoked.
38
+ TARGET_DIR = None
39
+
40
+ def target_dir ():
41
+ 'Returns the target directory'
42
+ global TARGET_DIR
43
+ if TARGET_DIR is None :
44
+ cmd = ['cargo' , 'metadata' , '--format-version=1' ]
45
+ result = sp .run (cmd , stdout = sp .PIPE )
46
+ result .check_returncode ()
47
+ TARGET_DIR = Path (json .loads (result .stdout )['target_directory' ])
48
+ return TARGET_DIR
49
+
36
50
def build_dir ():
37
51
'Returns the directory where Cargo places the build artifacts'
38
- return WORKSPACE_DIR / 'target' / SETTINGS ['target' ] / SETTINGS ['config' ]
52
+ return target_dir () / SETTINGS ['target' ] / SETTINGS ['config' ]
39
53
40
54
def esp_dir ():
41
55
'Returns the directory where we will build the emulated UEFI system partition'
You can’t perform that action at this time.
0 commit comments